Browse Source

提交代码

Lijy 5 months ago
parent
commit
43b3265fb3
20 changed files with 462 additions and 114 deletions
  1. 29 0
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/scss/iframe.scss
  2. 2 0
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formCorrespondenceProcessing.js
  3. 18 1
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formItem.vue
  4. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formView.vue
  5. 21 0
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/translationComponent.vue
  6. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/layout/Page.vue
  7. 2 1
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/hooks/useApi.js
  8. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/hooks/useTheme.js
  9. 37 34
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/addEditor/index.vue
  10. 110 14
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/login.vue
  11. 94 36
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue
  12. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/addEditor.vue
  13. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contacts/addEditor.vue
  14. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contract/addEditor.vue
  15. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/customer/addEditor.vue
  16. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/order/addEditor.vue
  17. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/product/addEditor.vue
  18. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/tasks/addEditor.vue
  19. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/thread/addEditor.vue
  20. 73 0
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/corpWXparam.js

+ 29 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/scss/iframe.scss

@@ -0,0 +1,29 @@
+$themeColor: #075985;
+
+.text-size-small {
+  font-size: 12px;
+}
+.text-size-in {
+  font-size: 16px;
+}
+.text-size-large {
+  font-size: 18px;
+}
+
+.themeTextColor {
+  color: $themeColor;
+}
+
+.backgroundThemeColor {
+  background-color: $themeColor;
+}
+
+.items-justify-center {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.mar-20px {
+  margin: 14px 20px;
+}

+ 2 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formCorrespondenceProcessing.js

@@ -18,6 +18,8 @@ export function itemFormSetValue(formJson = [], formVal = {}) {
     if (formVal[item.model]) {
       item.options.defaultValue = formVal[item.model];
       item.options.disabled = false
+    } else {
+      item.options.defaultValue = '';
     }
   }
   return list;

+ 18 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formItem.vue

@@ -11,6 +11,7 @@
       :readonly="element.options?.readonly"
       :required="element.options?.rules?.required"
       :rules="[{ validator: characterVerification, message: '' }]"
+      :class="`${element.options?.rules?.required ? '' : 'resetStyles'} resetStyles-right`"
     />
   </template>
   <template v-if="element.type === 'number'">
@@ -26,6 +27,7 @@
       :readonly="element.options?.readonly"
       :required="element.options?.rules?.required"
       :rules="[{ validator: characterVerification, message: '' }]"
+      :class="`${element.options?.rules?.required ? '' : 'resetStyles'} resetStyles-right`"
     />
   </template>
   <!-- 正常的下拉框 -->
@@ -42,6 +44,7 @@
       @click="element.options?.disabled ? '' : (showSelect = true)"
       readonly
       is-link
+      :class="element.options?.rules?.required ? '' : 'resetStyles'"
     >
       <template #input v-if="element.options.defaultValue">
         {{ selectedLabel }}
@@ -62,6 +65,7 @@
       @click="element.options?.disabled ? '' : (showSelect = true)"
       readonly
       is-link
+      :class="element.options?.rules?.required ? '' : 'resetStyles'"
     >
       <template #input v-if="element.options.defaultValue">
         {{ selectedLabel }}
@@ -82,6 +86,7 @@
       @click="showPickerClick"
       readonly
       is-link
+      :class="element.options?.rules?.required ? '' : 'resetStyles'"
     />
   </template>
   <template v-if="element.type === 'textarea'">
@@ -99,6 +104,7 @@
       :readonly="element.options?.readonly"
       :required="element.options?.rules?.required"
       :rules="[{ validator: characterVerification, message: '' }]"
+      :class="`${element.options?.rules?.required ? '' : 'resetStyles'} resetStyles-right`"
     />
   </template>
 
@@ -246,4 +252,15 @@ onMounted(() => {
 });
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.resetStyles {
+  ::v-deep .van-field__label {
+    padding-left: 7.35px;
+  }
+}
+.resetStyles-right {
+  ::v-deep .van-cell__value {
+    margin-right: 20px;
+  }
+}
+</style>

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formView.vue

@@ -1,5 +1,5 @@
 <template>
-  <van-form ref="formRef" show-error :show-error-message="false" label-align="right">
+  <van-form ref="formRef" show-error :show-error-message="false" label-align="left" input-align="right" class="bg-white">
     <template v-for="item in list">
       <FormItem :element="item" @validateASingleForm="validateASingleForm" @cascadeProcessing="cascadeProcessing" />
     </template>

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

@@ -0,0 +1,21 @@
+<template>
+  <Page title='首页'>
+    <template v-slot:body>
+    </template>
+  </Page>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import { useLifecycle } from '@hooks/useCommon.js';
+
+useLifecycle({
+  load: () => {
+    // 添加加载逻辑
+  }
+});
+</script>
+
+<style lang='scss' scoped>
+  /* 样式代码 */
+</style>

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/layout/Page.vue

@@ -6,11 +6,11 @@
                      :border="!!props.title"
                      :style="`height:${usePxToVwView(headerHeight)}`">
             <template v-slot:left>
-                <van-icon @click="goBack" class-prefix="iconfont icon" name="fanhui" v-if="routerStore.currentPages?.length>1"/>
+                <van-icon @click="goBack" name="revoke" size="1.29rem" color="#000000" class="font-bold" v-if="routerStore.currentPages?.length>1"/>
                 <slot name="headerLeft"></slot>
             </template>
             <template v-slot:title>
-                <span v-if="props.title">{{ props.title }}</span>
+                <span v-if="props.title" class="text-size-large">{{ props.title }}</span>
                 <slot v-else name="title"></slot>
             </template>
             <template v-slot:right>

+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/hooks/useApi.js

@@ -1,5 +1,6 @@
-
 export const LOGIN_INTERFACE = `/user/loginAdmin` // 登录接口
+export const USER_ID_LOGIN = `/user/loginByUserId` // userId 登录
+export const WE_CHAT_LOGIN = `/wxcorp/corpWeiXinLogin` // 微信登录
 export const GET_CUSTOM_FORM_JSON = `/sys-form/getListByCode` // 获取自定义表单json
 
 export const GET_A_LIST_OF_BUSINESS_OPPORTUNITIES = '/business-opportunity/list' // 获取商机列表

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/hooks/useTheme.js

@@ -1,6 +1,6 @@
 /*主题颜色*/
 const color = {
-    // primary: 'red' //主体色
+    primary: '#075985' //主体色
 };
 
 /*获取vant主题变量配置*/

+ 37 - 34
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/addEditor/index.vue

@@ -1,41 +1,43 @@
 <template>
   <Page :title="`${currentRoutingInformation?.name}${addOrEdit ? '编辑' : '新增'}`">
     <template v-slot:body>
-      <van-skeleton title :row="10" v-if="pageLoading" class="w-full h-full" />
-      <template v-if="!pageLoading">
-        <!-- 商机 -->
-        <template v-if="currentRoutingInformation?.key == 'business'">
-          <Business :formJson="formJson" :formValue="formValue" />
+      <div class="w-full h-full pt-2">
+        <van-skeleton title :row="10" v-if="pageLoading" class="w-full h-full" />
+        <template v-if="!pageLoading">
+          <!-- 商机 -->
+          <template v-if="currentRoutingInformation?.key == 'business'">
+            <Business :formJson="formJson" :formValue="formValue" />
+          </template>
+          <!-- 线索 -->
+          <template v-if="currentRoutingInformation?.key == 'thread'">
+            <Thread :formJson="formJson" :formValue="formValue" />
+          </template>
+          <!-- 客户 -->
+          <template v-if="currentRoutingInformation?.key == 'customer'">
+            <Customer :formJson="formJson" :formValue="formValue" />
+          </template>
+          <!-- 联系人 -->
+          <template v-if="currentRoutingInformation?.key == 'contacts'">
+            <Contacts :formJson="formJson" :formValue="formValue" />
+          </template>
+          <!-- 任务 -->
+          <template v-if="currentRoutingInformation?.key == 'tasks'">
+            <Tasks :formJson="formJson" :formValue="formValue" />
+          </template>
+          <!-- 产品管理 -->
+          <template v-if="currentRoutingInformation?.key == 'product'">
+            <Product :formJson="formJson" :formValue="formValue" />
+          </template>
+          <!-- 合同管理 -->
+          <template v-if="currentRoutingInformation?.key == 'contract'">
+            <Contract :formJson="formJson" :formValue="formValue" />
+          </template>
+          <!-- 销售订单 -->
+          <template v-if="currentRoutingInformation?.key == 'order'">
+            <Order :formJson="formJson" :formValue="formValue" />
+          </template>
         </template>
-        <!-- 线索 -->
-        <template v-if="currentRoutingInformation?.key == 'thread'">
-          <Thread :formJson="formJson" :formValue="formValue" />
-        </template>
-        <!-- 客户 -->
-        <template v-if="currentRoutingInformation?.key == 'customer'">
-          <Customer :formJson="formJson" :formValue="formValue" />
-        </template>
-        <!-- 联系人 -->
-        <template v-if="currentRoutingInformation?.key == 'contacts'">
-          <Contacts :formJson="formJson" :formValue="formValue" />
-        </template>
-        <!-- 任务 -->
-        <template v-if="currentRoutingInformation?.key == 'tasks'">
-          <Tasks :formJson="formJson" :formValue="formValue" />
-        </template>
-        <!-- 产品管理 -->
-        <template v-if="currentRoutingInformation?.key == 'product'">
-          <Product :formJson="formJson" :formValue="formValue" />
-        </template>
-        <!-- 合同管理 -->
-        <template v-if="currentRoutingInformation?.key == 'contract'">
-          <Contract :formJson="formJson" :formValue="formValue" />
-        </template>
-        <!-- 销售订单 -->
-        <template v-if="currentRoutingInformation?.key == 'order'">
-          <Order :formJson="formJson" :formValue="formValue" />
-        </template>
-      </template>
+      </div>
     </template>
   </Page>
 </template>
@@ -72,6 +74,7 @@ function reloadListData(data) {
   formValue.value = (filedValue && Object.keys(JSON.parse(filedValue)).length)
     ? JSON.parse(filedValue)
     : {}
+  addOrEdit.value = (filedValue && Object.keys(JSON.parse(filedValue)).length) ? true : false
   if (fixedData.formJson[info.key]) {
     formJson.value = fixedData.formJson[info.key]
     closeLoading()

+ 110 - 14
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/login.vue

@@ -17,12 +17,13 @@
 <script setup>
 import { ref } from "vue";
 import { useLifecycle } from "@hooks/useCommon.js";
-import { LOGIN_INTERFACE } from "@hooks/useApi.js";
+import { LOGIN_INTERFACE, USER_ID_LOGIN, WE_CHAT_LOGIN } from "@hooks/useApi.js";
+import { addressRedirection, obtainEnterpriseWeChatParameters } from "@utility/corpWXparam"
 import useShowToast from "../hooks/useToast";
 import useRouterStore from "@store/useRouterStore.js";
 import useInfoStore from "@store/useInfoStore.js";
 import requests from "@common/requests";
-const { toastLoading, toastSuccess } = useShowToast();
+const { toastLoading, toastSuccess, toastFail } = useShowToast();
 
 const router = useRouterStore()
 const userInfo = useInfoStore()
@@ -30,27 +31,122 @@ const username = ref("18122222222");
 const password = ref("000000");
 const rules = ref([{ required: true }]);
 
+const isCorpWX = ref(false)
+const isWX = ref(false)
+
 useLifecycle({
   load: () => {
-
+    verifyLoginEnvironment()
   }
 });
 
+function verifyLoginEnvironment() {
+  const currentEnvironment = navigator.userAgent.toLowerCase();
+  isCorpWX.value = currentEnvironment.indexOf("wxwork") > 0 ? true : false
+  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);
+    if (loginUserId.includes('#/')) {
+      loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
+    }
+    loginByUserId(loginUserId);
+  } else {
+    // 判断是否为企业微信授权
+    if (isCorpWX.value) {
+      // 判断企业微信,是否存在授权
+      if (href.includes("com/?code")) {
+        bindIfNessary()
+      } else {
+        if (href.indexOf('hasTriedAutoLogin') == -1) {
+          tryAutoLogin()
+        } else {
+          //后台经过验证后,重定向过来带上了userId
+          const loginUserId = href.substring(href.indexOf("userId=") + "userId=".length);
+          if (loginUserId.includes('#/')) {
+            loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
+          }
+          loginByUserId(loginUserId);
+        }
+      }
+    }
+  }
+}
+
+// 账号密码登录
 function onSubmit(fromVal) {
   toastLoading('登陆中...', 0)
   requests.post(LOGIN_INTERFACE, { ...fromVal }).then(({ data }) => {
-    userInfo.updateState({
-      userInfo: data,
-      token: data.id,
-      modularList: separateRouting(data.moduleList || []),
-      permissionList: data.functionList || []
-    })
-    router.switchTabBar({
-      pathName: 'home',
-      success: function () {
-        toastSuccess('登陆成功')
+    loginProcessing(data)
+  })
+}
+
+// userId登录
+function loginByUserId(userId) {
+  toastLoading('登陆中...', 0)
+  requests.post(USER_ID_LOGIN, { params: { userId } }).then(({ data }) => {
+    loginProcessing(data)
+  })
+}
+
+// 授权回调重定向
+function tryAutoLogin() {
+  window.location.href = addressRedirection()
+}
+
+function bindIfNessary() {
+  const href = window.location.href;
+  const requestUrl = isCorpWX.value ? '/wxcorp/bindCorpWeiXin' : isWX ? '/wechat/bindWeiXin' : '';
+  if (requestUrl.length > 0) {
+    //url包括 com/?code 证明为从微信跳转回来的
+    if (href.includes("com/?code")) {
+      const url = href; //vue自动在末尾加了 #/ 符号,截取去掉
+      const jingPosit = url.indexOf("com/") + 4; //获取域名结束的位置
+      const urlRight = url.substring(jingPosit, url.indexOf('#/') !== -1 ? url.indexOf('#/') : url.length); //url右侧部分
+      const code = urlRight.substring('?code='.length, urlRight.indexOf('&state='));
+      const passUserId = urlRight.substring(urlRight.indexOf('&state=') + '&state='.length);
+      if (passUserId == '0') {
+        requests.get(WE_CHAT_LOGIN, { code }).then((res) => {
+          if (res.data != null && ((isWX.value && res.data.wxOpenid != undefined)
+            || (isCorpWX.value && res.data.corpwxUserid != undefined))) {
+            loginProcessing(res.data)
+            window.location.href = '/#/index';
+          }
+        })
+      } else {
+        //绑定微信账号的回调, 调用后台接口,注册用户
+        requests.get(requestUrl, { code, userId: passUserId }).then((res) => {
+          if (res == null) {
+            toastFail('绑定失败')
+            return
+          }
+          if (res.data != null && ((isWX.value && res.data.wxOpenid != undefined)
+            || (isCorpWX.value && res.data.corpwxUserid != undefined))) {
+            loginProcessing(res.data)
+            window.location.href = '/#/my/center';
+          }
+        })
+      }
+    }
+  }
+}
+
+// 登陆前的处理
+function loginProcessing(data = {}) {
+  userInfo.updateState({
+    userInfo: data,
+    token: data.id,
+    modularList: separateRouting(data.moduleList || []),
+    permissionList: data.functionList || []
+  })
+  router.switchTabBar({
+    pathName: 'home',
+    success: function () {
+      if(isCorpWX.value) {
+        obtainEnterpriseWeChatParameters(data)
       }
-    })
+      toastSuccess('登陆成功')
+    }
   })
 }
 

+ 94 - 36
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue

@@ -1,37 +1,68 @@
 <template>
   <Page :title='`${queryParameters?.name}列表`'>
     <template v-slot:body>
-      <template v-if="listData?.records && listData.records.length">
-        <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
-          <van-list v-model:loading="isLoading" :finished="finished" finished-text="没有更多了" @load="onLoad">
-            <div v-for="item in listData.records" :key="item.id" @click="toDetail(item)">
-              <ElementLongPress :row="item" :popUpWindowArray="popUpWindowArray" @longPress="longPress">
-                <div class="p-[10px] bg-white my-[8px]">
-                  <!-- 商机 -->
-                  <template v-if="queryParameters?.key == 'business'">{{ item.name }}</template>
-                  <!-- 线索 -->
-                  <template v-if="queryParameters?.key == 'thread'">{{ item.clueName }}</template>
-                  <!-- 客户 -->
-                  <template v-if="queryParameters?.key == 'customer'">{{ item.customName }}</template>
-                  <!-- 联系人 -->
-                  <template v-if="queryParameters?.key == 'contacts'">{{ item.name }}</template>
-                  <!-- 任务 -->
-                  <template v-if="queryParameters?.key == 'tasks'">{{ item.taskName }}</template>
-                  <!-- 产品 -->
-                  <template v-if="queryParameters?.key == 'product'">{{ item.productName }}</template>
-                  <!-- 合同 -->
-                  <template v-if="queryParameters?.key == 'contract'">{{ item.name }}</template>
-                  <!-- 销售 -->
-                  <template v-if="queryParameters?.key == 'order'">{{ item.orderName }}</template>
+      <div class="flex flex-col h-full">
+        <!-- 搜索 -->
+        <div class="mx-1">
+          <van-search v-model="searchVal" background="#F8F8F8" :placeholder="`请输入${queryParameters?.name}关键词`">
+            <template v-slot:left-icon>
+              <van-icon name="search" class="themeTextColor font-bold" />
+            </template>
+          </van-search>
+        </div>
+        <!-- 主题内容 -->
+        <div class="flex-1 overflow-y-auto">
+          <template v-if="listData?.records && listData.records.length">
+            <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+              <van-list v-model:loading="isLoading" :finished="finished" finished-text="没有更多了" @load="onLoad">
+                <div v-for="item in listData.records" :key="item.id" @click="toDetail(item)">
+                  <van-swipe-cell>
+                    <div class="bg-white px-5 py-5 flex items-center flex-row w-full listContent">
+                      <div class="listOfImages items-justify-center rounded-full overflow-hidden bg-[#FFEEEC]">
+                        图片
+                      </div>
+                      <div class="flex-1 h-full">
+                        <!-- 商机 -->
+                        <template v-if="queryParameters?.key == 'business'">{{ item.name }}</template>
+                        <!-- 线索 -->
+                        <template v-if="queryParameters?.key == 'thread'">{{ item.clueName }}</template>
+                        <!-- 客户 -->
+                        <template v-if="queryParameters?.key == 'customer'">{{ item.customName }}</template>
+                        <!-- 联系人 -->
+                        <template v-if="queryParameters?.key == 'contacts'">{{ item.name }}</template>
+                        <!-- 任务 -->
+                        <template v-if="queryParameters?.key == 'tasks'">{{ item.taskName }}</template>
+                        <!-- 产品 -->
+                        <template v-if="queryParameters?.key == 'product'">{{ item.productName }}</template>
+                        <!-- 合同 -->
+                        <template v-if="queryParameters?.key == 'contract'">{{ item.name }}</template>
+                        <!-- 销售 -->
+                        <template v-if="queryParameters?.key == 'order'">{{ item.orderName }}</template>
+                      </div>
+                    </div>
+                    <template #right>
+                      <div class="flex items-center h-full bg-white">
+                        <template v-for="subItem in popUpWindowArray">
+                          <div class="buttonCircle rounded-full items-justify-center text-white"
+                            :style="`background-color: ${subItem.bg}`" @click="longPress(item, subItem)">
+                            按钮
+                          </div>
+                        </template>
+                      </div>
+                    </template>
+                  </van-swipe-cell>
                 </div>
-              </ElementLongPress>
-            </div>
-          </van-list>
-        </van-pull-refresh>
-      </template>
+              </van-list>
+            </van-pull-refresh>
+          </template>
+        </div>
+      </div>
+
       <!-- 可拖拽添加 -->
       <DragBox>
-        <van-button type="primary" @click="toAddEditor()">添加</van-button>
+        <div class="addButton backgroundThemeColor rounded-full flex items-center justify-center text-white" @click="toAddEditor">
+          添加
+        </div>
       </DragBox>
     </template>
   </Page>
@@ -55,14 +86,14 @@ const TOP_MOUNTED = 'topMounted';
 
 const router = useRouterStore()
 const fixedData = useFixedData()
+const searchVal = ref()
 const queryParameters = ref()
 const popUpWindowArray = ref([
-  { text: '转移', event: TRANSFER, removeModule: ['contacts', 'tasks', 'product', 'contract', 'order'] },
-  { text: '删除', event: DELETE, removeModule: [] },
-  { text: '编辑', event: EDIT, removeModule: [] },
-  { text: '顶置', event: TOP_MOUNTED, removeModule: [] },
+  { text: '转移', event: TRANSFER, bg: '#FFA359', removeModule: ['contacts', 'tasks', 'product', 'contract', 'order'] },
+  { text: '顶置', event: TOP_MOUNTED, bg: '#075985', removeModule: [] },
+  { text: '编辑', event: EDIT, bg: '#07C160', removeModule: [] },
+  { text: '删除', event: DELETE, bg: '#FF6A6A', removeModule: [] },
 ])
-
 const refreshing = ref(false);
 const isLoading = ref(false);
 const finished = ref(false);
@@ -74,7 +105,7 @@ const listData = ref({
   totalPage: 0,
 });
 
-// 按触发的事件: row 为当前点击的行数据, item 为当前点击的按钮
+// 按触发的事件: row 为当前点击的行数据, item 为当前点击的按钮
 function longPress(row, item) {
   switch (item.event) {
     case EDIT:
@@ -200,7 +231,7 @@ function reloadListData(data) {
   finished.value = false
   listData.value = { records: [], pageIndex: 0, pageSize: 20, total: 0, totalPage: 0 }
   popUpWindowArray.value = popUpWindowArray.value.filter(item => !item.removeModule.includes(queryParameters.value?.key))
-  if(!fixedData.formJson[queryParameters.value.key]) {
+  if (!fixedData.formJson[queryParameters.value.key]) {
     getFormJson(queryParameters.value)
   }
   onLoad()
@@ -230,5 +261,32 @@ useLifecycle({
 </script>
 
 <style lang='scss' scoped>
-/* 样式代码 */
+.buttonCircle {
+  width: 37px;
+  height: 37px;
+  margin-left: 10px;
+}
+
+.addButton {
+  width: 60px;
+  height: 60px;
+}
+
+
+.listContent {
+  border: 1px solid #F6F6FA;
+
+  .listOfImages {
+    width: 40px;
+    height: 40px;
+    margin-right: 10px;
+  }
+}
+
+::v-deep .van-search__content {
+  background: #fff !im\portant;
+  height: 42px;
+  align-items: center;
+  border-radius: 6px;
+}
 </style>

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contacts/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contract/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/customer/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/order/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/product/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/tasks/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/thread/addEditor.vue

@@ -1,7 +1,13 @@
 <template>
-  <div class="w-full h-full">
-    <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
-    <van-button type="primary" @click="onSubmit">提交</van-button>
+  <div class="w-full h-full flex flex-col">
+    <div class="flex-1 overflow-y-auto">
+      <CustomerForm ref="formFormRef" :formJson="formJson" :formValue="formVal"></CustomerForm>
+    </div>
+    <div class="mar-20px ">
+      <van-button type="primary" @click="onSubmit" class="w-full">
+        {{ Object.keys(formVal).length > 0 ? '确定修改' : '确定添加' }}
+      </van-button>
+    </div>
   </div>
 </template>
 

+ 73 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/corpWXparam.js

@@ -0,0 +1,73 @@
+import requests from "@common/requests";
+
+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
+
+/**
+ * 企业微信重定向地址
+ * @param {Boolean} isCorpWx 是否为企业微信环境
+ * @returns 企业微信重定向地址
+ */
+export function addressRedirection(isCorpWx = false) {
+  const appId = isCorpWx ? CORP_WX_APPID : WX_APPID
+  const url = isCorpWx ? coprWxTokenUrl : wxTokenUrl
+  return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURI(url)}&response_type=code&scope=snsapi_base&state=0#wechat_redirect`
+}
+
+/**
+ * 企业微信转译授权
+ * @param {Object} data 登录接口返回的data的数据
+ */
+export function obtainEnterpriseWeChatParameters(data = {}) {
+  const token = data.id
+  const curUrl = window.location.href.split('#')[0]
+  requests.post(`/wxcorp/getCorpWXConfig`, { url: curUrl, token }).then((res) => {
+    wx.config({
+      beta: true,
+      debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+      appId: res.data.appid, // 必填,公众号的唯一标识 
+      timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
+      nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
+      signature: res.data.sign, // 必填,签名,见附录1 
+      jsApiList: ['chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'previewFile', 'getLocation', 'agentConfig']
+    })
+
+    wx.ready(function () {
+      // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
+      requests.post(`/wxcorp/getCorpWXAgentConfig`, { url: curUrl, token }).then((res) => {
+        wx.agentConfig({
+          corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
+          agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
+          timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+          nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+          signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+          jsApiList: ['selectExternalContact', 'openThirdAppServiceChat', 'openAppManage'], //必填,传入需要使用的接口名称
+          success: function (result) {
+            //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
+            window.WWOpenData.bind(document.querySelector('ww-open-data'))
+          },
+          fail: function (res) {
+            if (res.errMsg.indexOf('function not exist') > -1) {
+              alert('版本过低请升级')
+            }
+          },
+        })
+      }).catch(err => {
+        if (err.errMsg.indexOf('function not exist') > -1) {
+          alert('版本过低请升级')
+        }
+      })
+    })
+    wx.error(function (res) {
+      // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+      // alert('wxConfig发生异常:'+JSON.stringify(res));
+      // 企业第一次授权安装进入后会报not in reliable domain的错误,刷新后正常
+      location.reload();
+    });
+  }).catch(err => {
+    alert(err);
+  })
+}