소스 검색

Merge remote-tracking branch 'origin/master' into 转接增加清空标签配置

ct 2 일 전
부모
커밋
572e703141
36개의 변경된 파일6905개의 추가작업 그리고 746개의 파일을 삭제
  1. 3 3
      .env.development
  2. 8 4
      .env.prod-test
  3. 17 1
      src/api/company/statistics.js
  4. 7 0
      src/api/course/qw/courseWatchLog.js
  5. 9 0
      src/api/fastGpt/fastgptPushTokenTotal.js
  6. 16 0
      src/api/his/company.js
  7. 53 0
      src/api/his/dfAccount.js
  8. 53 0
      src/api/his/divItem.js
  9. 67 19
      src/api/hisStore/storeOrder.js
  10. 0 54
      src/api/hospital/hospital.js
  11. 240 3
      src/api/qw/externalContact.js
  12. 3 0
      src/views/company/company/index.vue
  13. 7 7
      src/views/company/companyMoneyLogs/index.vue
  14. 1 1
      src/views/components/his/storeOrderDetails.vue
  15. 299 0
      src/views/course/courseWatchLog/qw/statisticsCompany.vue
  16. 65 20
      src/views/course/courseWatchLog/statistics.vue
  17. 13 1
      src/views/course/userWatchCourseStatistics/index.vue
  18. 14 1
      src/views/course/userWatchCourseTotalStatistics/index.vue
  19. 14 1
      src/views/course/userWatchStatistics/index.vue
  20. 2055 0
      src/views/crm/externalContact/index.vue
  21. 259 0
      src/views/fastGpt/fastGptPushTokenTotal/index.vue
  22. 20 4
      src/views/fastGpt/fastgptEventLogTotal/index.vue
  23. 8 8
      src/views/his/answer/index.vue
  24. 170 3
      src/views/his/company/index.vue
  25. 442 0
      src/views/his/dfAccount/index.vue
  26. 378 0
      src/views/his/divItem/index.vue
  27. 30 2
      src/views/his/doctor/type1.vue
  28. 7 7
      src/views/his/package/index.vue
  29. 179 0
      src/views/his/statistics/appOrderCountStats.vue
  30. 186 0
      src/views/his/statistics/hisOrderCountStats.vue
  31. 2 0
      src/views/his/storeOrder/order1.vue
  32. 1156 8
      src/views/hisStore/storeOrder/healthStoreList.vue
  33. 1104 19
      src/views/hisStore/storeOrder/index.vue
  34. 0 580
      src/views/hospital/hospital/index.vue
  35. 13 0
      src/views/index.vue
  36. 7 0
      src/views/system/config/config.vue

+ 3 - 3
.env.development

@@ -1,9 +1,9 @@
 # 页面标题
-VUE_APP_TITLE =小访客管理系统
+VUE_APP_TITLE =互联网医院管理系统
 # 首页菜单标题
-VUE_APP_TITLE_INDEX =小访客
+VUE_APP_TITLE_INDEX =互联网医院
 # 公司名称
-VUE_APP_COMPANY_NAME =西安小访客网络科技有限公司
+VUE_APP_COMPANY_NAME =
 # ICP备案号
 VUE_APP_ICP_RECORD =陕ICP备2025066365号-3
 # ICP网站访问地址

+ 8 - 4
.env.prod-test

@@ -8,6 +8,8 @@ VUE_APP_ICP_RECORD =蜀ICP备2023036719号
 VUE_APP_ICP_URL =https://beian.miit.gov.cn
 # 网站LOG
 VUE_APP_LOG_URL =@/assets/logo/logo.png
+
+
 # 存储桶配置
 VUE_APP_OBS_ACCESS_KEY_ID = K2UTJGIN7UTZJR2XMXYG
 # 存储桶配置
@@ -15,15 +17,17 @@ VUE_APP_OBS_SECRET_ACCESS_KEY = sbyeNJLbcYmH6copxeFP9pAoksM4NIT9Zw4x0SRX
 # 存储桶配置
 VUE_APP_OBS_SERVER = https://obs.cn-north-4.myhuaweicloud.com
 # 存储桶配置
-VUE_APP_OBS_BUCKET = zkzh-hw079058881
+VUE_APP_OBS_BUCKET = myhk-hw079058881
 # 存储桶配置
-VUE_APP_COS_BUCKET = zkzh-1323137866
+VUE_APP_COS_BUCKET = myhk-1323137866
 # 存储桶配置
 VUE_APP_COS_REGION = ap-chongqing
 # 线路一地址
-VUE_APP_VIDEO_LINE_1 = https://zkzhtcpv.ylrzcloud.com
+VUE_APP_VIDEO_LINE_1 = https://myhktcpv.ylrzcloud.com
 # 线路二地址
-VUE_APP_VIDEO_LINE_2 = https://zkzhobs.ylrztop.com
+VUE_APP_VIDEO_LINE_2 = https://myhkobs.ylrztop.com
+
+ 
 
 # 开发环境配置
 ENV = 'development'

+ 17 - 1
src/api/company/statistics.js

@@ -54,7 +54,23 @@ export function inquiryOrder(query) {
     params: query
   })
 }
+// 获取互联网医院订单统计数据
+export function getHisOrderCountStats(query) {
+  return request({
+    url: '/company/statistics/hisOrderCountStats',
+    method: 'get',
+    params: query
+  });
+}
 
+// 获取App商城订单统计数据
+export function getAppOrderCount(query) {
+  return request({
+    url: '/company/statistics/appOrderCountStats',
+    method: 'get',
+    params: query
+  });
+}
 
 export function exportStoreOrder(query) {
   return request({
@@ -170,4 +186,4 @@ export function exportTuiMoney(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 7 - 0
src/api/course/qw/courseWatchLog.js

@@ -23,6 +23,13 @@ export function statisticsList(query) {
     params: query
   })
 }
+export function statisticsListByCompany(query) {
+  return request({
+    url: '/qw/course/courseWatchLog/statisticsListByCompany',
+    method: 'get',
+    params: query
+  })
+}
 export function qwWatchLogStatisticsList(query) {
   return request({
     url: '/qw/course/courseWatchLog/qwWatchLogStatisticsList',

+ 9 - 0
src/api/fastGpt/fastgptPushTokenTotal.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function getFastGptPushTokenTotal(query) {
+  return request({
+    url: '/qw/qwPushCount/tokenList',
+    method: 'get',
+    params: query
+  })
+}

+ 16 - 0
src/api/his/company.js

@@ -71,3 +71,19 @@ export function exportCompany(query) {
     params: query
   })
 }
+
+// 查询诊所管理详细
+export function getDivConfig(companyId) {
+  return request({
+    url: '/his/company/getDivConfig/' + companyId,
+    method: 'get'
+  })
+}
+
+export function setDiv(data) {
+  return request({
+    url: '/his/company/setDiv',
+    method: 'post',
+    data: data
+  })
+}

+ 53 - 0
src/api/his/dfAccount.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询代服账户列表
+export function listAccount(query) {
+  return request({
+    url: '/his/dfAccount/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询代服账户详细
+export function getAccount(id) {
+  return request({
+    url: '/his/dfAccount/' + id,
+    method: 'get'
+  })
+}
+
+// 新增代服账户
+export function addAccount(data) {
+  return request({
+    url: '/his/dfAccount',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改代服账户
+export function updateAccount(data) {
+  return request({
+    url: '/his/dfAccount',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除代服账户
+export function delAccount(id) {
+  return request({
+    url: '/his/dfAccount/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出代服账户
+export function exportAccount(query) {
+  return request({
+    url: '/his/dfAccount/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/his/divItem.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询分账明细列表
+export function listDivItem(query) {
+  return request({
+    url: '/his/divItem/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询分账明细详细
+export function getDivItem(id) {
+  return request({
+    url: '/his/divItem/' + id,
+    method: 'get'
+  })
+}
+
+// 新增分账明细
+export function addDivItem(data) {
+  return request({
+    url: '/his/divItem',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改分账明细
+export function updateDivItem(data) {
+  return request({
+    url: '/his/divItem',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除分账明细
+export function delDivItem(id) {
+  return request({
+    url: '/his/divItem/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出分账明细
+export function exportDivItem(query) {
+  return request({
+    url: '/his/divItem/export',
+    method: 'get',
+    params: query
+  })
+}

+ 67 - 19
src/api/hisStore/storeOrder.js

@@ -1,11 +1,11 @@
 import request from '@/utils/request'
 
 // 查询订单列表
-export function listStoreOrder(query) {
+export function listStoreOrder(data) {
   return request({
     url: '/store/store/storeOrder/list',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: data
   })
 }
 
@@ -34,11 +34,11 @@ export function listPromotionOrder(query) {
   })
 }
 // 查询健康商城订单列表
-export function listHealthStoreOrder(query) {
+export function listHealthStoreOrder(data) {
   return request({
     url: '/store/store/storeOrder/healthList',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: data
   })
 }
 
@@ -122,39 +122,39 @@ export function delStoreOrder(id) {
 }
 
 // 导出订单
-export function exportStoreOrder(query) {
+export function exportStoreOrder(data) {
   return request({
     url: '/store/store/storeOrder/export',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: data
   })
 }
 
 // 导出订单
-export function exportStoreOrderDetails(query) {
+export function exportStoreOrderDetails(data) {
   return request({
     url: '/store/store/storeOrder/exportDetails',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: data
   })
 }
 
 
 // 导出订单
-export function exportHealthStoreOrder(query) {
+export function exportHealthStoreOrder(data) {
   return request({
     url: '/store/store/storeOrder/healthExport',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: data
   })
 }
 
 // 导出订单
-export function exportHealthStoreOrderDetails(query) {
+export function exportHealthStoreOrderDetails(data) {
   return request({
     url: '/store/store/storeOrder/healthExportDetails',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: data
   })
 }
 
@@ -325,7 +325,55 @@ export function orderDimensionStatisticsExport(query) {
 
 export function importDeliveryNoteExpressTemplate() {
   return request({
-    url: '/store/storeOrder/importDeliveryNoteExpressTemplate',
+    url: '/store/store/storeOrder/importDeliveryNoteExpressTemplate',
+    method: 'get'
+  })
+}
+
+export function queryErpPhone(query) {
+  return request({
+    url: '/store/store/storeOrder/queryErpPhone',
+    method: 'get',
+    params: query
+  })
+}
+
+export function saveErpPhone(data) {
+  return request({
+    url: '/store/store/storeOrder/saveErpPhone',
+    method: 'post',
+    data: data
+  })
+}
+
+export function editErpPhone(data) {
+  return request({
+    url: '/store/store/storeOrder/editErpPhone',
+    method: 'post',
+    data: data
+  })
+}
+
+export function batchCreateErpOrder(data) {
+  return request({
+    url: '/store/store/storeOrder/batchCreateErpOrder',
+    method: 'post',
+    data: data
+  })
+}
+
+export function batchSetErpOrder(data) {
+  return request({
+    url: '/store/store/storeOrder/batchSetErpOrder',
+    method: 'post',
+    data: data
+  })
+}
+
+
+export function getErpAccount() {
+  return request({
+    url: '/store/store/storeOrder/getErpAccount',
     method: 'get'
   })
 }

+ 0 - 54
src/api/hospital/hospital.js

@@ -1,54 +0,0 @@
-import request from '@/utils/request'
-
-// 查询诊所列表
-export function listHospital(query) {
-  return request({
-    url: '/hospital/hospital/list',
-    method: 'get',
-    params: query
-  })
-}
-
-// 查询诊所详细
-export function getHospital(hospitalId) {
-  return request({
-    url: '/hospital/hospital/' + hospitalId,
-    method: 'get'
-  })
-}
-
-// 新增诊所
-export function addHospital(data) {
-  return request({
-    url: '/hospital/hospital',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改诊所
-export function updateHospital(data) {
-  return request({
-    url: '/hospital/hospital',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除诊所
-export function delHospital(hospitalId) {
-  return request({
-    url: '/hospital/hospital/' + hospitalId,
-    method: 'delete'
-  })
-}
-
-// 导出诊所
-export function exportHospital(query) {
-  return request({
-    url: '/hospital/hospital/export',
-    method: 'get',
-    params: query
-  })
-}
-

+ 240 - 3
src/api/qw/externalContact.js

@@ -9,6 +9,37 @@ export function listExternalContact(query) {
   })
 }
 
+// 查询企业微信客户列表
+export function getRepeat(query) {
+  return request({
+    url: '/qw/externalContact/getRepeat',
+    method: 'get',
+    params: query
+  })
+}
+
+export function myDeptExtList(query) {
+  return request({
+    url: '/qw/externalContact/myDeptExtList',
+    method: 'get',
+    params: query
+  })
+}
+export function myList(query) {
+  return request({
+    url: '/qw/externalContact/myList',
+    method: 'get',
+    params: query
+  })
+}
+/** 查询 预计发送客户的总数 */
+export function selectCountCustomer(param) {
+  return request({
+    url: '/qw/externalContact/expectQwGroupMsgCountCustomer',
+    method: 'post',
+    data:param,
+  })
+}
 // 查询企业微信客户详细
 export function getExternalContact(id) {
   return request({
@@ -26,6 +57,81 @@ export function addExternalContact(data) {
   })
 }
 
+//同步我的企微客户
+export function syncMyExternalContact(id) {
+  return request({
+    url: '/qw/externalContact/syncMyExternalContact/'+id,
+    method: 'get',
+  })
+}
+
+export function syncMyAddExternalContact(id) {
+  return request({
+    url: '/qw/externalContact/syncAddMyExternalContact/'+id,
+    method: 'get',
+  })
+}
+export function getUserInfo(id) {
+  return request({
+    url: '/qw/externalContact/getUserInfo/'+id,
+    method: 'get',
+  })
+}
+
+export function addUnassigned(data) {
+  return request({
+    url: '/qw/externalContact/addUnassigned',
+    method: 'post',
+    data: data
+  })
+}
+export function addTag(data) {
+  return request({
+    url: '/qw/externalContact/addTag',
+    method: 'post',
+    data: data
+  })
+}
+
+export function addTagByWatch(data) {
+  return request({
+    url: '/qw/externalContact/addTagByWatch',
+    method: 'post',
+    data: data
+  })
+}
+
+
+export function delTag(data) {
+  return request({
+    url: '/qw/externalContact/delTag',
+    method: 'post',
+    data: data
+  })
+}
+
+export function delTagByWatch(data) {
+  return request({
+    url: '/qw/externalContact/delTagByWatch',
+    method: 'post',
+    data: data
+  })
+}
+
+export function resignedTransfer(data) {
+  return request({
+    url: '/qw/externalContact/resignedTransfer',
+    method: 'put',
+    data: data
+  })
+}
+export function transfer(data) {
+  return request({
+    url: '/qw/externalContact/transfer',
+    method: 'put',
+    data: data
+  })
+}
 // 修改企业微信客户
 export function updateExternalContact(data) {
   return request({
@@ -35,6 +141,44 @@ export function updateExternalContact(data) {
   })
 }
 
+// 修改企业微信客户称呼
+export function updateExternalContactCall(data) {
+  return request({
+    url: '/qw/externalContact/call',
+    method: 'put',
+    data: data
+  })
+}
+// 修改企业微信客户
+export function editStatus(data) {
+  return request({
+    url: '/qw/externalContact/editStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+export function editbindCustomer(data) {
+  return request({
+    url: '/qw/externalContact/editbindCustomer',
+    method: 'put',
+    data: data
+  })
+}
+export function bindUserId(data) {
+  return request({
+    url: '/qw/externalContact/bindUserId',
+    method: 'put',
+    data: data
+  })
+}
+
+export function unBindUserId(id) {
+  return request({
+    url: '/qw/externalContact/unBindUserId/'+id,
+    method: 'get',
+  })
+}
 // 删除企业微信客户
 export function delExternalContact(id) {
   return request({
@@ -51,11 +195,104 @@ export function exportExternalContact(query) {
     params: query
   })
 }
+export function exportMyExternalContact(query) {
+  return request({
+    url: '/qw/externalContact/myExport',
+    method: 'get',
+    params: query
+  })
+}
+
+/**
+ * 获取CRM客户列表
+ */
+export function getMyCustomerList(query) {
+  return request({
+    url: '/qw/externalContact/getMyCustomerList',
+    method: 'get',
+    params: query
+  })
+}
+
+/**
+ * 获取小程序的客户
+ */
+export function getMiniProgramCustomer(query) {
+  return request({
+    url: '/qw/externalContact/getMiniCustomer',
+    method: 'get',
+    params: query
+  })
+}
 
-// 导出企业微信客户unionId
-export function exportUnionId(query) {
+/**
+ * 获取课程列表
+ */
+export function getCourseStudyList(query) {
+  return request({
+    url: '/qw/externalContact/getCourseStudyList',
+    method: 'get',
+    params: query
+  })
+}
+
+/**
+ * 设置客户-课节SOP
+ */
+export function setCustomerCourseSop(data) {
+  return request({
+    url: '/qw/externalContact/setCustomerCourseSop',
+    method: 'post',
+    data: data
+  })
+}
+
+
+/**
+ * 批量设置客户-课节SOP
+ */
+export function setCustomerCourseSopList(data) {
+  return request({
+    url: '/qw/externalContact/setCustomerCourseSopList',
+    method: 'post',
+    data: data
+  })
+}
+
+/**
+ * 查询是否已经设置过客户-某个课节的SOP
+ */
+export function getCustomerCourseSop(query) {
+  return request({
+    url: '/qw/externalContact/getCustomerCourseSop',
+    method: 'get',
+    params: query
+  })
+}
+
+
+export function batchUpdateExternalContactNotes(data) {
+  return request({
+    url: '/qw/externalContact/batchUpdateExternalContactNotes',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询企业微信客户流失删除统计列表
+export function delLossStatistics(query) {
+  return request({
+    url: '/qw/externalContact/delLossStatistics',
+    method: 'get',
+    params: query
+  })
+}
+
+
+// 导出企业微信客户
+export function delLossStatisticsExport(query) {
   return request({
-    url: '/qw/externalContact/exportUnionId',
+    url: '/qw/externalContact/delLossStatisticsExport',
     method: 'get',
     params: query
   })

+ 3 - 0
src/views/company/company/index.vue

@@ -228,6 +228,9 @@
          <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea"  :rows="2" placeholder="请输入备注" />
         </el-form-item>
+        <el-form-item label="经销商归属" prop="companyBelongOwner">
+          <el-input v-model="form.companyBelongOwner" placeholder="请输入经销售归属" />
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>

+ 7 - 7
src/views/company/companyMoneyLogs/index.vue

@@ -90,11 +90,11 @@
           @click="handleExport(1)"
           v-hasPermi="['company:companyMoneyLogs:export1']"
         >导出商城订单明细</el-button>
-		
+
         <!-- <el-button
           type="warning"
           icon="el-icon-download"
-          size="mini" 
+          size="mini"
           @click="handleExport(2)"
           v-hasPermi="['company:companyMoneyLogs:export2']"
         >导出收款订单明细</el-button> -->
@@ -106,8 +106,8 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="ID" align="center" prop="logsId" />
       <el-table-column label="企业" align="center" prop="companyName" />
-      <el-table-column label="金额" align="center" prop="money" />
-      <el-table-column label="余额" align="center" prop="balance" />
+      <el-table-column label="红包金额" align="center" prop="money" />
+      <el-table-column label="红包余额" align="center" prop="balance" />
 
       <el-table-column label="商城订单号" align="center" prop="orderCode"  v-if="queryParams.logsType==3 || queryParams.logsType==4 ||queryParams.logsType==5 || queryParams.logsType==6"  />
       <el-table-column label="支付类型" align="center" prop="payTypeCode"  v-if="queryParams.logsType==3 || queryParams.logsType==4 ||queryParams.logsType==5 || queryParams.logsType==6 " />
@@ -249,7 +249,7 @@ export default {
   },
   methods: {
     handleDetails(row){
-      
+
       const orderId = row.businessId ;
       if(row.logsType==3||row.logsType==4||row.logsType==5||row.logsType==6 ||row.logsType==13||row.logsType==14){
         this.show.open=true;
@@ -263,7 +263,7 @@ export default {
             this.$refs.Details.getDetails(orderId);
       }, 1);
       }
-      
+
     },
     /** 查询企业账户记录列表 */
     getList() {
@@ -322,7 +322,7 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-			 
+
       this.reset();
       this.open = true;
       this.title = "添加企业账户记录";

+ 1 - 1
src/views/components/his/storeOrderDetails.vue

@@ -342,7 +342,7 @@
                           :key="dict.dictValue"
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
-                          :disabled="dict.dictLabel == '待推送'"
+                          :disabled="dict.dictLabel == '待推送' || dict.dictLabel == '退款中' || dict.dictLabel == '退款成功'"
                         />
                       </el-select>
                    </el-form-item>

+ 299 - 0
src/views/course/courseWatchLog/qw/statisticsCompany.vue

@@ -0,0 +1,299 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="公司名" prop="companyId">
+        <el-select filterable style="width: 220px" v-model="queryParams.companyId" placeholder="请选择公司名" clearable size="small">
+          <el-option
+            v-for="item in companys"
+            :key="item.companyId"
+            :label="item.companyName"
+            :value="item.companyId"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="课程" prop="courseId">
+        <el-select filterable  v-model="queryParams.courseId" placeholder="请选择课程"  clearable size="small" @change="courseChange(queryParams.courseId)">
+          <el-option
+            v-for="dict in courseLists"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="小节" prop="videoId">
+        <el-select filterable  v-model="queryParams.videoId" placeholder="请选择小节"  clearable size="small">
+          <el-option
+            v-for="dict in videoList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table border v-loading="loading" :data="courseWatchLogList" show-summary>
+      <el-table-column label="公司名称" align="center" prop="companyName" />
+      <el-table-column label="发课时间" align="center" prop="createTime"/>
+      <el-table-column label="待看课" align="center" prop="type3" />
+      <el-table-column label="看课中" align="center" prop="type1" />
+      <el-table-column label="已完课" align="center" prop="type2" />
+      <el-table-column label="看课中断" align="center" prop="type4" />
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {
+  listCourseWatchLog,
+  getCourseWatchLog,
+  delCourseWatchLog,
+  addCourseWatchLog,
+  updateCourseWatchLog,
+  exportCourseWatchLog,
+  statisticsList,
+  statisticsListByCompany
+} from '@/api/course/qw/courseWatchLog'
+import { courseList,videoList } from '@/api/course/courseRedPacketLog'
+import {getCompanyList} from "@/api/company/company";
+export default {
+  name: "CourseWatchLog",
+  data() {
+    return {
+      companys:[],
+      activeName:"00",
+      createTime:null,
+      courseLists:[],
+      videoList:[],
+      logTypeOptions:[],
+      // 遮罩层
+      loading: false,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 短链课程看课记录表格数据
+      courseWatchLogList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        nickName: null,
+        videoId: null,
+        logType: null,
+        qwExternalContactId: null,
+        duration: null,
+        qwUserId: null,
+        companyUserId: null,
+        companyId: null,
+        courseId: null,
+        sTime:null,
+        eTime:null,
+        scheduleStartTime: null,
+        scheduleEndTime: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      scheduleTime: null,
+    };
+  },
+  created() {
+    getCompanyList().then(response => {
+      this.companys = response.data;
+      if(this.companys!=null&&this.companys.length>0){
+        this.companyId=this.companys[0].companyId;
+        this.getTreeselect();
+      }
+    });
+    courseList().then(response => {
+      this.courseLists = response.list;
+    });
+    this.getList();
+    this.getDicts("sys_course_watch_log_type").then(response => {
+      this.logTypeOptions = response.data;
+    });
+  },
+  methods: {
+    courseChange(row){
+      this.queryParams.videoId=null;
+      if(row === ''){
+        this.videoList=[];
+        return
+      }
+      videoList(row).then(response => {
+        this.videoList=response.list
+      });
+    },
+    change() {
+      if (this.createTime != null) {
+        this.queryParams.sTime = this.createTime[0];
+        this.queryParams.eTime = this.createTime[1];
+      } else {
+        this.queryParams.sTime = null;
+        this.queryParams.eTime = null;
+      }
+    },
+    handleClickX(tab,event){
+      this.activeName=tab.name;
+      if(tab.name=="00"){
+        this.queryParams.logType=null;
+      }else{
+        this.queryParams.logType=tab.name;
+      }
+      this.getList()
+    },
+    /** 查询短链课程看课记录列表 */
+    getList() {
+      this.loading = true;
+      statisticsListByCompany(this.queryParams).then(response => {
+        this.courseWatchLogList = response.rows;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        logId: null,
+        userId: null,
+        videoId: null,
+        logType: null,
+        createTime: null,
+        updateTime: null,
+        qwExternalContactId: null,
+        duration: null,
+        qwUserId: null,
+        companyUserId: null,
+        companyId: null,
+        courseId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.createTime = null;
+      this.scheduleTime = null;
+      this.queryParams.sTime = null;
+      this.queryParams.eTime = null;
+      this.queryParams.scheduleStartTime = null;
+      this.queryParams.scheduleEndTime = null;
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.logId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加短链课程看课记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const logId = row.logId || this.ids
+      getCourseWatchLog(logId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改短链课程看课记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.logId != null) {
+            updateCourseWatchLog(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCourseWatchLog(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const logIds = row.logId || this.ids;
+      this.$confirm('是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delCourseWatchLog(logIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportCourseWatchLog(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+    handleScheduleTimeChange(val) {
+      if (val) {
+        this.queryParams.scheduleStartTime = val[0];
+        this.queryParams.scheduleEndTime = val[1];
+      } else {
+        this.queryParams.scheduleStartTime = null;
+        this.queryParams.scheduleEndTime = null;
+      }
+    },
+  }
+};
+</script>

+ 65 - 20
src/views/course/courseWatchLog/statistics.vue

@@ -75,7 +75,14 @@
       </el-form-item>
     </el-form>
 
-    <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange"  show-summary>
+    <el-table
+      border
+      v-loading="loading"
+      :data="courseWatchLogList"
+      @selection-change="handleSelectionChange"
+      show-summary
+      :summary-method="getSummaries"
+    >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="用户" align="center" prop="userName" />
       <el-table-column label="对应销售" align="center" prop="companyUserName" />
@@ -185,6 +192,44 @@ export default {
 
   },
   methods: {
+    /** 自定义合计方法 */
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+
+        // 排除不需要合计的列(小节名称和其他文本列)
+        const excludeColumns = ['userName', 'companyUserName', 'createTime', 'projectName', 'courseName', 'videoName'];
+        const prop = column.property;
+
+        if (excludeColumns.includes(prop)) {
+          sums[index] = '--';
+          return;
+        }
+
+        // 对数值列进行合计
+        const values = data.map(item => Number(item[prop]));
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+        } else {
+          sums[index] = '--';
+        }
+      });
+
+      return sums;
+    },
+
     handleSeller(){
       console.log(this.queryParams.companyId)
       if(this.queryParams.companyId != null) {
@@ -351,30 +396,30 @@ export default {
     handleDelete(row) {
       const logIds = row.logId || this.ids;
       this.$confirm('是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delCourseWatchLog(logIds);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delCourseWatchLog(logIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportCourseWatchLog(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportCourseWatchLog(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
     },
     handleScheduleTimeChange(val) {
       if (val) {

+ 13 - 1
src/views/course/userWatchCourseStatistics/index.vue

@@ -57,6 +57,16 @@
         />
       </el-form-item>
 
+      <el-form-item label="经销商" prop="companyBelongOwner">
+        <el-input
+          v-model="queryParams.companyBelongOwner"
+          placeholder="请输入经销商归属"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -80,6 +90,7 @@
 
     <el-table border v-loading="loading" :data="userWatchCourseStatisticsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="经销商归属" align="center" prop="companyBelongOwner" />
       <el-table-column label="营期名称" align="center" prop="periodName" />
       <el-table-column label="营期线" align="center" prop="periodStartingTime" />
       <el-table-column label="播出时间" align="center" prop="courseStartDateTime" />
@@ -248,7 +259,8 @@ export default {
         answerRightNum: null,
         answerRightRate: null,
         redPacketNum: null,
-        redPacketAmount: null
+        redPacketAmount: null,
+        companyBelongOwner: null
       },
       // 表单参数
       form: {},

+ 14 - 1
src/views/course/userWatchCourseTotalStatistics/index.vue

@@ -56,6 +56,16 @@
         />
       </el-form-item>
 
+      <el-form-item label="经销商" prop="companyBelongOwner">
+        <el-input
+          v-model="queryParams.companyBelongOwner"
+          placeholder="请输入经销商归属"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
 <!--      <el-form-item label="所属销售" prop="companyUserName">-->
 <!--        <el-input-->
 <!--          v-model="queryParams.companyUserName"-->
@@ -88,6 +98,7 @@
 
     <el-table border v-loading="loading" :data="userWatchCourseStatisticsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="经销商归属" align="center" prop="companyBelongOwner" />
       <el-table-column label="营期名称" align="center" prop="periodName" />
       <el-table-column label="营期线" align="center" prop="periodStartingTime" />
       <el-table-column label="播出时间" align="center" prop="courseStartDateTime" />
@@ -103,6 +114,7 @@
       <el-table-column label="完播率" align="center" prop="completeWatchRatePercent" />
       <el-table-column label="红包领取个数" align="center" prop="redPacketNum" />
       <el-table-column label="红包领取总额" align="center" prop="redPacketAmount" />
+
     </el-table>
 
     <pagination
@@ -253,7 +265,8 @@ export default {
         answerRightNum: null,
         answerRightRate: null,
         redPacketNum: null,
-        redPacketAmount: null
+        redPacketAmount: null,
+        companyBelongOwner: null
       },
       // 表单参数
       form: {},

+ 14 - 1
src/views/course/userWatchStatistics/index.vue

@@ -30,6 +30,16 @@
         />
       </el-form-item>
 
+      <el-form-item label="经销商" prop="companyBelongOwner">
+        <el-input
+          v-model="queryParams.companyBelongOwner"
+          placeholder="请输入经销商归属"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
 
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -54,6 +64,7 @@
 
     <el-table border v-loading="loading" :data="userWatchStatisticsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="经销商归属" align="center" prop="companyBelongOwner" />
       <el-table-column label="营期名称" align="center" prop="periodName" />
       <el-table-column label="营期线" align="center" prop="periodStartingTime" width="180">
         <template slot-scope="scope">
@@ -68,6 +79,7 @@
       <el-table-column label="完播人数" align="center" prop="completeWatchNum" />
       <el-table-column label="完播率" align="center" prop="completeWatchRatePercent" />
 
+
     </el-table>
 
     <pagination
@@ -158,7 +170,8 @@ export default {
         userNum: null,
         watchNum: null,
         completeWatchNum: null,
-        completeWatchRate: null
+        completeWatchRate: null,
+        companyBelongOwner: null
       },
       // 表单参数
       form: {},

+ 2055 - 0
src/views/crm/externalContact/index.vue

@@ -0,0 +1,2055 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="企微公司" prop="corpId">
+            <el-select v-model="queryParams.corpId" placeholder="企微公司"  size="small" @change="updateCorpId()">
+              <el-option
+                v-for="dict in myQwCompanyList"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              />
+            </el-select>
+      </el-form-item>
+      <el-form-item label="客户名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入客户名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="活码id" prop="wayId">
+        <el-input
+          v-model="queryParams.wayId"
+          placeholder="请输入活码id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="销售企微昵称" prop="qwUserName">
+        <el-input
+          v-model="queryParams.qwUserName"
+          placeholder="请输入销售企微昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+          @input="searchQwUser"
+          @focus="showQwUserDropdown = true"
+          @blur="hideDropdownWithDelay"
+          @clear="onQwUserNameClear"
+        />
+        <!-- 下拉建议 -->
+        <div v-if="showQwUserDropdown && qwUserSuggestions.length > 0" class="suggestion-box"  @scroll="handleScroll">
+          <div
+            v-for="item in qwUserSuggestions"
+            :key="item.dictValue"
+            class="suggestion-item"
+            @click="selectQwUser(item.dictValue,item.dictLabel)"
+          >
+            {{ item.dictLabel }}
+          </div>
+        </div>
+      </el-form-item>
+      <el-form-item label="用户类别" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择用户类别" clearable size="small">
+          <el-option
+            v-for="dict in typeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="所属销售" prop="companyUser">
+        <el-input
+          v-model="queryParams.companyUser"
+          placeholder="请输入昵称或者手机号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="性别" prop="gender">
+        <el-select v-model="queryParams.gender" placeholder="状态" clearable size="small">
+          <el-option
+            v-for="dict in genderOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="客户等级" prop="level">
+        <el-select v-model="queryParams.level" placeholder="客户等级" clearable size="small">
+          <el-option
+            v-for="dict in ratingType"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="等级升降" prop="levelType">
+        <el-select v-model="queryParams.levelType" placeholder="等级升降" clearable size="small">
+          <el-option
+            v-for="dict in ratingUpFall"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
+
+      <el-form-item label="电话号码" prop="remarkMobiles">
+        <el-input
+          v-model="queryParams.remarkMobiles"
+          placeholder="请输入备注电话号码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="来源" prop="addWay">
+
+        <el-select v-model="queryParams.addWay" placeholder="来源" clearable size="small">
+          <el-option
+            v-for="dict in addWayOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+
+        <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="转接状态" prop="addWay">
+
+        <el-select v-model="queryParams.transferStatus" placeholder="转接状态" clearable size="small">
+          <el-option
+            v-for="dict in transferStatusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="是否绑定会员" prop="isBindMini">
+        <el-select v-model="queryParams.isBindMini" placeholder="是否绑定会员" clearable size="small" @change="handleQuery" >
+          <el-option
+            v-for="dict in isBindMiniOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="标签" prop="tagIds">
+<!--        <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable  style="width: 100%;">-->
+<!--          <el-option-->
+<!--            v-for="dict in tagList"-->
+<!--            :label="dict.name"-->
+<!--            :value="dict.tagId">-->
+<!--          </el-option>-->
+<!--        </el-select>-->
+
+        <div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
+          <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
+            <el-tag type="success"
+                    closable
+                    :disable-transitions="false"
+                    v-for="list in this.selectTags"
+                    :key="list.tagId"
+                    @close="handleCloseTags(list)"
+                    style="margin: 3px;"
+            >{{list.name}}
+            </el-tag>
+          </div>
+        </div>
+
+
+      </el-form-item>
+      <el-form-item label="备注" prop="remark">
+        <el-input
+          v-model="queryParams.remark"
+          placeholder="请输入备注"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+       <el-form-item label="添加时间" prop="createTime">
+          <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
+      </el-form-item>
+
+
+
+
+      <el-form-item label="流失时间" prop="lossTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.lossTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择流失时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="删除时间" prop="delTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.delTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择删除时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+<!--      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['qw:externalContact:add']"
+        >同步</el-button>
+      </el-col> -->
+<!--      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateNotes"
+          v-hasPermi="['qw:externalContact:edit']"
+        >批量修改备注
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateNotesFilter"
+          v-hasPermi="['qw:externalContact:edit']"
+        >批量修改备注(筛选条件)
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['qw:externalContact:edit']"
+        >修改备注</el-button>
+      </el-col>-->
+
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['qw:externalContact:export']"
+        >导出</el-button>
+      </el-col>
+<!--      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="addUserTag"
+          v-hasPermi="['qw:externalContact:addTag']"
+        >批量添加标签</el-button>
+      </el-col>-->
+<!--      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="delUserTag"
+          v-hasPermi="['qw:externalContact:delTag']"
+        >批量移除标签</el-button>
+      </el-col>
+	  <el-col :span="1.5">
+	    <el-button
+	      type="primary"
+	      plain
+	      size="mini"
+	      @click="updateTalk"
+        v-hasPermi="['qw:externalContactInfo:updateTalk']"
+	    >批量更改交流状态</el-button>
+	  </el-col>-->
+<!--       <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          size="mini"-->
+<!--          @click="setUserCourseSop"-->
+<!--          v-hasPermi="['qw:externalContact:setCourseSop']"-->
+<!--        >批量设置课程SOP</el-button>-->
+<!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+<!--    <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">-->
+<!--      <el-tab-pane label="全部" name="all"></el-tab-pane>-->
+<!--      <el-tab-pane label="已绑定CRM" name="isBind"></el-tab-pane>-->
+<!--      <el-tab-pane label="未绑定CRM" name="noBind"></el-tab-pane>-->
+<!--    </el-tabs>-->
+
+    <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="企微客户ID" align="center" prop="id" />
+      <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
+        <template slot-scope="scope">
+          <el-popover
+            placement="right"
+            title=""
+            trigger="hover">
+            <img slot="reference" :src="scope.row.avatar" width="60px">
+            <img :src="scope.row.avatar" style="max-width: 200px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="企微客户名称"  prop="name" width="110px"/>
+      <el-table-column label="客户称呼"  prop="stageStatus" width="110px"/>
+      <el-table-column label="销售企微昵称" align="center" prop="qwUserName" width="120px"/>
+      <el-table-column label="企微部门" align="center" prop="departmentName" width="120px"/>
+      <el-table-column label="用户类别" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag :options="typeOptions" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="性别" align="center" prop="gender">
+        <template slot-scope="scope">
+          <dict-tag :options="genderOptions" :value="scope.row.gender"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="描述信息" align="center" prop="description" />
+      <el-table-column label="标签" align="center" prop="tagIdsName" width="300px">
+<!--        <template slot-scope="scope">-->
+<!--          <div v-for="name in scope.row.tagIdsName"  style="display: inline;">-->
+<!--          <el-tag type="success">{{ name }}</el-tag>-->
+<!--          </div>-->
+<!--        </template>-->
+        <template slot-scope="scope">
+          <div class="tag-container">
+            <div class="tag-list">
+              <el-tag
+                v-for="name in scope.row.tagIdsName"
+                :key="name"
+                type="success"
+                size="small"
+              >
+                {{ name }}
+              </el-tag>
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否回复" align="center" prop="isReply" width="120px" >
+        <template slot-scope="scope">
+          <span v-if="scope.row.isReply === 1"><el-tag type="success">已回复</el-tag></span>
+          <span v-else-if="scope.row.isReply === 0"><el-tag type="info">未回复</el-tag></span>
+          <span v-else>{{ scope.row.isReply }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="status" width="120px" >
+        <template slot-scope="scope">
+          <dict-tag :options="statusOptions" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="客户等级" align="center" prop="level" width="120px" >
+        <template slot-scope="scope">
+          <dict-tag :options="ratingType" :value="scope.row.level"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="state参数" align="center" prop="state" width="100px" />
+
+      <el-table-column label="等级状态" align="center" prop="levelType" width="120px" >
+        <template slot-scope="scope">
+          <dict-tag :options="ratingUpFall" :value="scope.row.levelType"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="添加时间" align="center" prop="createTime" width="100px" />
+      <el-table-column label="流失时间" align="center" prop="lossTime" width="100px" />
+      <el-table-column label="删除时间" align="center" prop="delTime" width="100px" />
+      <el-table-column label="注册时间" align="center" prop="registerTime" width="100px" />
+      <el-table-column label="备注电话号码" align="center" prop="remarkMobiles" width="150px">
+        <template slot-scope="scope">
+          <div v-for="i in JSON.parse(scope.row.remarkMobiles)" :key="i">{{i}}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注企业名称" align="center" prop="remarkCorpName" />
+      <el-table-column label="来源" align="center" prop="addWay" width="100px">
+        <template slot-scope="scope">
+          <dict-tag :options="addWayOptions" :value="scope.row.addWay"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="转接状态" align="center" prop="transferStatus" width="100px" >
+        <template slot-scope="scope">
+          <dict-tag :options="transferStatusOptions" :value="scope.row.transferStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="企业id" align="center" prop="corpId" />
+      <el-table-column label="是否绑定会员" width="100px" align="center" fixed="right">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.fsUserId" >已绑定</el-tag>
+          <el-tag v-else type="info"> 未绑定</el-tag>
+        </template>
+      </el-table-column>
+<!--      <el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            v-if="scope.row.status==0||scope.row.status==2"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['qw:externalContact:edit']"
+          >修改备注</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-user-solid"
+            @click="handleAppellation(scope.row)"
+          >修改客户称呼</el-button>
+        </template>
+      </el-table-column>-->
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
+        <template slot-scope="scope">
+&lt;!&ndash;          <el-button&ndash;&gt;
+&lt;!&ndash;            size="mini"&ndash;&gt;
+&lt;!&ndash;            type="text"&ndash;&gt;
+&lt;!&ndash;            icon="el-icon-edit-outline"&ndash;&gt;
+&lt;!&ndash;            @click="handleUpdateCustomer(scope.row)"&ndash;&gt;
+&lt;!&ndash;            >&ndash;&gt;
+&lt;!&ndash;            <span v-if="scope.row.customerId">换绑CRM</span>&ndash;&gt;
+&lt;!&ndash;            <span v-else>绑定CRM</span>&ndash;&gt;
+&lt;!&ndash;          </el-button>&ndash;&gt;
+
+&lt;!&ndash;          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit-outline"
+            @click="handleUpdateUser(scope.row)"
+            >
+            <span v-if="scope.row.fsUserId">换绑会员</span>
+            <span v-else>绑定会员</span>
+          </el-button>
+
+          <el-button
+            v-if="scope.row.fsUserId"
+            size="mini"
+            type="text"
+            icon="el-icon-thumb"
+            @click="handleUnBindUserId(scope.row)"
+            v-hasPermi="['qw:externalContact:unBindUserId']"
+          >
+            <span>解除会员绑定</span>
+          </el-button>&ndash;&gt;
+
+
+&lt;!&ndash;          <el-button v-if="scope.row.customerId"&ndash;&gt;
+&lt;!&ndash;            size="mini"&ndash;&gt;
+&lt;!&ndash;            type="text"&ndash;&gt;
+&lt;!&ndash;            icon="el-icon-paperclip"&ndash;&gt;
+&lt;!&ndash;            @click="handleShow(scope.row)"&ndash;&gt;
+&lt;!&ndash;          >CRM客户详情</el-button>&ndash;&gt;
+          <el-button
+             size="mini"
+             type="text"
+             @click="handledetails(scope.row)"
+             >AI获取用户信息
+          </el-button>
+          <el-button
+             size="mini"
+             type="text"
+             @click="handleMemberdetails(scope.row)"
+             v-if="scope.row.fsUserId"
+             >
+             <span>会员详细</span>
+          </el-button>
+        </template>
+      </el-table-column>-->
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
+      <customer-details  ref="customerDetails" @refreshList="refreshList"/>
+    </el-drawer>
+
+    <el-drawer
+        :with-header="false"
+        size="75%"
+          :title="show.title" :visible.sync="show.open">
+      <userDetails  ref="userDetails" />
+    </el-drawer>
+
+
+    <!--  搜索标签   -->
+    <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" style="width:100%;height: 100%" append-to-body>
+
+      <div>搜索标签:
+        <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
+        <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
+      </div>
+      <div v-for="item in tagGroupList" :key="item.id"  >
+        <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
+          <span class="name-background">{{ item.name }}</span>
+        </div>
+        <!-- 添加外层滚动容器 -->
+        <div class="scroll-wrapper">
+          <div class="tag-container">
+            <a
+              v-for="tagItem in item.tag"
+              class="tag-box"
+              @click="tagSelection(tagItem)"
+              :class="{ 'tag-selected': tagItem.isSelected }"
+            >
+              {{ tagItem.name }}
+            </a>
+          </div>
+        </div>
+      </div>
+
+      <pagination
+        v-show="tagTotal>0"
+        :total="tagTotal"
+        :page.sync="queryTagParams.pageNum"
+        :limit.sync="queryTagParams.pageSize"
+        @pagination="getPageListTagGroup"
+      />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>
+        <el-button @click="tagCancel()">取消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
+      <div>搜索标签:
+        <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
+        <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
+      </div>
+      <el-form ref="form" :model="addTagForm"  label-width="80px">
+        <div v-for="item in tagGroupList" :key="item.id" >
+          <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
+            <span class="name-background">{{ item.name }}</span>
+          </div>
+          <!-- 添加外层滚动容器 -->
+          <div class="scroll-wrapper">
+            <div class="tag-container">
+              <a
+                v-for="tagItem in item.tag"
+                class="tag-box"
+                @click="tagSelection(tagItem)"
+                :class="{ 'tag-selected': tagItem.isSelected }"
+              >
+                {{ tagItem.name }}
+              </a>
+            </div>
+          </div>
+        </div>
+      </el-form>
+      <pagination
+        v-show="tagTotal>0"
+        :total="tagTotal"
+        :page.sync="queryTagParams.pageNum"
+        :limit.sync="queryTagParams.pageSize"
+        @pagination="getPageListTagGroup"
+      />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
+        <el-button @click="addTagCancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
+      <el-card>
+        <el-row>
+          <el-col>
+            <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">
+              <el-radio :label="1">
+                客户名称添加在【新备注】【前】
+              </el-radio>
+              <el-radio :label="2">
+                客户名称添加在【新备注】【后】
+              </el-radio>
+              <el-radio :label="3">
+                不添加客户名称
+              </el-radio>
+            </el-radio-group>
+          </el-col>
+          <el-col>
+            <el-radio-group v-model="notesOpen.type">
+              <el-radio
+                :label="1"
+              >添加【新备注】在最【前】面
+              </el-radio>
+              <el-radio
+                :label="2"
+              >添加【新备注】在最【后】面
+              </el-radio>
+              <el-radio
+                :label="3"
+              >替换所有备注
+              </el-radio>
+            </el-radio-group>
+          </el-col>
+          <el-col>
+            <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"
+                      maxlength="20" show-word-limit style="width: 500px;margin-top: 3%"/>
+            <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
+              <i class="el-icon-info"></i>
+              由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字
+            </div>
+          </el-col>
+        </el-row>
+      </el-card>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>
+        <el-button @click="notesCancel()">取消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
+      <div>搜索标签:
+        <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
+        <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
+      </div>
+      <el-form ref="form" :model="addTagForm"  label-width="80px">
+        <div v-for="item in tagGroupList" :key="item.id" >
+          <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
+            <span class="name-background">{{ item.name }}</span>
+          </div>
+          <!-- 添加外层滚动容器 -->
+          <div class="scroll-wrapper">
+            <div class="tag-container">
+              <a
+                v-for="tagItem in item.tag"
+                class="tag-box"
+                @click="tagSelection(tagItem)"
+                :class="{ 'tag-selected': tagItem.isSelected }"
+              >
+                {{ tagItem.name }}
+              </a>
+            </div>
+          </div>
+        </div>
+      </el-form>
+      <pagination
+        v-show="tagTotal>0"
+        :total="tagTotal"
+        :page.sync="queryTagParams.pageNum"
+        :limit.sync="queryTagParams.pageSize"
+        @pagination="getPageListTagGroup"
+      />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
+        <el-button @click="DelTagCancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 添加或修改企业微信客户对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+
+
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
+        </el-form-item>
+        <el-form-item label="描述信息" prop="description">
+          <el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述信息" />
+        </el-form-item>
+
+        <el-form-item label="备注电话号码" prop="remarkMobiles">
+
+          <el-tag
+            :key="tag"
+            v-for="tag in remarkMobiles"
+            closable
+            :disable-transitions="false"
+            @close="handleClose(tag)">
+            {{tag}}
+          </el-tag>
+          <el-input
+            style="width:110px"
+            class="input-new-tag"
+            v-if="inputVisible"
+            v-model="inputValue"
+            ref="saveTagInput"
+            size="small"
+            @keyup.enter.native="handleInputConfirm"
+            @blur="handleInputConfirm"
+          >
+          </el-input>
+          <el-button v-else class="button-new-tag" size="small" style="width: 110px" @click="showInput">新增电话</el-button>
+
+        </el-form-item>
+
+
+        <el-form-item label="备注企业名称" prop="remarkCorpName">
+          <el-input v-model="form.remarkCorpName" placeholder="请输入备注企业名称" />
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="callOpen.title" :visible.sync="callOpen.open" width="500px" append-to-body>
+      <el-form ref="callOpenFrom" :model="callOpenFrom" :rules="callOpenRule" label-width="110px">
+        <el-form-item label="客户称呼" prop="stageStatus">
+          <el-input v-model="callOpenFrom.stageStatus" placeholder="请输入客户称呼" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer" >
+        <el-button type="primary" @click="submitCallOpenFrom">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 绑定客户   -->
+    <el-dialog :title="bindCustomer.title" :visible.sync="bindCustomer.open"  width="1200px" append-to-body>
+      <mycustomer ref="mycustomer"  @bindCustomerId="bindCustomerId"></mycustomer>
+    </el-dialog>
+
+<!--    设置一个课程sop-->
+    <el-dialog :title="setSop.title" :visible.sync="setSop.open"  width="1200px" append-to-body>
+      <SopDialog ref="SopDialog"  @bindCourseSop="bindCourseSop"></SopDialog>
+    </el-dialog>
+
+    <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
+      <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
+    </el-dialog>
+
+	<el-dialog :title="info.title" :visible.sync="info.open"   width="1100px" append-to-body>
+	  <info  ref="Details" />
+	</el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  bindUserId,
+  addTag,
+  delTag,
+  batchUpdateExternalContactNotes,
+  listExternalContact,
+  getExternalContact,
+  delExternalContact,
+  addExternalContact,
+  updateExternalContact,
+  exportExternalContact,
+  editbindCustomer,
+  setCustomerCourseSop,
+  getCustomerCourseSop,
+  setCustomerCourseSopList,
+  unBindUserId, updateExternalContactCall
+} from '@/api/qw/externalContact'
+/*import {getMyQwUserList, getMyQwCompanyList, updateUser,getQwUserListLikeName} from "@/api/qw/user";*/
+import {getMyQwUserList, getMyQwCompanyList, updateUser} from "@/api/qw/user";
+import {listTag, getTag, searchTags,} from "@/api/qw/tag";
+import { allListTagGroup} from "@/api/qw/tagGroup";
+/*import mycustomer from '@/views/qw/externalContact/mycustomer'
+import customerDetails from '@/views/qw/externalContact/customerDetails'
+import SopDialog from '@/views/course/sop/SopDialog.vue'
+import  selectUser  from "@/views/qw/externalContact/selectUser.vue";
+import info from "@/views/qw/externalContact/info.vue";
+import { editTalk } from "@/api/qw/externalContactInfo";*/
+import PaginationMore from "../../../components/PaginationMore/index.vue";
+/*import userDetails from '@/views/store/components/userDetails.vue';*/
+export default {
+  name: "ExternalContact",
+  /*components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,userDetails},*/
+  components:{PaginationMore},
+  data() {
+    return {
+      notesOpen: {
+        type: 1,
+        nameType: 3,
+        addType: 0,
+        filter: false,
+        open: false,
+        notes: null,
+      },
+      user:{
+        open:false,
+        title:"修改客户"
+      },
+      userForm:{
+        id:null,
+        fsUserId:null,
+      },
+      info:{
+        title:"用户信息",
+        open:false,
+      },
+      // ...其他已有数据
+      qwUserSuggestions: [],       // 已展示的数据
+      showQwUserDropdown: false,   // 控制下拉框显示
+      qwUserLoading: false,        // 加载状态
+      qwUserNoMore: false,         // 是否还有更多数据
+      qwUserPageNum: 1,            // 当前页码
+      qwUserPageSize: 10,          // 每页数量
+      qwUserTotal: 0,               // 总数
+      isBindMiniOptions:[
+        {dictLabel:"已绑定",dictValue:'isBindMini'},
+        {dictLabel:"未绑定",dictValue:'noBindMini'},
+      ],
+      //标签弹窗选择
+      tagChange:{
+        open:false,
+        index:null,
+      },
+	  sTime:null,
+	  eTime:null,
+	  createTime:null,
+      // 遮罩层
+      loading: false,
+      // 导出遮罩层
+      exportLoading: false,
+      tagOpen:false,
+      tagDelOpen:false,
+      // 选中数组
+      ids: [],
+      isBindActiveName:"all",
+      remarkMobiles: [],
+      inputVisible: false,
+      inputValue: '',
+      // 非单个禁用
+      single: true,
+      tagGroupList: [],
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 企业微信客户表格数据
+      externalContactList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 用户类别字典
+      typeOptions: [],
+      ratingType: [],
+      ratingUpFall: [],
+      // 性别字典
+      genderOptions: [],
+
+      addTagForm:{
+        userIds:[],
+        tagIds:[]
+      },
+
+      myQwCompanyList:[],
+      show:{
+        title:"客户详情",
+        open:false,
+      },
+
+      //存储选择的客户
+      chooseCustomerSOP:null,
+
+      setSop:{
+        title:"选择课节SOP",
+        open:false,
+        //区分单选1还是多选2
+        type:null,
+      },
+      //合成的客户-课节SOP参数
+      customerCourseForm:{},
+
+      //查询是否已经设置过客户-某个课节的SOP
+      customerCourseFormLogs:{},
+      //绑定客户
+      bindCustomer:{
+        title:null,
+        open:false,
+      },
+      callOpen:{
+        open:false,
+        title: '修改客户称呼',
+      },
+      callOpenFrom:{
+        id:null,
+        stageStatus:null,
+      },
+      callOpenRule:{
+        stageStatus:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]
+      },
+      //绑定的参数表
+      qwFormCustomer:{
+        externalContactId:null,
+        customerId:null,
+      },
+      // 来源字典
+      addWayOptions: [],
+
+      //标签
+      changeTagDialog:{
+        title:"",
+        open:false,
+      },
+
+      queryTagParams:{
+        pageNum: 1,
+        pageSize: 5,
+        total:0,
+        name:null,
+        corpId:null,
+      },
+
+      tagTotal:0,
+
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        qwUserName:null,
+        externalUserId: null,
+        name: null,
+        avatar: null,
+        type: null,
+        qwUserId:null,
+        gender: null,
+        description: null,
+        tagIds: null,
+        remark:null,
+        remarkMobiles: null,
+        remarkCorpName: null,
+        addWay: null,
+        operUserid: null,
+        corpId: null,
+        companyId: null,
+        status:null,
+        transferStatus:null,
+        isBind:null,
+        isBindMini:null,
+        lossTime:null,
+        sTime:null,
+        eTime:null,
+        createTime:null,
+        level:null,
+        wayId:null,
+        levelType:null,
+        companyUser:null
+      },
+      selectTags:[],
+      // 表单参数
+      form: {},
+      tagList:[],
+      transferStatusOptions:[],
+      statusOptions:[],
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+
+    this.getDicts("sys_qw_externalContact_type").then(response => {
+      this.typeOptions = response.data;
+    });
+
+    this.getDicts("sys_qw_sop_rating_type").then(response => {
+      this.ratingType = response.data;
+    });
+
+    this.getDicts("sys_qw_sop_rating_upFall").then(response => {
+      this.ratingUpFall = response.data;
+    });
+
+
+    getMyQwCompanyList().then(response => {
+            this.myQwCompanyList = response.data;
+            if(this.myQwCompanyList!=null){
+              // this.queryParams.corpId=this.myQwCompanyList[0].dictValue
+              //
+              // var listTagFrom={corpId:this.queryParams.corpId}
+              // listTag(listTagFrom).then(response => {
+              //   this.tagList = response.rows;
+              // });
+              this.getList();
+
+            }
+    });
+
+
+    this.getDicts("sys_sex").then(response => {
+      this.genderOptions = response.data;
+    });
+    this.getDicts("sys_qw_externalContact_addWay").then(response => {
+      this.addWayOptions = response.data;
+    });
+
+
+
+    this.getDicts("sys_qw_external_contact_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("sys_qw_transfer_status").then(response => {
+      this.transferStatusOptions = response.data;
+    });
+
+  },
+  methods: {
+    handleMemberdetails(row){
+            this.show.open=true;
+            setTimeout(() => {
+                 this.$refs.userDetails.getDetails(row.fsUserId);
+            }, 1);
+    },
+    onQwUserNameClear() {
+      this.queryParams.qwUserId = null;  // 同时清空 qwUserId
+    },
+    // 搜索企微用户
+    searchQwUser(query) {
+      if (!query.trim()) {
+        this.qwUserSuggestions = [];
+        this.showQwUserDropdown = false;
+        this.qwUserNoMore = false;
+        this.qwUserPageNum = 1;
+        return;
+      }
+
+      this.queryParams.qwUserName = query;
+      this.qwUserPageNum = 1;
+      this.qwUserNoMore = false;
+      this.qwUserSuggestions = [];
+      this.fetchQwUsers(query);
+    },
+
+    fetchQwUsers(query) {
+      const params = {
+        qwUserName: query,
+        pageNum: this.qwUserPageNum,
+        pageSize: this.qwUserPageSize
+      };
+
+      this.qwUserLoading = true;
+
+      getQwUserListLikeName(params).then(res => {
+        const list = res.data.list || [];
+        const total = res.data.total || 0;
+
+        this.qwUserSuggestions = [...this.qwUserSuggestions, ...list];
+        this.qwUserTotal = total;
+
+        // 判断是否还有更多数据
+        if (this.qwUserSuggestions.length >= total) {
+          this.qwUserNoMore = true;
+        }
+
+        this.showQwUserDropdown = true;
+      }).finally(() => {
+        this.qwUserLoading = false;
+      });
+    },
+
+    // 选择企微用户
+    selectQwUser(key,value) {
+      this.queryParams.qwUserName = value;
+      this.queryParams.qwUserId = key;
+      this.showQwUserDropdown = false;
+      this.handleQuery(); // 可选:自动触发查询
+    },
+
+    // 延迟隐藏下拉框,防止点击失效
+    hideDropdownWithDelay() {
+      setTimeout(() => {
+        this.showQwUserDropdown = false;
+      }, 200);
+    },
+    handleScroll(e) {
+      const container = e.target;
+      const scrollTop = container.scrollTop;
+      const scrollHeight = container.scrollHeight;
+      const clientHeight = container.clientHeight;
+
+      // 距离底部小于 20px 触发加载
+      if (scrollHeight - scrollTop - clientHeight < 20 && !this.qwUserLoading && !this.qwUserNoMore) {
+        this.qwUserPageNum += 1;
+        this.fetchQwUsers(this.queryParams.qwUserName);
+      }
+    },
+
+
+	  change(){
+			if(this.createTime!=null){
+			  this.queryParams.sTime=this.createTime[0];
+			  this.queryParams.eTime=this.createTime[1];
+			}else{
+			  this.queryParams.sTime=null;
+			  this.queryParams.eTime=null;
+			}
+
+		  },
+    updateCorpId(){
+      var listTagFrom={corpId:this.queryParams.corpId}
+        listTag(listTagFrom).then(response => {
+          this.tagList = response.rows;
+        });
+        this.getList();
+     },
+    /** 查询企业微信客户列表 */
+    getList() {
+      this.loading = true;
+      const { qwUserName, ...queryParams } = this.queryParams;
+      listExternalContact(queryParams).then(response => {
+        this.externalContactList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    bindMiniCustomerId(row){
+      console.log(row)
+      this.userForm.fsUserId=row;
+      bindUserId(this.userForm).then(res=>{
+         if (res.code==200){
+           this.$message.success('绑定成功')
+         }else {
+           this.$message.error('绑定失败:',res.msg)
+         }
+         this.getList()
+         this.user.open=false;
+      })
+    },
+    /** 查看客户详情 */
+    handleShow(row){
+      this.show.open=true;
+      var that=this;
+      const tab = "visit";
+      setTimeout(() => {
+        that.$refs.customerDetails.getDetails(row.customerId);
+        that.$refs.customerDetails.handleClick(tab);
+
+      }, 200);
+    },
+
+	handledetails(row){
+		this.info.open=true;
+		setTimeout(() => {
+			 this.$refs.Details.getDetails(row.id);
+		}, 1);
+	},
+
+	closeInfo(){
+		this.info.open=false
+	},
+    handleClickX(tab, event) {
+
+      this.queryParams.isBind=tab.name;
+      this.handleQuery();
+    },
+
+    handleClose(tag) {
+      this.remarkMobiles.splice(this.remarkMobiles.indexOf(tag), 1);
+    },
+    showInput() {
+      this.inputVisible = true;
+      this.$nextTick(_ => {
+        this.$refs.saveTagInput.$refs.input.focus();
+      });
+    },
+    handleInputConfirm() {
+      let inputValue = this.inputValue;
+      if (inputValue) {
+        this.remarkMobiles.push(inputValue);
+      }
+      this.inputVisible = false;
+      this.inputValue = '';
+    },
+
+    addUserTag(){
+
+      if(this.ids==null||this.ids==""){
+        return  this.$message('请选择需要添加标签的客户');
+      }
+
+      this.getPageListTagGroup();
+
+      setTimeout(() => {
+
+        for (let i = 0; i < this.tagGroupList.length; i++) {
+          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+            this.tagGroupList[i].tag[x].isSelected=false;
+          }
+        }
+      }, 200);
+
+
+      this.tagOpen = true;
+
+    },
+
+
+    getPageListTagGroup(){
+      this.queryTagParams.corpId=this.queryParams.corpId
+      allListTagGroup(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+        this.tagTotal = response.total;
+      });
+    },
+
+    delUserTag(){
+
+      if(this.ids==null||this.ids==""){
+        return  this.$message('请选择需要移除标签的客户');
+      }
+      this.getPageListTagGroup();
+
+      setTimeout(() => {
+        for (let i = 0; i < this.tagGroupList.length; i++) {
+          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+            this.tagGroupList[i].tag[x].isSelected=false;
+          }
+        }
+      }, 200);
+
+      this.tagDelOpen = true;
+
+    },
+
+
+    //搜索的标签
+    hangleChangeTags(){
+
+      this.changeTagDialog.title="搜索的标签"
+      this.changeTagDialog.open=true;
+
+      // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
+      const selectedTagIds = new Set(
+        (this.selectTags || []).map(tagItem => tagItem?.tagId)
+      );
+
+      this.queryTagParams.name=null;
+
+      this.getPageListTagGroup();
+
+      setTimeout(() => {
+        for (let i = 0; i < this.tagGroupList.length; i++) {
+          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+            this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
+          }
+        }
+      }, 200);
+
+
+    },
+
+    //删除一些选择的标签
+    handleCloseTags(list){
+      const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
+      if (ls !== -1) {
+        this.selectTags.splice(ls, 1);
+        this.selectTags = [...this.selectTags];
+      }
+
+      if (this.selectTags!=null && this.selectTags.length>0){
+        // 确保 this.form.tags 是数组
+        if (!this.queryParams.tagIds) {
+          this.queryParams.tagIds = []; // 如果未定义,初始化
+        } else {
+          this.queryParams.tagIds = []; // 清空已有数据
+        }
+
+        // 遍历并添加 tagId
+        this.selectTags.forEach(tag => {
+          if (tag.tagId) { // 确保 tagId 存在
+            this.queryParams.tagIds.push(tag.tagId);
+          }
+        });
+        this.queryParams.tagIds=this.queryParams.tagIds.join(",");
+      }else {
+        this.queryParams.tagIds=null;
+      }
+
+    },
+
+    //重新获取页面数据
+    refreshList(){
+      this.getList();
+    },
+
+    //批量设置课程sop
+    setUserCourseSop(){
+
+      if(this.ids==null||this.ids==""){
+        return  this.$message('请选择需要设置课程SOP的客户');
+      }
+
+      this.$confirm('批量设置客户课节SOP可能会存在重复,确定要批量设置吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+          this.setSop.open = true;
+          this.setSop.type = 2;
+        })
+        .catch(() => {
+          // 可以处理用户点击“取消”的逻辑
+        });
+
+    },
+    tagSelection(row){
+
+      row.isSelected= !row.isSelected;
+      this.$forceUpdate();
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    addTagCancel() {
+
+      this.tagOpen = false;
+
+      this.addTagForm={
+        userIds:[],
+        tagIds:[]
+      };
+    },
+
+    DelTagCancel() {
+      this.tagDelOpen = false;
+
+      this.addTagForm={
+        userIds:[],
+        tagIds:[]
+      };
+    },
+    addTagSubmitForm(){
+
+      for (let i = 0; i < this.tagGroupList.length; i++) {
+        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+          if(this.tagGroupList[i].tag[x].isSelected==true){
+            this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
+          }
+
+        }
+      }
+      if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
+        return  this.$message('请选择标签');
+      }
+
+      this.addTagForm.corpId=this.queryParams.corpId
+      this.addTagForm.userIds=this.ids;
+
+
+      let loadingRock = this.$loading({
+        lock: true,
+        text: '正在执行中请稍后~~请不要刷新页面!!',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+
+
+      addTag(this.addTagForm).then(response => {
+       this.msgSuccess(response.msg);
+       this.tagOpen = false;
+        loadingRock.close();
+       this.addTagForm={
+         userIds:[],
+         tagIds:[]
+       };
+       this.getList()
+     }).finally(res=>{
+        loadingRock.close();
+      });
+
+    },
+    tagDelSubmitForm(){
+      for (let i = 0; i < this.tagGroupList.length; i++) {
+        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+          if(this.tagGroupList[i].tag[x].isSelected==true){
+            this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
+          }
+
+        }
+      }
+      if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
+        return  this.$message('请选择标签');
+      }
+       this.addTagForm.corpId=this.queryParams.corpId
+      this.addTagForm.userIds=this.ids;
+
+      let loadingRock = this.$loading({
+        lock: true,
+        text: '正在执行中请稍后~~请不要刷新页面!!',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+
+
+      delTag(this.addTagForm).then(response => {
+       this.msgSuccess(response.msg);
+       this.tagDelOpen = false;
+        loadingRock.close();
+       this.addTagForm={
+         userIds:[],
+         tagIds:[]
+       };
+       this.getList()
+     }).finally(res=>{
+        loadingRock.close();
+      });
+    },
+
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        userId: null,
+        externalUserId: null,
+        name: null,
+        companyUserId:null,
+        customerId:null,
+        avatar: null,
+        type: null,
+        gender: null,
+        remark: null,
+        description: null,
+        tagIds: null,
+        remarkMobiles: null,
+        remarkCorpName: null,
+        addWay: null,
+        operUserid: null,
+        corpId: null,
+        companyId: null,
+        transferStatus:null,
+        status:null,
+        sTime:null,
+        eTime:null,
+        createTime:null,
+        transferTime:null,
+        transferNum:null,
+        lossTime:null,
+        delTime:null,
+        state:null,
+        wayId:null,
+        stageStatus:null,
+        customerName:null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+
+      if (this.selectTags!=null && this.selectTags.length>0){
+        // 确保 this.form.tags 是数组
+        if (!this.queryParams.tagIds) {
+          this.queryParams.tagIds = []; // 如果未定义,初始化
+        } else {
+          this.queryParams.tagIds = []; // 清空已有数据
+        }
+
+        // 遍历并添加 tagId
+        this.selectTags.forEach(tag => {
+          if (tag.tagId) { // 确保 tagId 存在
+            this.queryParams.tagIds.push(tag.tagId);
+          }
+        });
+        this.queryParams.tagIds=this.queryParams.tagIds.join(",");
+      }else {
+        this.queryParams.tagIds=null;
+      }
+
+
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    handleSearchTags(name){
+
+      if (!name){
+        return this.$message.error("请输入要搜索的标签")
+      }
+
+      this.queryTagParams.name=name;
+      this.queryTagParams.corpId=this.queryParams.corpId;
+
+      searchTags(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+      });
+
+    },
+
+    cancelSearchTags(){
+      this.resetSearchQueryTag()
+
+      this.getPageListTagGroup();
+    },
+    //确定选择标签
+    tagSubmitForm(){
+
+      for (let i = 0; i < this.tagGroupList.length; i++) {
+        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+          if (this.tagGroupList[i].tag[x].isSelected === true) {
+
+            if (!this.selectTags) {
+              this.selectTags = [];
+            }
+
+            // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
+            let tagExists = this.selectTags.some(
+              tag => tag.id === this.tagGroupList[i].tag[x].id
+            );
+
+            // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
+            if (!tagExists) {
+              this.selectTags.push(this.tagGroupList[i].tag[x]);
+            }
+          }
+        }
+      }
+      if (!this.selectTags || this.selectTags.length === 0) {
+        return this.$message('请选择标签');
+      }
+
+      this.changeTagDialog.open = false;
+    },
+
+    //取消选择标签
+    tagCancel(){
+      this.changeTagDialog.open = false;
+    },
+
+
+    resetSearchQueryTag(){
+
+      this.queryTagParams= {
+        pageNum: 1,
+        pageSize: 10,
+        total:0,
+        name:null,
+      };
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
+      this.selectTags=[];
+	   this.createTime=null;
+	  this.queryParams.sTime=null;
+	  this.queryParams.eTime=null;
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.loading=true;
+      this.form.corpId=this.queryParams.corpId
+     addExternalContact(this.form).then(response => {
+       this.msgSuccess("同步成功");
+       this.getList();
+     }).finally(()=>{
+       this.loading=false;
+     });
+
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getExternalContact(id).then(response => {
+        this.form = response.data;
+        if(this.form.remarkMobiles!=null){
+          this.remarkMobiles=JSON.parse(this.form.remarkMobiles)
+        }else{
+          this.remarkMobiles=[]
+        }
+
+        this.open = true;
+        this.title = "修改企业微信客户";
+      });
+    },
+
+    handleAppellation(val){
+      this.callOpen.open=true;
+      this.callOpenFrom.stageStatus=val.stageStatus;
+      this.callOpenFrom.id=val.id;
+    },
+
+    /** 绑定客户操作 */
+    handleUpdateCustomer(row){
+       this.bindCustomer.title="绑定客户"
+        this.bindCustomer.open=true;
+        this.form.id=row.id
+        this.form.externalUserId=row.externalUserId
+        this.form.name=row.name
+    },
+
+    handleUpdateUser(row){
+        this.user.title="绑定客户"
+        this.user.open=true;
+        this.userForm.id=row.id;
+    },
+
+    handleUnBindUserId(val){
+
+      this.$confirm(
+        '确认解绑客户:<span style="color: green;">' + val.name + '' +
+        '</span> 的小程序用户?<br><span style="color: red;">【ps:可能会导致客户无法看课】</span>',
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return unBindUserId(val.id);
+      }).then(response => {
+        this.getList();
+        this.msgSuccess("解绑成功");
+      }).finally(res=>{
+        this.getList();
+      })
+    },
+
+    bindCustomerId(row){
+
+      console.log("row",row)
+      // this.qwFormCustomer.customerId=row;
+      this.form.customerId=row;
+      this.form.corpId=this.queryParams.corpId;
+      this.msgWarning("绑定中.....同步信息中.....");
+
+      editbindCustomer(this.form).then(res=>{
+        //清空表单
+        this.reset();
+        this.bindCustomer.open = false;
+        this.msgSuccess("绑定成功");
+        this.getList();
+
+      })
+
+    },
+    //设置一个SOP
+    setCourseSOP(row) {
+
+      // 检查 row.miniUserId 是否为 null
+      if (row.miniUserId === null || row.miniUserId === undefined) {
+        return this.$confirm('当前客户【CRM客户详情】中 未绑定小程序客户,请先绑定', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).catch(error => {
+          this.msgWarning("操作取消:", error);
+        });
+      } else {
+        this.chooseCustomerSOP = row;
+        this.setSop.open = true;
+        this.setSop.type=1;
+      }
+    },
+
+    //选择课程SOP
+    // 用于设置 customerCourseForm 和 customerCourseFormLogs 的共同属性
+    setCommonProperties(form, row) {
+      form.qwUserid = this.chooseCustomerSOP.userId;
+      form.companyUserId = this.chooseCustomerSOP.companyUserId;
+      form.externalUserId = this.chooseCustomerSOP.externalUserId;
+      form.customerId = this.chooseCustomerSOP.customerId;
+      form.miniUserId = this.chooseCustomerSOP.miniUserId;
+      form.businessId = row.businessId;
+    },
+
+    bindCourseSop(row,days) {
+
+      if (this.setSop.type==2){
+        this.setSop.open = false;
+        this.loading=true;
+        this.msgWarning("设定中.....同步信息中.....");
+
+        setCustomerCourseSopList({ids:this.ids,fsCourseSopId:row.id,days:days}).then(res=>{
+
+          let msg=" 批量设置成功数【" + res.successNum + "】,<br>"
+
+          if (res.failCRM.length>0){
+            msg+="失败的客户【" + res.failCRM + "】,原因是未绑定CRM客户。<br>"
+          }
+          if (res.failMiNi.length>0){
+            msg+="失败的客户【" + res.failMiNi + "】,原因是CRM中未绑定小程序客户。<br>"
+          }
+          if (res.failCompany.length>0){
+            msg+="失败的客户【" + res.failCompany + "】,原因是客户没有所属成员。<br>"
+          }
+
+
+          return this.$confirm(msg, "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+            dangerouslyUseHTMLString: true // 允许使用HTML标签
+          }).catch(error => {
+            this.msgSuccess("操作完成~");
+          });
+
+        }).finally(()=>{
+          this.loading = false;
+          this.getList();
+        })
+      }else if (this.setSop.type==1){
+
+      // 设置 customerCourseFormLogs 的属性
+      this.setCommonProperties(this.customerCourseFormLogs, row);
+
+      // 设置 customerCourseForm 的属性
+      this.setCommonProperties(this.customerCourseForm, row);
+      this.customerCourseForm.sopId = row.id;
+      this.customerCourseForm.sopType = row.sopType;
+      this.customerCourseForm.setting = row.setting;
+      this.customerCourseForm.days = days;
+
+      // 执行异步操作
+      getCustomerCourseSop(this.customerCourseFormLogs)
+        .then(res => {
+          if (res) {
+            return this.$confirm('当前客户已设置过相同课程课节SOP,确定还要再次设置吗?', "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            });
+          } else {
+            return Promise.resolve(); // 如果没有设置过,直接执行后续操作
+          }
+        })
+        .then(() => {
+          this.loading = true;
+          this.setSop.open = false;
+          this.msgSuccess("设定中.....同步信息中.....");
+
+          return setCustomerCourseSop(this.customerCourseForm);
+        })
+        .then(() => {
+          this.msgSuccess("设定成功");
+        })
+        .catch(error => {
+          this.msgWarning("操作取消:", error);
+        })
+        .finally(() => {
+          this.loading = false;
+          this.getList();
+        });
+      }
+    },
+    submitCallOpenFrom(){
+
+      this.$refs["callOpenFrom"].validate(valid => {
+        if (valid) {
+
+          if (this.callOpenFrom.id != null && this.callOpenFrom.stageStatus != null) {
+            updateExternalContactCall(this.callOpenFrom).then(res=>{
+              this.$message.success('修改成功');
+              this.callOpen.open=false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            this.form.remarkMobiles=JSON.stringify(this.remarkMobiles)
+            updateExternalContact(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addExternalContact(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除企业微信客户编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delExternalContact(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+
+	updateTalk(row){
+		const ids = row.id || this.ids;
+		this.$confirm('是否确认批量更改用户信息为非首次交流', "警告", {
+		    confirmButtonText: "确定",
+		    cancelButtonText: "取消",
+		    type: "warning"
+		  }).then(function() {
+		    return editTalk(ids);
+		  }).then(() => {
+		    this.getList();
+		    this.msgSuccess("成功");
+		  }).catch(() => {});
+	},
+    /** 导出按钮操作 */
+    handleExport() {
+      const { qwUserName, ...queryParams } = this.queryParams;
+      this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportExternalContact(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+    handleBatchUpdateNotesFilter() {
+      this.notesOpen.open = true;
+      this.notesOpen.filter = true;
+    },
+    handleBatchUpdateNotes() {
+
+      if (this.ids == null || this.ids == "") {
+        return this.$message('请选择需要添加备注的客户');
+      }
+
+      this.notesOpen.open = true;
+      this.notesOpen.filter = false;
+
+    },
+    notesSubmitForm() {
+
+      if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
+        return this.$message.error("请输入备注内容");
+      }
+
+      // let loadingRock = this.$loading({
+      //   lock: true,
+      //   text: '正在执行中请稍后~~请不要刷新页面!!',
+      //   spinner: 'el-icon-loading',
+      //   background: 'rgba(0, 0, 0, 0.7)'
+      // });
+
+      let obj = JSON.parse(JSON.stringify(this.queryParams))
+      console.log(obj);
+      if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
+        obj.tagIds = obj.tagIds.split(",");
+      }
+      batchUpdateExternalContactNotes({
+        addType: 0,
+        userIds: this.ids,
+        notes: this.notesOpen.notes,
+        type: this.notesOpen.type,
+        nameType: this.notesOpen.nameType,
+        filter: this.notesOpen.filter,
+        param: obj
+      }).then(res => {
+
+        this.resultMessage = res.msg;
+        this.$message.success("正在执行中...");
+        // this.resultDialogVisible = true; // 显示弹窗
+        // this.resultTitle = '批量修改备注结果';
+
+      }).finally(res => {
+        this.getList();
+        // loadingRock.close();
+        this.notesCancel();
+      })
+
+    },
+  }
+};
+
+</script>
+<style scoped>
+/* CSS 样式 */
+.tag-container {
+  display: flex;
+  flex-wrap: wrap; /* 超出宽度时自动换行 */
+  gap: 8px; /* 设置标签之间的间距 */
+}
+.name-background {
+  display: inline-block;
+  background-color: #abece6; /* 背景颜色 */
+  padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
+  border-radius: 4px; /* 可选:设置圆角 */
+}
+/* CSS 样式 */
+.tag-container {
+  display: flex;
+  flex-wrap: wrap; /* 超出宽度时自动换行 */
+  gap: 8px; /* 设置标签之间的间距 */
+}
+.name-background {
+  display: inline-block;
+  background-color: #abece6; /* 背景颜色 */
+  padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
+  border-radius: 4px; /* 可选:设置圆角 */
+}
+.tag-box {
+  padding: 8px 12px;
+  border: 1px solid #989797;
+  border-radius: 4px;
+  cursor: pointer;
+  display: inline-block;
+}
+
+.tag-selected {
+  background-color: #00bc98;
+  color: #fff;
+  border-color: #00bc98;
+}
+
+.el-tag + .el-tag {
+  margin-left: 10px;
+}
+
+
+
+.button-new-tag {
+      margin-left: 10px;
+      height: 32px;
+      line-height: 30px;
+      padding-top: 0;
+      padding-bottom: 0;
+    }
+    .input-new-tag {
+      width: 90px;
+      margin-left: 10px;
+      vertical-align: bottom;
+    }
+
+
+.suggestion-box {
+  position: absolute;
+  z-index: 999;
+  background: #fff;
+  border: 1px solid #ddd;
+  max-height: 200px;
+  overflow-y: auto;
+  width: 100%;
+}
+
+.suggestion-item {
+  padding: 10px;
+  cursor: pointer;
+}
+.suggestion-item:hover {
+  background-color: #f5f7fa;
+}
+/* 新增的滚动容器样式(不影响原有样式) */
+.scroll-wrapper {
+  max-height: 130px; /* 大约三行的高度 */
+  overflow-y: auto;  /* 垂直滚动 */
+  padding-right: 5px; /* 为滚动条留出空间 */
+}
+
+/* 美化滚动条(可选) */
+.scroll-wrapper::-webkit-scrollbar {
+  width: 6px;
+}
+.scroll-wrapper::-webkit-scrollbar-thumb {
+  background: rgba(0, 0, 0, 0.2);
+  border-radius: 3px;
+}
+
+.tag-container {
+  max-height: 200px;
+  overflow-y: auto;
+  padding: 1px;
+  border: 1px solid #ebeef5;
+  border-radius: 1px;
+  background-color: #fafafa;
+}
+.tag-list {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 8px;
+}
+.scroll-hint {
+  text-align: center;
+  color: #909399;
+  font-size: 12px;
+  padding: 1px 0;
+}
+.container {
+  max-width: 800px;
+  margin: 0 auto;
+  padding: 10px;
+}
+.title {
+  text-align: center;
+  color: #303133;
+  margin-bottom: 30px;
+}
+.demo-table {
+  width: 100%;
+  margin-bottom: 30px;
+}
+.instructions {
+  background-color: #f5f7fa;
+  padding: 15px;
+  border-radius: 1px;
+  margin-bottom: 20px;
+}
+</style>

+ 259 - 0
src/views/fastGpt/fastGptPushTokenTotal/index.vue

@@ -0,0 +1,259 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="公司名称" prop="companyId" >
+        <el-select v-model="queryParams.companyId" placeholder="请选择所属公司" filterable size="small">
+          <el-option v-for="(option, index) in companyList" :key="index" :value="option.dictValue" :label="option.dictLabel"></el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="创建时间" prop="createTime">
+        <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"  @change="changeTime"></el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="fastGptPushTokenTotalList" :row-class-name="() => 'fixed-bottom-row'"
+              @selection-change="handleSelectionChange" :max-height="600">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="公司名称" align="center" prop="companyName" />
+      <el-table-column label="token消耗" align="center" prop="count" />
+      <el-table-column label="时间" align="center" prop="statTime" />
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listFastgptEventLogTotal, exportFastgptEventLogTotal, getFastGptRoleAppKeyList} from "@/api/fastGpt/fastgptEventLogTotal";
+import { getFastGptPushTokenTotal} from "@/api/fastGpt/fastgptPushTokenTotal";
+import SelectTree from "@/components/TreeSelect/index.vue";
+import {getDeptData} from "@/api/system/employeeStats";
+import TreeSelect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import {allList} from "@/api/company/company";
+
+
+
+export default {
+  name: "FastgptEventLogTotal",
+  components: {SelectTree,TreeSelect},
+  data() {
+    return {
+      createTime:null,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      selectedCompanyList: [],
+      companyList:[],
+      deptList: [],
+      companyUserList: [],
+      selectedAppKey: null,
+      selectedAppKeyLabel: '',
+      appKeyOptions: [],
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // token统计表格数据
+      fastGptPushTokenTotalList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      typeCountMap: null,
+      // 日志类型字典
+      typeOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        roleId: null,
+        count: null,
+        type: null,
+        companyId: null,
+        companyUserId: null,
+        qwUserId: null,
+        typeCountMap: null,
+        beginTime:null,
+        endTime:null,
+        appKey:null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getAllCompany();
+
+  },
+
+  methods: {
+    getAllCompany() {
+      allList().then(response => {
+        this.companyList = response.rows;
+        this.companyList.push({dictLabel: "无",
+          dictValue: "0"})
+      });
+    },
+    /** 查询ai事件埋点统计列表 */
+    getList() {
+      this.loading = true;
+
+      getFastGptPushTokenTotal(this.queryParams).then(response => {
+        console.log(response)
+        this.fastGptPushTokenTotalList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    normalizer(node) {
+      return {
+        id: node.id,
+        label: node.label,
+        children: node.children,
+        disabled: node.disabled
+      }
+    },
+    handleAppKeyChange(value) {
+      const node = this.findNodeById(this.appKeyOptions, value);
+      if (!node) {
+        this.selectedAppKeyLabel = '';
+        return;
+      }
+
+      // 如果是子节点,则找父节点 label
+      if (node.parentLabel) {
+        this.queryParams.appKey = node.parentLabel;
+        this.selectedAppKeyLabel = node.parentLabel;
+        this.selectedAppKey = this.selectedAppKeyLabel;
+      } else {
+        this.queryParams.appKey = node.label;
+        this.selectedAppKeyLabel = node.label;
+        this.selectedAppKey = this.selectedAppKeyLabel;
+      }
+    },
+    findNodeById(nodes, id) {
+      for (const node of nodes) {
+        if (node.id === id) return node;
+        if (node.children) {
+          const found = this.findNodeById(node.children, id);
+          if (found) return found;
+        }
+      }
+      return null;
+    },
+    changeTime(){
+      console.log(this.createTime);
+      if(this.createTime!=null){
+        this.queryParams.beginTime=this.createTime[0];
+        this.queryParams.endTime=this.createTime[1];
+      }else{
+        this.queryParams.beginTime=null;
+        this.queryParams.endTime=null;
+      }
+      console.log(this.queryParams.beginTime);
+      console.log(this.queryParams.endTime);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        roleId: null,
+        count: null,
+        type: null,
+        companyId: null,
+        companyUserId: null,
+        qwUserId: null,
+        statTime: null
+      };
+      this.resetForm("form");
+    },
+    getPercentageColor(percentage) {
+      // HSL模式从黄色(60度)渐变到红色(0度)
+      const percent = Math.min(100, Math.max(0, parseFloat(percentage)));
+
+      // 调整色相范围:从深黄色(40°)渐变到红色(0°)
+      const hue = 40 - 40 * (percent / 100); // 初始 hue=40(深黄),终点 hue=0(红)
+
+      // 提高饱和度(100%),亮度保持 50%(鲜艳但不刺眼)
+      return `hsl(${hue}, 100%, 50%)`;
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      console.log(this.selectedAppKey)
+      if(this.selectedAppKey === null || typeof this.selectedAppKey === 'undefined'){
+        this.queryParams.appKey = null;
+      }
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.selectedAppKey = null;
+      this.selectedAppKeyLabel = '';
+      this.selectedCompanyList = [];
+      this.queryParams.appKey = null;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+
+      if(this.selectedCompanyList != null && this.selectedCompanyList.length > 0) {
+        this.queryParams.userIds = this.selectedCompanyList;
+      }else {
+        this.queryParams.userIds = [];
+      }
+      this.$confirm('是否确认导出所有ai事件埋点统计数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportFastgptEventLogTotal(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 20 - 4
src/views/fastGpt/fastgptEventLogTotal/index.vue

@@ -64,7 +64,7 @@
       <el-table-column label="角色名称" align="center" prop="roleName" />
       <el-table-column label="时间" align="center" prop="statTime" />
       <el-table-column
-        v-for="dict in typeOptions"
+        v-for="dict in sortedTypeOptions"
         :key="dict.dictValue"
         :label="dict.dictLabel"
         align="center">
@@ -72,9 +72,9 @@
           <span>{{ scope.row.typeCountMap ? scope.row.typeCountMap[dict.dictValue] : '' }}</span>
           <span v-if="dict.dictValue !== '11'"
                 :style="{ fontSize: '12px', marginLeft: '5px',
-                color: getPercentageColor((scope.row.typeCountMap[dict.dictValue] / scope.row.typeCountMap[2]) * 100) }">
-            ({{ ((scope.row.typeCountMap[dict.dictValue] / scope.row.typeCountMap[2]) * 100).toFixed(2) }}%)
-          </span>
+          color: getPercentageColor((scope.row.typeCountMap[dict.dictValue] / scope.row.typeCountMap[2]) * 100) }">
+      ({{ ((scope.row.typeCountMap[dict.dictValue] / scope.row.typeCountMap[2]) * 100).toFixed(2) }}%)
+    </span>
         </template>
       </el-table-column>
     </el-table>
@@ -179,6 +179,22 @@ export default {
     });
 
   },
+  // 在 data() 中添加一个新的计算属性或方法来处理排序后的 typeOptions
+  computed: {
+    sortedTypeOptions() {
+      if (!this.typeOptions || this.typeOptions.length === 0) return [];
+
+      // 将 dictValue 为 '11' 的选项过滤出来并放到最后
+      const normalOptions = this.typeOptions.filter(option => option.dictValue !== '11');
+      const lastOption = this.typeOptions.find(option => option.dictValue === '11');
+
+      if (lastOption) {
+        return [...normalOptions, lastOption];
+      }
+      return normalOptions;
+    }
+  },
+
   methods: {
     /** 查询ai事件埋点统计列表 */
     getList() {

+ 8 - 8
src/views/his/answer/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+    <!-- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
-    </el-form>
+    </el-form> -->
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
@@ -94,7 +94,7 @@
             <div v-for="(option, optionIndex) in answer.options" :key="optionIndex" class="option-item">
               <div class="option-input">
                 <el-input 
-                  v-model="answer.options[optionIndex]" 
+                  v-model="answer.options[optionIndex].name" 
                   :placeholder="`选项 ${optionIndex + 1}`">
                 </el-input>
               </div>
@@ -195,7 +195,7 @@ export default {
             answers: [
               {
                 title: '',
-                options: ['']
+                options: [{name:'',value:0}]
               }
             ]
           },
@@ -216,7 +216,7 @@ export default {
     addItem(length) {
           this.form.answers.push({
             title: '',
-            options: ['']
+            options: [{name:'',value:0}]
           })
         },
         delItem(item, index) {
@@ -242,7 +242,7 @@ export default {
           }
         },
         addOption(answerIndex, optionIndex) {
-          this.form.answers[answerIndex].options.push('')
+          this.form.answers[answerIndex].options.push({name:'',value:optionIndex + 1})
         },
         delOption(options, index) {
           if (options.length > 1) {
@@ -330,7 +330,7 @@ export default {
         this.form = {
           answers: [{
             title: '',
-            options: ['']
+            options: [{name:'',value:0}]
           }
 
           ]
@@ -347,7 +347,7 @@ export default {
           this.form = {
             answers: [{
               title: '',
-              options: []
+              options: [{name:'',value:0}]
             }
 
             ]

+ 170 - 3
src/views/his/company/index.vue

@@ -134,7 +134,7 @@
       <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
       <el-table-column label="更新时间" align="center" prop="updateTime" width="180"/>
       <!--      <el-table-column label="主机重启时间" align="center" prop="restartTime" width="180" />-->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200px">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="220px">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -176,7 +176,13 @@
             v-hasPermi="['his:company:deduct']"
           >扣款
           </el-button>
-
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleRevenue(scope.row)"
+            v-hasPermi="['company:company:revenue']"
+          >分账配置</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -473,6 +479,99 @@
         <el-button @click="deduct.open=false">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog :title="revenue.title" :visible.sync="revenue.open" width="800px" append-to-body>
+      <el-form ref="revenueForm"  :model="revenueForm" label-width="150px">
+        <el-form-item label="公司">
+          <el-input v-model="revenueForm.companyName" disabled/>
+        </el-form-item>
+       
+        <el-form-item label="开启分账">
+          <el-switch
+            v-model="revenueForm.divFlag"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            active-value="1"
+            inactive-value="0"
+          >
+          </el-switch>
+        </el-form-item>
+        
+        <el-form-item label="分账模式" v-if="revenueForm.divFlag == 1">
+          <el-radio v-model="revenueForm.delayAcctFlag" label="N">实时分账</el-radio>
+          <el-radio v-model="revenueForm.delayAcctFlag" label="Y">延时分账</el-radio>
+        </el-form-item>
+        <el-form-item label="是否使用百分比分账">
+          <el-switch
+            v-model="revenueForm.percentageFlag"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            active-value="Y"
+            inactive-value="N"
+          >
+          </el-switch>
+        </el-form-item>
+        <el-form-item label="是否净值分账" v-if="revenueForm.percentageFlag == 'Y'">
+          <el-switch
+            v-model="revenueForm.iscCleanSplit"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            active-value="Y"
+            inactive-value="N"
+          >
+          </el-switch>
+        </el-form-item>
+        <div v-if="revenueForm.divFlag == 1">
+            <el-form-item label="分账接收方配置">
+              <el-tooltip content="批量设置erp账户" placement="top">
+                <el-button type="primary" icon="el-icon-plus" @click="addAcctInfo" style="margin-bottom: 5px;">
+                  添加新接收方
+                </el-button>
+              </el-tooltip>
+              
+            </el-form-item>
+
+            <div v-for="(account, index) in revenueForm.acctInfos" :key="index"
+                 style="border: 1px solid #dcdfe6; padding: 20px; margin-bottom: 20px; border-radius: 4px;"
+            >
+              <div style="display: flex; justify-content: between; align-items: center; margin-bottom: 15px;">
+                <div style="margin: 0; color: #409eff;">账户 {{ index + 1 }}</div>
+                <el-button
+                  type="danger"
+                  icon="el-icon-delete"
+                  size="mini"
+                  @click="removeAcctInfo(index)"
+                  v-if="revenueForm.acctInfos.length > 0"
+                >
+                  删除账户
+                </el-button>
+              </div>
+
+              <el-form-item label="分账接收方ID" :prop="`acctInfos.${index}.huifuId`">
+                <el-input v-model="account.huifuId"   placeholder="斗拱开户时生成;示例值:6666000123120001"></el-input>
+              </el-form-item>
+              <el-form-item label="账户号" :prop="`acctInfos.${index}.acctId`" >
+                <el-input v-model="account.acctId"  placeholder="可指定账户号,仅支持基本户、现金户,不填默认为基本户;示例值:F00598600"></el-input>
+              </el-form-item>
+              
+              <el-form-item label="分账百分比%" v-if="revenueForm.percentageFlag == 'Y'" :prop="`acctInfos.${index}.percentageDiv`"  >
+                <el-input-number v-model="account.percentageDiv" :precision="2" :step="0.1" :min="0" :max="100" placeholder="示例值:23.50,表示23.50%。acct_infos中全部分账百分比之和必须为100.00%。"></el-input-number>
+              </el-form-item>
+              <el-form-item label="分账金额" v-if="revenueForm.percentageFlag == 'N'" :prop="`acctInfos.${index}.divAmt`"  >
+                <el-input-number v-model="account.divAmt" :precision="2" :step="1" :min="0.01" placeholder="单位元,需保留小数点后两位,示例值:1.00 ,最低传入0.01"></el-input-number>
+              </el-form-item>
+              
+            </div>
+          </div>
+
+       
+       
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRevenueForm">确 定</el-button>
+        <el-button @click="revenue.open=false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -486,7 +585,9 @@ import {
   recharge,
   deduct,
   exportCompany,
-  resetPwd
+  resetPwd,
+  getDivConfig,
+  setDiv
 } from '@/api/his/company'
 import { getFollowDoctorList } from '@/api/his/doctor'
 import { docList } from '@/api/his/doctor'
@@ -501,6 +602,14 @@ export default {
   name: 'Company',
   data() {
     return {
+      //分账参数
+      revenue:{
+          open: false,
+          title: '分账配置'
+      },
+      revenueForm:{
+        acctInfos: [] 
+      },
       // 表单参数
       deductForm: {
         money: 0
@@ -670,6 +779,50 @@ export default {
     })
   },
   methods: {
+    // 添加分账账户
+    addAcctInfo() {
+      console.log("-----------------",this.revenueForm)
+      this.revenueForm.acctInfos.push({
+        huifuId: '',
+        acctId: '',
+        percentageDiv: null,
+        divAmt: null
+      })
+    },
+    // 删除接收方账户
+    removeAcctInfo(index) {
+      this.$confirm('确认删除该接收方账户?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.revenueForm.acctInfos.splice(index, 1)
+        this.$message.success('删除成功')
+      }).catch(() => {
+      })
+    },
+    handleRevenue(row){
+      const companyId = row.companyId
+      //查询配置
+      this.revenueForm.isAdd = 1
+      getDivConfig(companyId).then(response => {
+        if(response.data){
+          this.revenueForm = response.data
+          if(response.data.acctInfos == null){
+            this.revenueForm.acctInfos = []
+          }
+          if(response.data.divFlag){
+            this.revenueForm.divFlag = String(response.data.divFlag)
+          }
+        }
+      })
+      this.revenueForm.companyId = companyId
+      this.revenueForm.companyName = row.companyName
+      if(row.divFlag){
+        this.revenueForm.divFlag == "0"
+      }
+      this.revenue.open = true
+    },
     handleRecharge(row) {
       const companyId = row.companyId
       this.rechargeForm.companyId = row.companyId
@@ -700,6 +853,20 @@ export default {
         }
       })
     },
+    submitRevenueForm(){
+      var param = this.revenueForm;
+      console.log("--------------",param)
+      if(param.companyId && param.divFlag){
+        setDiv(param).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess(response.msg)
+              this.revenue.open = false
+              this.getList()
+            }
+          })
+        console.log("--------------",param)
+      }
+    },
     /** 提交按钮 */
     submitDeductForm() {
       this.$refs['deductForm'].validate(valid => {

+ 442 - 0
src/views/his/dfAccount/index.vue

@@ -0,0 +1,442 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="AppKey" prop="dfAppKey">
+        <el-input
+          v-model="queryParams.dfAppKey"
+          placeholder="请输入dfAppKey"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="Appsecret" prop="dfAppsecret">
+        <el-input
+          v-model="queryParams.dfAppsecret"
+          placeholder="请输入dfAppsecret"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="登录账号" prop="loginAccount">
+        <el-input
+          v-model="queryParams.loginAccount"
+          placeholder="请输入登录账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+    
+      <el-form-item label="月结账号" prop="monthlyCard">
+        <el-input
+          v-model="queryParams.monthlyCard"
+          placeholder="请输入月结账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="物流产品" prop="expressProductCode">
+        <el-select v-model="queryParams.expressProductCode" placeholder="请选择物流产品编码" clearable size="small">
+          <el-option
+            v-for="dict in expressOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="寄件人" prop="senderName">
+        <el-input
+          v-model="queryParams.senderName"
+          placeholder="请输入寄件人姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      
+      
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['his:dfAccount:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['his:dfAccount:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['his:dfAccount:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['his:dfAccount:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="accountList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="key" align="center" prop="dfAppKey" />
+      <el-table-column label="secret" align="center" prop="dfAppsecret" />
+      <el-table-column label="登录账号" align="center" prop="loginAccount" />
+      <el-table-column label="回调地址" align="center" prop="callBackUrl" />
+      <el-table-column label="月结账号" align="center" prop="monthlyCard" />
+      <el-table-column label="物流产品" align="center" >
+        <template slot-scope="scope">
+          <dict-tag :options="expressOptions" :value="scope.row.expressProductCode"/>
+        </template>
+        </el-table-column>  
+      <el-table-column label="寄件人姓名" align="center" prop="senderName" />
+      <el-table-column label="寄件人手机" align="center" prop="senderPhone" />
+      <el-table-column label="寄件人省" align="center" prop="senderProvince" />
+      <el-table-column label="寄件人市" align="center" prop="senderCity" />
+      <el-table-column label="寄件人区" align="center" prop="senderDistrict" />
+      <el-table-column label="寄件人地址" align="center" prop="senderAddress" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['his:dfAccount:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['his:dfAccount:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改代服账户对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="Key" prop="dfAppKey">
+          <el-input v-model="form.dfAppKey" placeholder="请输入dfAppKey" />
+        </el-form-item>
+        <el-form-item label="secret" prop="dfAppsecret">
+          <el-input v-model="form.dfAppsecret" placeholder="请输入dfAppsecret" />
+        </el-form-item>
+        <el-form-item label="登录账号" prop="loginAccount">
+          <el-input v-model="form.loginAccount" placeholder="请输入登录账号" />
+        </el-form-item>
+        <el-form-item label="回调地址" prop="callBackUrl">
+          <el-input v-model="form.callBackUrl" placeholder="请输入回调地址" />
+        </el-form-item>
+        <el-form-item label="月结账号" prop="monthlyCard">
+          <el-input v-model="form.monthlyCard" placeholder="请输入月结账号" />
+        </el-form-item>
+        <el-form-item label="物流产品" prop="expressProductCode">
+          <el-select v-model="form.expressProductCode" placeholder="请选择物流产品编码" clearable size="small">
+            <el-option
+              v-for="dict in expressOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="寄件姓名" prop="senderName">
+          <el-input v-model="form.senderName" placeholder="请输入寄件人姓名" />
+        </el-form-item>
+        <el-form-item label="寄件手机" prop="senderPhone">
+          <el-input v-model="form.senderPhone" placeholder="寄件人手机" />
+        </el-form-item>
+        <el-form-item label="省市区" prop="cityIds">
+          <el-cascader
+            placeholder="请选择寄件人省市区"
+            ref="citySelect"
+            v-model="form.cityIds"
+            :options="citys"
+            @change="handleCityChange()"
+          >
+          </el-cascader>
+        </el-form-item>
+        <el-form-item label="详细地址" prop="senderAddress">
+          <el-input v-model="form.senderAddress" placeholder="请输入寄件人地址" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAccount, getAccount, delAccount, addAccount, updateAccount, exportAccount } from "@/api/his/dfAccount";
+import { getCitys } from '@/api/store/city'
+export default {
+  name: "Account",
+  data() {
+    return {
+      citys: [],
+      expressOptions:[],//物流产品编码
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 代服账户表格数据
+      accountList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        dfAppKey: null,
+        dfAppsecret: null,
+        loginAccount: null,
+        callBackUrl: null,
+        monthlyCard: null,
+        expressProductCode: null,
+        senderName: null,
+        senderPhone: null,
+        senderProvince: null,
+        senderCity: null,
+        senderDistrict: null,
+        senderAddress: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        dfAppKey: [
+          { required: true, message: "key不能为空", trigger: "blur" }
+        ],
+        dfAppsecret: [
+          { required: true, message: "secret不能为空", trigger: "blur" }
+        ],
+        loginAccount: [
+          { required: true, message: "登录账户不能为空", trigger: "blur" }
+        ],
+        callBackUrl: [
+          { required: true, message: "回调地址不能为空", trigger: "blur" }
+        ],
+        monthlyCard: [
+          { required: true, message: "月结账户不能为空", trigger: "blur" }
+        ],
+        expressProductCode: [
+          { required: true, message: "物流产品不能为空", trigger: "blur" }
+        ],
+        senderName: [
+          { required: true, message: "寄件人不能为空", trigger: "blur" }
+        ],
+        senderPhone: [
+          { required: true, message: "寄件人电话不能为空", trigger: "blur" }
+        ],
+        cityIds: [
+          { required: true, message: "省市区不能为空", trigger: "blur" }
+        ],
+        senderAddress: [
+          { required: true, message: "详细地址不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getCitys();
+    this.getDicts("df_account_express").then(response => {
+      this.expressOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    handleCityChange() {
+      var nodes = this.$refs.citySelect.getCheckedNodes()
+      this.form.senderProvince = nodes[0].pathLabels[0]
+      this.form.senderCity = nodes[0].pathLabels[1]
+      this.form.senderDistrict = nodes[0].pathLabels[2]
+    },
+    getCitys() {
+      getCitys().then(res => {
+        this.loading = false
+        this.citys = res.data
+      })
+    },
+    /** 查询代服账户列表 */
+    getList() {
+      this.loading = true;
+      listAccount(this.queryParams).then(response => {
+        this.accountList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        dfAppKey: null,
+        dfAppsecret: null,
+        loginAccount: null,
+        callBackUrl: null,
+        monthlyCard: null,
+        expressProductCode: null,
+        senderName: null,
+        senderPhone: null,
+        senderProvince: null,
+        senderCity: null,
+        senderDistrict: null,
+        senderAddress: null,
+        createTime: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加代服账户";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAccount(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改代服账户";
+        this.form.cityIds = JSON.parse(response.data.cityIds)
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.cityIds = JSON.stringify(this.form.cityIds)
+          if (this.form.id != null) {
+            updateAccount(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAccount(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除代服账户编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delAccount(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有代服账户数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportAccount(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 378 - 0
src/views/his/divItem/index.vue

@@ -0,0 +1,378 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="85px">
+      <el-form-item label="订单号" prop="orderCode">
+        <el-input
+          v-model="queryParams.orderCode"
+          placeholder="请输入订单编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="支付订单号" prop="payCode">
+        <el-input
+          v-model="queryParams.payCode"
+          placeholder="请输入支付订单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择" @keyup.enter.native="handleQuery" size="small">
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="延迟分账" prop="isDelay">
+        <el-select v-model="queryParams.isDelay" placeholder="请选择" @keyup.enter.native="handleQuery" size="small">
+          <el-option
+            v-for="item in delayOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['his:divItem:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['his:divItem:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['his:divItem:remove']"
+        >删除</el-button>
+      </el-col> -->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['his:divItem:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="divItemList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="订单编号" align="center" prop="orderCode" />
+      <el-table-column label="支付订单号" align="center" prop="payCode" />
+      <el-table-column label="支付状态" align="center" prop="isPay" >
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.isPay == 1">成功</el-tag>
+          <el-tag v-if="scope.row.isPay == 0">失败</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="延迟分账" align="center" prop="isDelay" >
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.isDelay == 1">是</el-tag>
+          <el-tag v-if="scope.row.isDelay == 0">否</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="分账明细" align="center" prop="detail" />
+      <el-table-column label="退款明细" align="center" prop="refundDetail" />
+      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="更新时间" align="center" prop="updateTime" />
+      <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['his:divItem:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['his:divItem:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column> -->
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改分账明细对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="订单编号" prop="orderCode">
+          <el-input v-model="form.orderCode" placeholder="请输入订单编号" />
+        </el-form-item>
+        <el-form-item label="支付订单号" prop="payCode">
+          <el-input v-model="form.payCode" placeholder="请输入支付订单号" />
+        </el-form-item>
+        <el-form-item label="分账明细" prop="detail">
+          <el-input v-model="form.detail" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="是否支付成功 0否 1是" prop="isPay">
+          <el-input v-model="form.isPay" placeholder="请输入是否支付成功 0否 1是" />
+        </el-form-item>
+        <el-form-item label="是否延迟分账 0否 1是" prop="isDelay">
+          <el-input v-model="form.isDelay" placeholder="请输入是否延迟分账 0否 1是" />
+        </el-form-item>
+        <el-form-item label="是否退款 0否 1是" prop="isRefund">
+          <el-input v-model="form.isRefund" placeholder="请输入是否退款 0否 1是" />
+        </el-form-item>
+        <el-form-item label="退款明细" prop="refundDetail">
+          <el-input v-model="form.refundDetail" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listDivItem, getDivItem, delDivItem, addDivItem, updateDivItem, exportDivItem } from "@/api/his/divItem";
+
+export default {
+  name: "DivItem",
+  data() {
+    return {
+      delayOptions:[
+      {
+          value:0,
+          label:"否"
+        },
+        {
+          value:1,
+          label:"是"
+        }
+      ],
+      options:[
+        {
+          value:1,
+          label:"支付"
+        },
+        {
+          value:0,
+          label:"退款"
+        }
+      ],
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 分账明细表格数据
+      divItemList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderCode: null,
+        payCode: null,
+        detail: null,
+        isPay: null,
+        isDelay: 0,
+        isRefund: null,
+        refundDetail: null,
+        status:1
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        orderCode: [
+          { required: true, message: "订单编号不能为空", trigger: "blur" }
+        ],
+        payCode: [
+          { required: true, message: "支付订单号不能为空", trigger: "blur" }
+        ],
+        isPay: [
+          { required: true, message: "是否支付成功 0否 1是不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询分账明细列表 */
+    getList() {
+      this.loading = true;
+      var params = this.queryParams;
+      if(params.status == 1){
+        params.isPay = null;
+        params.isRefund = 0;
+      } else{
+        params.isPay = null;
+        params.isRefund = 1;
+      }
+      listDivItem(this.queryParams).then(response => {
+        this.divItemList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        orderCode: null,
+        payCode: null,
+        detail: null,
+        isPay: null,
+        isDelay: null,
+        isRefund: null,
+        createTime: null,
+        updateTime: null,
+        refundDetail: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加分账明细";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getDivItem(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改分账明细";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateDivItem(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addDivItem(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除分账明细编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delDivItem(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有分账明细数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportDivItem(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 30 - 2
src/views/his/doctor/type1.vue

@@ -485,7 +485,7 @@
                   </el-col>
             </el-row>
             <el-row>
-                  <el-col :span="24">
+                  <el-col :span="12">
                       <el-form-item label="身份证反面" prop="idCardBackUrl">
                         <el-upload id="sf"
                          v-model="form.idCardBackUrl"
@@ -499,6 +499,20 @@
                         </el-upload>
                       </el-form-item>
                   </el-col>
+                  <el-col :span="12">
+                      <el-form-item label="医生签名" prop="signUrl">
+                        <el-upload id="sign"
+                         v-model="form.signUrl"
+                         class="avatar-uploader"
+                         :action="bauploadUrl"
+                         :show-file-list="false"
+                         :on-success="signhandleAvatarSuccess"
+                         :before-upload="beforeAvatarUpload">
+                         <img v-if="form.signUrl" :src="form.signUrl" class="avatar" width="150px">
+                         <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                      </el-form-item>
+                  </el-col>
             </el-row>
 
         <el-row>
@@ -635,7 +649,7 @@
          
          <el-row>
                <el-col :span="12">
-                 <el-form-item label="登录账号" prop="account" v-if="form.doctorId==null||form.doctorId==''">
+                 <el-form-item label="登录账号" prop="account" >
                    <el-input v-model="form.account" placeholder="请输入账号名称" />
                  </el-form-item>
                </el-col>
@@ -1084,6 +1098,15 @@ export default {
                   this.msgError(res.msg);
                 }
      },
+     signhandleAvatarSuccess(res, file) {
+                if(res.code==200){
+                  this.form.signUrl=res.url;
+                  this.$forceUpdate();
+                }
+                else{
+                  this.msgError(res.msg);
+                }
+     },
 
     handleAvatarSuccess(res, file) {
             if(res.code==200){
@@ -1483,6 +1506,11 @@ export default {
       min-height: 150px;
       display: block;
     }
+    #sign .avatar{
+      min-width: 120px;
+      min-height: 80px;
+      display: block;
+    }
     .avatar {
          min-width: 150px;
          min-height: 150px;

+ 7 - 7
src/views/his/package/index.vue

@@ -569,7 +569,7 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="问答" prop="questionId" >
+        <!-- <el-form-item label="问答" prop="questionId" >
            <el-select v-model="form.questionId" placeholder="请选择问答">
               <el-option
                   v-for="dict in questionOptions"
@@ -578,7 +578,7 @@
                   :value="parseInt(dict.dictValue)"
                 />
            </el-select>
-        </el-form-item>
+        </el-form-item> -->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -663,7 +663,7 @@ import {
 import {getAllFollowTempName } from "@/api/his/followTemp";
 import {getAllCateList} from "@/api/his/packageCate";
 import {allIcd } from "@/api/his/icd";
-import {questionOptions } from "@/api/his/answer";
+// import {questionOptions } from "@/api/his/answer";
 import packageDetails from '../../components/his/packageDetails.vue';
 import productAttrValueSelect from "../../components/his/productAttrValueSelect.vue";
 import { listStore } from "@/api/his/storeProduct";
@@ -713,7 +713,7 @@ export default {
               url: process.env.VUE_APP_BASE_API + "/his/package/importData"
             },
       productTypeOptions: [],
-      questionOptions: [],
+      // questionOptions: [],
       storeId:null,
       storeOPtions:[],
       usageFrequencyUnitOptions:[{
@@ -868,9 +868,9 @@ export default {
     listStore().then(response => {
       this.storeOPtions = response.rows;
     });
-    questionOptions().then(res => {
-      this.questionOptions = res.rows;
-    })
+    // questionOptions().then(res => {
+    //   this.questionOptions = res.rows;
+    // })
   },
   methods: {
     getSolarTermLabel(solarTerm) {

+ 179 - 0
src/views/his/statistics/appOrderCountStats.vue

@@ -0,0 +1,179 @@
+<template>
+  <div class="app-container">
+    <div class="app-content">
+      <div class="title">App商城订单统计</div>
+      <el-form class="search-form" :inline="true">
+        <el-form-item>
+          <treeselect
+            :clearable="false"
+            v-model="companyId"
+            :options="deptOptions"
+            :show-count="true"
+            placeholder="请选择归属部门"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            filterable
+            v-model="companyUserId"
+            placeholder="请选择员工"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in users"
+              :key="item.userId"
+              :label="item.nickName"
+              :value="item.userId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="下单日期">
+          <el-date-picker
+            clearable
+            size="small"
+            style="width: 205.4px"
+            v-model="dateRange"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
+        </el-form-item>
+      </el-form>
+
+      <div class="data-box">
+        <div class="table-box">
+          <el-table
+            :data="tableData"
+            border
+            max-height="500"
+            style="width: 100%"
+          >
+            <el-table-column prop="totalOrderCount" label="订单总数" />
+            <el-table-column prop="fullPayOrderCount" label="全款支付订单数" />
+            <el-table-column prop="codOrderCount" label="物流代收支付订单数" />
+            <el-table-column prop="depositCodOrderCount" label="付定金的物流代收订单数" />
+            <el-table-column prop="noDepositCodOrderCount" label="0定金的物流代收订单数" />
+            <el-table-column prop="totalOrderAmount" label="订单总金额" />
+            <el-table-column prop="depositAmount" label="定金总金额" />
+            <el-table-column prop="codAmount" label="物流代收总金额" />
+          </el-table>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getAppOrderCount } from "@/api/company/statistics";
+import { getUserListByDeptId } from "@/api/company/companyUser";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "AppOrderCountStats",
+  components: { Treeselect },
+  watch: {
+    companyId: {
+      handler(newVal) {
+        if (newVal != null) {
+          this.companyUserId = null;
+          this.getUserListByDeptId();
+        } else {
+          this.users = [];
+          this.companyUserId = null;
+        }
+      }
+    }
+  },
+  data() {
+    return {
+      companyId: null,
+      companyUserId: null,
+      users: [],
+      deptOptions: [],
+      dateRange: [],
+      tableData: []
+    };
+  },
+  created() {
+    this.loadDeptTree();
+  },
+  methods: {
+    loadDeptTree() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+        if (response.data && response.data.length > 0) {
+          this.companyId = response.data[0].id;
+        }
+      });
+    },
+
+    getUserListByDeptId() {
+      if (!this.companyId) return;
+      getUserListByDeptId({ deptId: this.companyId }).then(response => {
+        this.users = response.data || [];
+      });
+    },
+
+    search() {
+      const params = {
+        companyId: this.companyId,
+        companyUserId: this.companyUserId,
+        startTime: this.dateRange?.[0] || undefined,
+        endTime: this.dateRange?.[1] ? this.dateRange[1] + " 23:59:59" : undefined
+      };
+
+      getAppOrderCount(params).then(response => {
+        const vo = response.data;
+        this.tableData = vo ? [vo] : [];
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+  border: 1px solid #e6e6e6;
+  padding: 12px;
+
+  .app-content {
+    background-color: white;
+    .title {
+      padding: 20px 30px 0px 30px;
+      font-size: 18px;
+      font-weight: bold;
+      color: black;
+    }
+    .search-form {
+      margin: 20px 30px 0px 30px;
+    }
+    .data-box {
+      padding: 30px;
+      background-color: rgb(255, 255, 255);
+      height: 100%;
+
+      .table-box {
+        margin-top: 15px;
+      }
+    }
+  }
+}
+
+.vue-treeselect {
+  width: 217px;
+  height: 36px;
+}
+</style>
+
+<style>
+.vue-treeselect__control {
+  display: block;
+}
+</style>

+ 186 - 0
src/views/his/statistics/hisOrderCountStats.vue

@@ -0,0 +1,186 @@
+<template>
+  <div class="app-container">
+    <div class="app-content">
+      <div class="title">互联网医院订单统计</div>
+      <el-form class="search-form" :inline="true">
+        <el-form-item>
+          <treeselect
+            :clearable="false"
+            v-model="companyId"
+            :options="deptOptions"
+            :show-count="true"
+            placeholder="请选择归属部门"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            filterable
+            v-model="companyUserId"
+            placeholder="请选择员工"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in users"
+              :key="item.userId"
+              :label="item.nickName"
+              :value="item.userId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="下单日期">
+          <el-date-picker
+            clearable
+            size="small"
+            style="width: 205.4px"
+            v-model="dateRange"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
+        </el-form-item>
+      </el-form>
+
+      <div class="data-box">
+        <div class="table-box">
+          <el-table
+            :data="tableData"
+            border
+            max-height="500"
+            style="width: 100%"
+          >
+            <el-table-column prop="totalOrderCount" label="订单总数" />
+            <el-table-column prop="fullPayOrderCount" label="全款支付订单数" />
+            <el-table-column prop="codOrderCount" label="物流代收支付订单数" />
+            <el-table-column prop="depositCodOrderCount" label="付定金的物流代收订单数" />
+            <el-table-column prop="noDepositCodOrderCount" label="0定金的物流代收订单数" />
+            <el-table-column prop="totalOrderAmount" label="订单总金额" />
+            <el-table-column prop="depositAmount" label="定金总金额" />
+            <el-table-column prop="codAmount" label="物流代收总金额" />
+          </el-table>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getHisOrderCountStats } from "@/api/company/statistics";
+import { getUserListByDeptId } from "@/api/company/companyUser";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "HisOrderCountStats",
+  components: { Treeselect },
+  watch: {
+    // 监听 companyId 变化,自动重载员工列表
+    companyId: {
+      handler(newVal) {
+        if (newVal != null) {
+          this.companyUserId = null; // 清空已选员工
+          this.getUserListByDeptId();
+        } else {
+          this.users = [];
+          this.companyUserId = null;
+        }
+      },
+      immediate: false
+    }
+  },
+  data() {
+    return {
+      companyId: null,        // 销售公司(部门)ID
+      companyUserId: null,    // 销售人员(员工)ID
+      users: [],              // 员工列表
+      deptOptions: [],        // 部门树形数据
+      dateRange: [],          // 日期范围
+      tableData: []           // 表格数据
+    };
+  },
+  created() {
+    this.loadDeptTree();
+  },
+  methods: {
+    // 加载部门树
+    loadDeptTree() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+        if (response.data && response.data.length > 0) {
+          // 默认选中第一个部门
+          this.companyId = response.data[0].id;
+          // 触发 watch 自动加载员工(无需手动调用)
+        }
+      });
+    },
+
+    // 根据 companyId 获取员工列表
+    getUserListByDeptId() {
+      if (!this.companyId) return;
+      getUserListByDeptId({ deptId: this.companyId }).then(response => {
+        this.users = response.data || [];
+      });
+    },
+
+    // 搜索统计
+    search() {
+      const params = {
+        companyId: this.companyId,
+        companyUserId: this.companyUserId,
+        startTime: this.dateRange?.[0] || undefined,
+        endTime: this.dateRange?.[1] ? this.dateRange[1] + " 23:59:59" : undefined
+      };
+
+      getHisOrderCountStats(params).then(response => {
+        const vo = response.data;
+        this.tableData = vo ? [vo] : [];
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+  border: 1px solid #e6e6e6;
+  padding: 12px;
+
+  .app-content {
+    background-color: white;
+    .title {
+      padding: 20px 30px 0px 30px;
+      font-size: 18px;
+      font-weight: bold;
+      color: black;
+    }
+    .search-form {
+      margin: 20px 30px 0px 30px;
+    }
+    .data-box {
+      padding: 30px;
+      background-color: rgb(255, 255, 255);
+      height: 100%;
+
+      .table-box {
+        margin-top: 15px;
+      }
+    }
+  }
+}
+
+.vue-treeselect {
+  width: 217px;
+  height: 36px;
+}
+</style>
+
+<style>
+.vue-treeselect__control {
+  display: block;
+}
+</style>

+ 2 - 0
src/views/his/storeOrder/order1.vue

@@ -526,6 +526,7 @@
         </el-table-column>
           <el-table-column label="下单时间" align="center" prop="createTime" width="180" />
         <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
+        <el-table-column label="发货时间" align="center" prop="deliverySendTime" width="180" />
         <el-table-column label="订单状态" align="center" prop="status" >
           <template slot-scope="scope">
                 <dict-tag :options="orderOptions" :value="scope.row.status"/>
@@ -1014,6 +1015,7 @@ export default {
         { key: 'payType', label: '支付方式', checked: true },
         { key: 'status', label: '订单状态', checked: true },
         { key: 'refundTime', label: '退款时间', checked: false },
+        { key: 'deliverySendTime', label: '发货时间', checked: false },
         { key: 'refundMoney', label: '退款金额', checked: false },
         { key: 'deliveryCode', label: '快递公司编号', checked: false },
         { key: 'deliveryName', label: '快递公司', checked: false },

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1156 - 8
src/views/hisStore/storeOrder/healthStoreList.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1104 - 19
src/views/hisStore/storeOrder/index.vue


+ 0 - 580
src/views/hospital/hospital/index.vue

@@ -1,580 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="诊所名称" prop="hospitalName">
-        <el-input
-        style="width: 220px"
-          v-model="queryParams.hospitalName"
-          placeholder="请输入诊所名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="联系电话" prop="companyMobile">
-        <el-input
-          v-model="queryParams.companyMobile"
-          placeholder="请输入联系电话"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-     
-      <el-form-item label="状态" prop="status">
-        <el-select style="width: 220px" v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-              <el-option
-                v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['hospital:hospital:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['hospital:hospital:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['hospital:hospital:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['hospital:hospital:export']"
-        >导出</el-button>
-      </el-col>
-	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table  height="660" border v-loading="loading" :data="hospitalList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="ID" align="center" prop="hospitalId" />
-      <el-table-column label="诊所名称" align="center" prop="hospitalName" />
-      <el-table-column label="管理员帐号" width="100px" align="center" prop="userName" />
-      <el-table-column label="余额" align="center" prop="money" />
-      <el-table-column label="联系电话" align="center" prop="hospitalMobile" />
-      <el-table-column label="用户数量" align="center" prop="limitUserCount" />
-      <el-table-column label="地址" align="center" prop="address" />
-      <el-table-column label="执照" align="center" prop="licenseUrl" width="120">
-         <template slot-scope="scope">
-           <el-popover
-             placement="right"
-             title=""
-             trigger="hover"
-           >
-             <img slot="reference" :src="scope.row.licenseUrl" width="100">
-             <img :src="scope.row.licenseUrl" style="max-width: 150px;">
-           </el-popover>
-         </template>
-      </el-table-column>
-      <el-table-column label="状态" align="center" prop="status" >
-        <template slot-scope="scope">
-              <el-tag prop="status" v-for="(item, index) in statusOptions"  :type="scope.row.status==1?'success':'danger'"  v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime">
-      </el-table-column>
-      <!-- <el-table-column label="到期时间" align="center" prop="limitTime">
-      </el-table-column> -->
-      <el-table-column label="操作" align="center"  fixed="right" width="200px" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            style="margin-left:10px"
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['hospital:hospital:edit']"
-          >编辑</el-button>
-           
-           <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleResetPwd(scope.row)"
-            v-hasPermi="['hospital:hospital:resetPwd']"
-          >重置密码</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['hospital:hospital:remove']"
-          >删除</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleRecharge(scope.row)"
-            v-hasPermi="['hospital:hospital:recharge']"
-          >充值</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleDeduct(scope.row)"
-            v-hasPermi="['hospital:hospital:deduct']"
-          >扣款</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改企业对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="650px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <el-form-item label="诊所名称" prop="hospitalName">
-          <el-input v-model="form.hospitalName" placeholder="请输入诊所名称" />
-        </el-form-item>
-        <el-form-item label="诊所执照" prop="licenseUrl">
-          <el-upload
-              v-model="form.licenseUrl"
-              class="avatar-uploader"
-              :action="uploadUrl"
-              :show-file-list="false"
-              :on-success="handleAvatarSuccess"
-              :before-upload="beforeAvatarUpload">
-              <img v-if="form.licenseUrl" :src="form.licenseUrl" class="avatar" width="200px">
-              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-          </el-upload>
-        </el-form-item>
-        <el-form-item label="联系电话" prop="mobile">
-          <el-input v-model="form.mobile" placeholder="请输入联系电话" />
-        </el-form-item>
-        <el-form-item label="员工数量" prop="limitUserCount">
-          <el-input-number v-model="form.limitUserCount"  :min="1" :max="10000"  ></el-input-number>
-        </el-form-item>
-        <el-form-item  label="管理员帐号" prop="userName" v-if="form.hospitalId==null">
-          <el-input v-model="form.userName" placeholder="请输入管理员帐号" />
-        </el-form-item>
-         <el-form-item  label="管理员密码" prop="password" v-if="form.hospitalId==null">
-          <el-input type="password" v-model="form.password" placeholder="请输入管理员密码" />
-        </el-form-item>
-        <el-form-item label="地址" prop="address">
-          <el-input v-model="form.address" placeholder="请输入地址" />
-        </el-form-item>
-        <el-form-item label="状态" prop="status">
-           <el-radio-group v-model="form.status">
-            <el-radio v-for="dict in statusOptions" :label="dict.dictValue">{{dict.dictLabel}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-    <el-dialog :title="recharge.title" :visible.sync="recharge.open" width="500px" append-to-body>
-      <el-form ref="rechargeForm" :rules="rechargeRules" :model="rechargeForm"  label-width="80px">
-        <el-form-item label="诊所" >
-          <el-input v-model="rechargeForm.hospitalName" disabled />
-        </el-form-item>
-        <el-form-item label="余额" >
-          <el-input v-model="rechargeForm.balance" disabled />
-        </el-form-item>
-        <el-form-item label="充值金额" prop="money">
-          <el-input-number v-model="rechargeForm.money" :min="0" placeholder="请输入充值金额" />
-        </el-form-item>
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="rechargeForm.remark" placeholder="请输入备注" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitRechargeForm">确 定</el-button>
-        <el-button @click="recharge.open=false">取 消</el-button>
-      </div>
-    </el-dialog>
-    <el-dialog :title="deduct.title" :visible.sync="deduct.open" width="500px" append-to-body>
-      <el-form ref="deductForm" :rules="deductRules" :model="deductForm"  label-width="80px">
-        <el-form-item label="诊所" >
-          <el-input v-model="deductForm.hospitalName" disabled />
-        </el-form-item>
-        <el-form-item label="余额" >
-          <el-input v-model="deductForm.balance" disabled />
-        </el-form-item>
-        <el-form-item label="扣款金额" prop="money">
-          <el-input-number v-model="deductForm.money" :min="0" placeholder="请输入扣款金额" />
-        </el-form-item>
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="deductForm.remark" placeholder="请输入备注" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitDeductForm">确 定</el-button>
-        <el-button @click="deduct.open=false">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import {recharge,deduct, resetPwd,listHospital, getHospital, delHospital, addHospital, updateHospital, exportHospital } from "@/api/hospital/hospital";
-
-
-export default {
-  name: "hospital",
-  data() {
-    return {
-      uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
-      // 表单参数
-      rechargeForm: {
-        money:0,
-      },
-      // 表单校验
-      rechargeRules: {
-        money: [
-          { required: true, message: "充值金额不能为空", trigger: "blur" }
-        ],
-      },
-      recharge:{
-        open:false,
-        title:"后台充值"
-      },
-      // 表单参数
-      deductForm: {
-        money:0,
-      },
-      // 表单校验
-      deductRules: {
-        money: [
-          { required: true, message: "扣款金额不能为空", trigger: "blur" }
-        ],
-      },
-      deduct:{
-        open:false,
-        title:"后台扣款"
-      },
-      packageIds: [],
-      packages:[],
-      typeOptions:[],
-      statusOptions:[],
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 企业表格数据
-      hospitalList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        hospitalName: null,
-        mobile: null,
-        address: null,
-        status: null,
-        startTime: null,
-        endTime: null,
-        money: null,
-        times: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        hospitalName: [
-          { required: true, message: "诊所名称不能为空", trigger: "blur" }
-        ],
-        licenseUrl:[
-          { required: true, message: "诊所执照不能为空", trigger: "blur" }
-        ],
-        mobile: [
-          { required: true, message: "诊所电话不能为空", trigger: "blur" }
-        ],
-        address: [
-          { required: true, message: "诊所地址不能为空", trigger: "blur" }
-        ],
-        limitUserCount: [
-          { required: true, message: "用户数量不能为空", trigger: "blur" }
-        ],
-        userName: [
-          { required: true, message: "帐号不能为空", trigger: "blur" }
-        ],
-        password: [
-          { required: true, message: "密码不能为空", trigger: "blur" }
-        ],
-        status: [
-          { required: true, message: "状态不能为空", trigger: "blur" }
-        ],
-      }
-    };
-  },
-  created() {
-    this.getDicts("sys_company_status").then((response) => {
-      this.statusOptions = response.data;
-    });
-    this.getDicts("sys_hospital_type").then((response) => {
-      this.typeOptions = response.data;
-    });
-    this.getList();
-  },
-  methods: {
-    handleAvatarSuccess(res, file) {
-            if(res.code==200){
-              this.form.licenseUrl=res.url;
-              console.log(this.form.licenseUrl)
-              // self.$forceUpdate()
-            }
-            else{
-              this.msgError(res.msg);
-            }
-        },
-        beforeAvatarUpload(file) {
-          const isLt1M = file.size / 1024 / 1024 < 1;
-          if (!isLt1M) {
-            this.$message.error('上传图片大小不能超过 1MB!');
-          }
-          return   isLt1M;
-        },
-    handleDeduct(row) {
-      const hospitalId = row.hospitalId  
-      this.deductForm.hospitalId=row.hospitalId;
-      this.deductForm.hospitalName=row.hospitalName;
-      this.deductForm.balance=row.money;
-      this.deduct.open = true;
-    },
-    /** 提交按钮 */
-    submitDeductForm() {
-      this.$refs["deductForm"].validate(valid => {
-        if (valid) {
-          deduct(this.deductForm).then(response => {
-            if (response.code === 200) {
-              this.msgSuccess(response.msg);
-              this.deduct.open = false;
-              this.getList();
-            }
-          });
-        }
-      });
-    },
-    handleRecharge(row) {
-      const hospitalId = row.hospitalId  
-      this.rechargeForm.hospitalId=row.hospitalId;
-      this.rechargeForm.hospitalName=row.hospitalName;
-      this.rechargeForm.balance=row.money;
-      this.recharge.open = true;
-    },
-    /** 提交按钮 */
-    submitRechargeForm() {
-      this.$refs["rechargeForm"].validate(valid => {
-        if (valid) {
-          recharge(this.rechargeForm).then(response => {
-            if (response.code === 200) {
-              this.msgSuccess(response.msg);
-              this.recharge.open = false;
-              this.getList();
-            }
-          });
-        }
-      });
-    },
-    /** 查询企业列表 */
-    getList() {
-      this.loading = true;
-      listHospital(this.queryParams).then(response => {
-        this.hospitalList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        hospitalId: null,
-        hospitalName: null,
-        hospitalMobile: null,
-        hospitalAddress: null,
-        createTime: null,
-        updateTime: null,
-        status: '0',
-        startTime: null,
-        endTime: null,
-        money: null,
-        times: null,
-        voiceApiId: null
-      };
-      this.packageIds=[];
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.hospitalId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "创建诊所";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const hospitalId = row.hospitalId || this.ids
-      getHospital(hospitalId).then(response => {
-        this.form = response.data;
-        this.form.status = response.data.status.toString();
-        this.open = true;
-        this.title = "修改诊所";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.hospitalId != null) {
-            updateHospital(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          } else {
-            addHospital(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          }
-        }
-      });
-    },
-    
-    handleResetPwd(row) {
-      const hospitalIds = row.hospitalId || this.ids;
-      this.$confirm('是否确认重复密码为123456?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return resetPwd(hospitalIds);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("修改成功");
-        }).catch(function() {});
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const hospitalIds = row.hospitalId || this.ids;
-      this.$confirm('是否确认删除诊所编号为"' + hospitalIds + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delhospital(hospitalIds);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(function() {});
-    },
-
-    /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有诊所数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exporthospital(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        }).catch(function() {});
-    },
-    
-    
-  }
-};
-</script>
-
-<style>
-.avatar-uploader .el-upload {
-     border: 1px dashed #d9d9d9;
-     border-radius: 6px;
-     cursor: pointer;
-     position: relative;
-     overflow: hidden;
-   }
-   .avatar-uploader .el-upload:hover {
-     border-color: #409EFF;
-   }
-
-   .avatar-uploader-icon {
-     font-size: 28px;
-     color: #8c939d;
-     width: 150px;
-     height: 150px;
-     line-height: 150px;
-     text-align: center;
-   }
-</style>

+ 13 - 0
src/views/index.vue

@@ -85,6 +85,15 @@
                 <count-to :start-val="0" :end-val="balance" :duration="3600" class="card-panel-num" />
               </div>
             </div>
+            <div class="property-card propertyline">
+              <div class="property-title">
+                <i class="el-icon-money"></i>
+                润天余额(元)
+              </div>
+              <div class="card-value highlight">
+                <count-to :start-val="0" :end-val="runTianBalance" :duration="3600" class="card-panel-num" />
+              </div>
+            </div>
             <div class="property-card">
               <div class="property-title">
                 <span>今日消耗 (元)</span>
@@ -956,6 +965,7 @@ export default {
       todayComsumption: 0,
       yesterdayComsumption: 0,
       balance: 0,
+      runTianBalance: 0,
       autoRefreshInterval: null,
       // 今日新增用户数
       todayIncreaseUserNum: 0,
@@ -1072,6 +1082,7 @@ export default {
     /**
      * 计算余额预计可持续的天数
      * @param {number} balance - 当前账户余额
+     * @param {number} runTianBalance - 润天账户余额
      * @param {number} todayConsumption - 今日消耗金额
      * @param {number} yesterdayConsumption - 昨日消耗金额
      * @return {Object} 包含天数和进度百分比的对象
@@ -1178,8 +1189,10 @@ export default {
     },
     refresh() {
       rechargeComsumption(this.staticParam).then(res => {
+        console.log(res);
         if (res.code === 200) {
           this.balance = res.data.balance;
+          this.runTianBalance = res.data.runTianBalance;
           this.todayComsumption = res.data.todayComsumption;
           this.yesterdayComsumption = res.data.yesterdayComsumption;
           let calculateRemainingDays1 = this.calculateRemainingDays(this.balance, this.todayComsumption, this.yesterdayComsumption);

+ 7 - 0
src/views/system/config/config.vue

@@ -308,6 +308,11 @@
               <el-input-number v-model="form7.storeCall" :min="0" :max="100"></el-input-number>
             </el-tooltip>
           </el-form-item>
+          <el-form-item  label="最低阈值" prop="minimumThreshold">
+            <el-tooltip class="item" effect="dark" content="最低阈值" placement="top-end">
+              <el-input-number    v-model="form7.minimumThreshold"  :min="0"  ></el-input-number>
+            </el-tooltip>
+          </el-form-item>
           <el-form-item label="退货收货人" prop="refundConsignee">
             <el-tooltip class="item" effect="dark" content="退货收货人" placement="top-end">
               <el-input style="width:200px" v-model="form7.refundConsignee"></el-input>
@@ -2857,6 +2862,8 @@ export default {
           console.log(this.form27)
         }
         if (key == 'his.zzzs') {
+          this.configId = response.data.configId
+          this.configKey = response.data.configKey
           this.form28 = {...this.form28, ...JSON.parse(response.data.configValue)}
         }
       })

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.