Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

xyx před 1 týdnem
rodič
revize
ab74159e47
35 změnil soubory, kde provedl 5135 přidání a 472 odebrání
  1. 25 0
      .env.prod-gzzdy
  2. 1 0
      package.json
  3. 16 0
      src/api/company/companyConfig.js
  4. 26 0
      src/api/company/companyUser.js
  5. 14 0
      src/api/course/userCoursePeriod.js
  6. 117 0
      src/api/hisStore/user.js
  7. 61 0
      src/api/hisStore/userAddress.js
  8. 7 0
      src/api/live/live.js
  9. 8 0
      src/api/qw/sopUserLogs.js
  10. 76 0
      src/api/store/collectionSchedule.js
  11. 18 0
      src/api/store/packageOrder.js
  12. 1 1
      src/api/store/patient.js
  13. binární
      src/assets/logo/gzzdy_logo.png
  14. 111 0
      src/views/company/companyConfig/miniappConfig.vue
  15. 185 2
      src/views/company/companyUser/index.vue
  16. 4 1
      src/views/course/courseWatchLog/deptWatchLog.vue
  17. 23 1
      src/views/course/courseWatchLog/index.vue
  18. 24 1
      src/views/course/courseWatchLog/watchLog.vue
  19. 53 56
      src/views/course/userCoursePeriod/index.vue
  20. 8 3
      src/views/fastGpt/fastGptRole/fastGptRole.vue
  21. 2648 0
      src/views/hisStore/storeOrder/index.vue
  22. 1 1
      src/views/live/components/productAfterSalesOrder.vue
  23. 66 32
      src/views/live/live/index.vue
  24. 1 1
      src/views/live/liveAfteraSales/index.vue
  25. 2 2
      src/views/live/liveConfig/task.vue
  26. 38 1
      src/views/live/liveConsole/LiveConsole.vue
  27. 260 124
      src/views/live/liveOrder/index.vue
  28. 2 2
      src/views/live/liveOrder/liveOrderDetails.vue
  29. 67 16
      src/views/qw/sopTemp/updateSopTemp.vue
  30. 318 222
      src/views/qw/sopUserLogs/sopUserLogsSchedule.vue
  31. 53 2
      src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue
  32. 53 1
      src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue
  33. 243 0
      src/views/store/collectionSchedule/collection.vue
  34. 357 0
      src/views/store/collectionSchedule/index.vue
  35. 248 3
      src/views/store/components/packageOrderDetails.vue

+ 25 - 0
.env.prod-gzzdy

@@ -0,0 +1,25 @@
+# 页面标题
+VUE_APP_TITLE =郑多燕SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =广州郑多燕健康管理有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =粤ICP备2023104913号-7
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/gzzdy_logo.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+#项目所属
+VUE_APP_PROJECT_FROM=gzzdy
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 1 - 0
package.json

@@ -54,6 +54,7 @@
     "build:prod-jnsyj": "vue-cli-service build --mode prod-jnsyj",
     "build:prod-yxj": "vue-cli-service build --mode prod-yxj",
     "build:prod-bjzm": "vue-cli-service build --mode prod-bjzm",
+    "build:prod-gzzdy": "vue-cli-service build --mode prod-gzzdy",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",

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

@@ -35,4 +35,20 @@ export function configUserCheck(data) {
   })
 }
 
+export function getCompanyMiniAppList() {
+  return request({
+    url: '/company/companyConfig/getCompanyMiniAppList',
+    method: 'get'
+  })
+}
+
+export function saveCompanyMiniApp(data) {
+  return request({
+    url: '/company/companyConfig/saveCompanyMiniApp',
+    method: 'post',
+    data: data
+  })
+}
+
+
 

+ 26 - 0
src/api/company/companyUser.js

@@ -334,3 +334,29 @@ export function updateBatchUserRoles(data) {
     data: data
   })
 }
+
+// 根据手机号码查询fs_user(完全匹配)
+export function queryFsUserByPhone(phone) {
+  return request({
+    url: '/company/user/fsUser/queryByPhone',
+    method: 'get',
+    params: { phone: phone }
+  })
+}
+
+// 批量绑定用户到员工
+export function batchBindCompanyUserId(data) {
+  return request({
+    url: '/company/user/batchBindCompanyUserId',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询已绑定的用户
+export function getBoundUsers(companyUserId) {
+  return request({
+    url: '/company/user/getBoundUsers/' + companyUserId,
+    method: 'get'
+  })
+}

+ 14 - 0
src/api/course/userCoursePeriod.js

@@ -8,6 +8,14 @@ export function listPeriod(query) {
     params: query
   })
 }
+// 获取营期名称列表
+export function listPeriodLabel(query) {
+  return request({
+    url: '/course/period/listLabel',
+    method: 'get',
+    params: query
+  })
+}
 // 查询会员营期列表
 export function getDays(query) {
   return request({
@@ -175,6 +183,12 @@ export function updatePeriod(data) {
     method: 'put',
     data: data
   })
+}export function updatePeriodIsNeedRegisterMember(data) {
+  return request({
+    url: '/course/period/editIsNeedRegisterMember',
+    method: 'put',
+    data: data
+  })
 }
 
 // 根据营期id获取公司红包金额列表

+ 117 - 0
src/api/hisStore/user.js

@@ -0,0 +1,117 @@
+import request from '@/utils/request'
+
+// 查询用户列表
+export function listUser(query) {
+  return request({
+    url: '/store/store/user/list',
+    method: 'get',
+    params: query
+  })
+}
+export function listUserByProject(query) {
+  return request({
+    url: '/store/store/user/listProject',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户详细
+export function getUser(userId) {
+  return request({
+    url: '/store/store/user/' + userId,
+    method: 'get'
+  })
+}
+
+// 查询用户详细
+export function queryUserVo(userId) {
+  return request({
+    url: '/store/store/user/queryvo/' + userId,
+    method: 'get'
+  })
+}
+
+// 新增用户
+export function addUser(data) {
+  return request({
+    url: '/store/store/user',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户
+export function updateUser(data) {
+  return request({
+    url: '/store/store/user',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户
+export function delUser(userId) {
+  return request({
+    url: '/store/store/user/' + userId,
+    method: 'delete'
+  })
+}
+// 删除用户
+export function delUserCompanyUser(id) {
+  return request({
+    url: '/store/store/user/delete/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出用户
+export function exportUser(query) {
+  return request({
+    url: '/store/store/user/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getUserList(query) {
+  return request({
+    url: '/store/store/user/getUserList',
+    method: 'get',
+    params: query
+  })
+}
+
+export function listBySearch(query) {
+  return request({
+    url: '/store/store/user/listBySearch',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getAllUserListLimit(query) {
+  return request({
+    url: '/store/company/companyUser/getAllUserListLimit',
+    method: 'get',
+    params: query
+  })
+}
+
+// 获取小黑屋用户列表
+export function darkRoomList(query) {
+  return request({
+    url: '/store/store/user/darkRoomList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 批量解禁
+export function enabledUsers(data) {
+  return request({
+    url: '/store/store/user/enabledUsers',
+    method: 'post',
+    data: data
+  })
+}

+ 61 - 0
src/api/hisStore/userAddress.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询用户地址列表
+export function listUserAddress(query) {
+  return request({
+    url: '/store/store/userAddress/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户地址详细
+export function getUserAddress(id) {
+  return request({
+    url: '/store/store/userAddress/' + id,
+    method: 'get'
+  })
+}
+
+// 新增用户地址
+export function addUserAddress(data) {
+  return request({
+    url: '/store/store/userAddress',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户地址
+export function updateUserAddress(data) {
+  return request({
+    url: '/store/store/userAddress',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户地址
+export function delUserAddress(id) {
+  return request({
+    url: '/store/store/userAddress/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出用户地址
+export function exportUserAddress(query) {
+  return request({
+    url: '/store/store/userAddress/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getAddressList(query) {
+  return request({
+    url: '/store/store/userAddress/getAddressList',
+    method: 'get',
+    params: query
+  })
+}

+ 7 - 0
src/api/live/live.js

@@ -51,6 +51,13 @@ export function exportLive(query) {
     params: query
   })
 }
+// 查询未结束的直播间
+export function listToLiveNoEnd() {
+  return request({
+    url: '/live/live/listToLiveNoEnd',
+    method: 'get'
+  })
+}
 
 export function selectLiveToStudent(query) {
   return request({

+ 8 - 0
src/api/qw/sopUserLogs.js

@@ -60,6 +60,14 @@ export function repairSopUserLogs(data) {
     data: data
   })
 }
+//修复营期
+export function getShortLink(data) {
+  return request({
+    url: '/qwSop/sopUserLogs/getShortLink',
+    method: 'get',
+    params: data
+  })
+}
 
 // 修改sopUserLogs
 export function updateLogDate(data) {

+ 76 - 0
src/api/store/collectionSchedule.js

@@ -0,0 +1,76 @@
+import request from '@/utils/request'
+
+// 查询用户信息采集进度列表
+export function listCollectionSchedule(query) {
+  return request({
+    url: '/store/collectionSchedule/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户信息采集进度详细
+export function getCollectionSchedule(id) {
+  return request({
+    url: '/store/collectionSchedule/' + id,
+    method: 'get'
+  })
+}
+
+// 新增用户信息采集进度
+export function addCollectionSchedule(data) {
+  return request({
+    url: '/store/collectionSchedule',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户信息采集进度
+export function updateCollectionSchedule(data) {
+  return request({
+    url: '/store/collectionSchedule',
+    method: 'put',
+    data: data
+  })
+}
+// 终止用户信息采集进度(暂时弃用)
+export function endProcess(data) {
+  return request({
+    url: '/store/collectionSchedule/endProcess',
+    method: 'put',
+    data: data
+  })
+}  // 终止用户信息采集进度
+export function stop(data) {
+  return request({
+    url: '/hisStore/collection/stop',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户信息采集进度
+export function delCollectionSchedule(id) {
+  return request({
+    url: '/store/collectionSchedule/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出用户信息采集进度
+export function exportCollectionSchedule(query) {
+  return request({
+    url: '/store/collectionSchedule/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 获取流程步骤枚举
+export function getCollectionScheduleSteps() {
+  return request({
+    url: '/store/collectionSchedule/steps',
+    method: 'get'
+  });
+}

+ 18 - 0
src/api/store/packageOrder.js

@@ -96,6 +96,24 @@ export function getUserPhone(orderId) {
     method: 'get'
   })
 }
+
+// 修改或者添加患者首诊图片
+export function editPatientImages(orderId, imagesList) {
+  const formData = new FormData();
+  formData.append('orderId', orderId);
+  formData.append('imagesList', imagesList);
+  
+  return request({
+    url: '/store/packageOrder/editPatientImages',
+    method: 'post',
+    data: formData,
+    transformRequest: [function (data, headers) {
+      // 删除默认的Content-Type,让浏览器自动设置为multipart/form-data
+      delete headers['Content-Type'];
+      return data;
+    }]
+  })
+}
 export function getWxaCodePackageOrderUnLimit(orderId) {
   return request({
     url: '/store/packageOrder/getWxaCodePackageOrderUnLimit/'+orderId,

+ 1 - 1
src/api/store/patient.js

@@ -45,7 +45,7 @@ export function updatePatient(data) {
 // 删除病人
 export function delPatient(patientId) {
   return request({
-    url: '/his/patient/' + patientId,
+    url: '/store/patient/' + patientId,
     method: 'delete'
   })
 }

binární
src/assets/logo/gzzdy_logo.png


+ 111 - 0
src/views/company/companyConfig/miniappConfig.vue

@@ -0,0 +1,111 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName">
+      <el-tab-pane label="公司小程序配置" name="companyConfig">
+        <el-form ref="sysConfig" :model="sysConfig" label-width="120px">
+          <el-form-item label="主要小程序" prop="mainMiniAppId">
+            <el-select
+              v-model="queryParams.mainMiniAppId"
+              placeholder="请选择主要小程序"
+              clearable
+              size="small"
+            >
+              <el-option
+                v-for="item in companyMiniAppList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.appid"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="备用小程序" prop="backupMiniAppId">
+            <el-select
+              v-model="queryParams.backupMiniAppId"
+              placeholder="请选择备用小程序"
+              clearable
+              size="small"
+            >
+              <el-option
+                v-for="item in companyMiniAppList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.appid"
+              />
+            </el-select>
+          </el-form-item>
+          <div class="line"></div>
+          <div style="float: right; margin-right: 20px">
+            <el-button type="primary" @click="onSubmit1">提交</el-button>
+          </div>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+import {
+    getCompanyMiniAppList,
+    saveCompanyMiniApp
+} from "@/api/company/companyConfig";
+
+export default {
+  name: "miniappConfig",
+  data() {
+    return {
+     activeName: "companyConfig",
+     queryParams:{
+        mainMiniAppId:null,
+        backupMiniAppId:null
+     },
+     companyMiniAppList:[],
+     sysConfig:{}
+    };
+  },
+  created() {
+    this.initMimiAppList();
+  },
+  mounted() {},
+  methods: {
+    initMimiAppList(){
+        getCompanyMiniAppList().then(res=>{
+        console.log(res.data);
+        this.companyMiniAppList = res.data;
+        let current = res.current;
+        if(!!current){
+            this.queryParams.mainMiniAppId =  current.mainMiniAppId;
+            this.queryParams.backupMiniAppId =  current.backupMiniAppId;
+        }
+        }).catch(res=>{
+          console.log(res);
+        })
+    },
+    //保存配置
+    onSubmit1() {
+        console.log(this.queryParams);
+        saveCompanyMiniApp(this.queryParams).then(res=>{
+            this.msgSuccess("修改成功");
+        }).catch(res=>{
+
+        })
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.tip {
+  color: indianred;
+}
+.line {
+  margin: 10px 0;
+  background-color: gainsboro;
+  height: 1px;
+}
+.el-row {
+  margin-bottom: 0px;
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+</style>
+

+ 185 - 2
src/views/company/companyUser/index.vue

@@ -245,6 +245,14 @@
                 v-hasPermi="['qw:user:bind']"
               >查或换绑企微</el-button>
 
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-user"
+                plain
+                @click="handleBindUser(scope.row)"
+              >绑定用户</el-button>
+
               <el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['company:user:edit']">修改</el-button>
               <el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['company:user:remove']">删除</el-button>
               <el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['company:user:resetPwd']">重置密码</el-button>
@@ -618,6 +626,61 @@
       <selectDoctor ref="selectDoctor" @bindCompanyUserDoctorId="bindCompanyUserDoctorId"></selectDoctor>
     </el-dialog>
 
+    <!-- 绑定用户对话框 -->
+    <el-dialog title="绑定用户" :visible.sync="bindUserDialog.open" width="900px" append-to-body @close="resetBindUserForm">
+      <el-form :model="bindUserForm" label-width="100px">
+        <el-form-item label="手机号码">
+          <el-input
+            v-model="bindUserForm.phone"
+            placeholder="请输入手机号码(完全匹配)"
+            clearable
+            style="width: 300px;"
+            @keyup.enter.native="queryFsUserByPhone"
+          >
+            <el-button slot="append" icon="el-icon-search" @click="queryFsUserByPhone">查询</el-button>
+          </el-input>
+        </el-form-item>
+      </el-form>
+
+      <!-- 已绑定用户信息 -->
+      <div v-if="boundUsersList.length > 0" style="margin-bottom: 20px;">
+        <el-divider content-position="left">已绑定用户</el-divider>
+        <el-table :data="boundUsersList" border style="width: 100%">
+          <el-table-column prop="userId" label="用户ID" width="100" align="center"></el-table-column>
+          <el-table-column prop="nickname" label="用户名称" align="center"></el-table-column>
+          <el-table-column prop="phone" label="电话" align="center"></el-table-column>
+        </el-table>
+      </div>
+
+      <!-- 查询结果 -->
+      <div v-if="fsUserList.length > 0">
+        <el-divider content-position="left">查询结果(可多选)</el-divider>
+        <el-table
+          :data="fsUserList"
+          border
+          v-loading="bindUserLoading"
+          @selection-change="handleFsUserSelectionChange"
+          style="width: 100%"
+        >
+          <el-table-column type="selection" width="55" align="center"></el-table-column>
+          <el-table-column prop="userId" label="用户ID" width="100" align="center"></el-table-column>
+          <el-table-column prop="nickname" label="用户名称" align="center"></el-table-column>
+          <el-table-column prop="phone" label="电话" align="center"></el-table-column>
+        </el-table>
+      </div>
+      <div v-else-if="bindUserForm.phone && !bindUserLoading" style="text-align: center; padding: 20px; color: #909399;">
+        暂无查询结果
+      </div>
+      <div v-if="bindUserLoading" style="text-align: center; padding: 20px;">
+        <i class="el-icon-loading"></i> 查询中...
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="bindUserDialog.open = false">取 消</el-button>
+        <el-button type="primary" @click="submitBindUser" :disabled="selectedFsUserIds.length === 0">确 定</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -636,7 +699,10 @@ import {
   generateSubDomain,
   setIsRegisterMember,
   updateCompanyUserAreaList,
-  isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles
+  isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles,
+  queryFsUserByPhone,
+  batchBindCompanyUserId,
+  getBoundUsers
 } from "@/api/company/companyUser";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/company/companyDept";
@@ -847,6 +913,19 @@ export default {
         userIds: [],
         roleIds: []
       },
+      // 绑定用户相关
+      bindUserDialog: {
+        open: false,
+        title: '绑定用户'
+      },
+      bindUserForm: {
+        phone: '',
+        companyUserId: null
+      },
+      fsUserList: [],
+      selectedFsUserIds: [],
+      boundUsersList: [],
+      bindUserLoading: false,
     };
   },
   watch: {
@@ -1343,7 +1422,10 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
 
-      const userIds = row.userId || this.ids;
+      let userIds = row.userId || this.ids;
+      if (!Array.isArray(userIds)) {
+        userIds = [userIds];
+      }
 
       // 筛选出 userType 为 '00' 的 userId
       const excludedUserIds = this.userList
@@ -1609,6 +1691,107 @@ export default {
         this.getList();
       })
     },
+    /** 绑定用户按钮操作 */
+    handleBindUser(row) {
+      this.bindUserForm.companyUserId = row.userId;
+      this.bindUserForm.phone = '';
+      this.fsUserList = [];
+      this.selectedFsUserIds = [];
+      this.boundUsersList = [];
+      this.bindUserDialog.open = true;
+
+      // 查询已绑定的用户
+      this.loadBoundUsers(row.userId);
+    },
+    /** 查询已绑定的用户 */
+    loadBoundUsers(companyUserId) {
+      getBoundUsers(companyUserId).then(response => {
+        if (response.code === 200 && response.data) {
+          this.boundUsersList = Array.isArray(response.data) ? response.data : [response.data];
+        } else {
+          this.boundUsersList = [];
+        }
+      }).catch(() => {
+        this.boundUsersList = [];
+      });
+    },
+    /** 根据手机号码查询fs_user */
+    queryFsUserByPhone() {
+      if (!this.bindUserForm.phone) {
+        this.$message.warning('请输入手机号码');
+        return;
+      }
+
+      // 验证手机号码格式
+      const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
+      if (!phonePattern.test(this.bindUserForm.phone)) {
+        this.$message.error('请输入正确的手机号码');
+        return;
+      }
+
+      this.bindUserLoading = true;
+      queryFsUserByPhone(this.bindUserForm.phone).then(response => {
+        this.bindUserLoading = false;
+        if (response.code === 200) {
+          if (response.data) {
+            // 如果返回的是单个对象,转换为数组
+            this.fsUserList = Array.isArray(response.data) ? response.data : [response.data];
+            if (this.fsUserList.length === 0) {
+              this.$message.info('未找到匹配的用户');
+            }
+          } else {
+            this.fsUserList = [];
+            this.$message.info('未找到匹配的用户');
+          }
+        } else {
+          this.fsUserList = [];
+          this.$message.error(response.msg || '查询失败');
+        }
+      }).catch(error => {
+        this.bindUserLoading = false;
+        this.fsUserList = [];
+        this.$message.error('查询失败');
+      });
+    },
+    /** 处理fs_user选择变化 */
+    handleFsUserSelectionChange(selection) {
+      this.selectedFsUserIds = selection.map(item => item.userId);
+    },
+    /** 提交绑定用户 */
+    submitBindUser() {
+      if (this.selectedFsUserIds.length === 0) {
+        this.$message.warning('请至少选择一个用户');
+        return;
+      }
+
+      const data = {
+        companyUserId: this.bindUserForm.companyUserId,
+        fsUserIds: this.selectedFsUserIds
+      };
+
+      batchBindCompanyUserId(data).then(response => {
+        if (response.code === 200) {
+          this.$message.success('绑定成功');
+          this.bindUserDialog.open = false;
+          this.getList();
+        } else {
+          this.$message.error(response.msg || '绑定失败');
+        }
+      }).catch(error => {
+        this.$message.error('绑定失败');
+      });
+    },
+    /** 重置绑定用户表单 */
+    resetBindUserForm() {
+      this.bindUserForm = {
+        phone: '',
+        companyUserId: null
+      };
+      this.fsUserList = [];
+      this.selectedFsUserIds = [];
+      this.boundUsersList = [];
+      this.bindUserLoading = false;
+    },
   },
 }
 </script>

+ 4 - 1
src/views/course/courseWatchLog/deptWatchLog.vue

@@ -653,7 +653,10 @@ export default {
       this.queryParams.eTime = this.formatDate(todayEnd);
     },
     handleSendTypeChange() {
-      this.handleQuery(); // 重新查询列表
+      setTimeout(() => {
+        this.handleQuery(); // 重新查询列表
+      }, 200);
+
     },
 
     // 重置日历组件

+ 23 - 1
src/views/course/courseWatchLog/index.vue

@@ -48,6 +48,17 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <!-- 营期名称  periodIds-->
+      <el-form-item label="营期名称" prop="periodId">
+        <el-select filterable  v-model="queryParams.periodId" placeholder="请选择营期名称"  clearable size="small">
+          <el-option
+            v-for="dict in scheduleLists"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </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
@@ -603,6 +614,7 @@
 
 <script>
 import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog } from "@/api/course/courseWatchLog";
+import {listPeriodLabel} from "@/api/course/userCoursePeriod";
 import {courseList, listCourseRedPacketLog, videoList} from '@/api/course/courseRedPacketLog'
 import {listLogs} from "@/api/course/courseAnswerlogs";
 import {allListTagGroup} from "../../../api/qw/tagGroup";
@@ -670,6 +682,7 @@ export default {
         }
       },
       courseLists:[],
+      scheduleLists:[], // 营期名称
       videoList:[],
       logTypeOptions:[],
       projectOptions:[],
@@ -770,6 +783,7 @@ export default {
         companyUserId: null,
         companyId: null,
         courseId: null,
+        periodId:null,
         sTime:null,
         eTime:null,
         upSTime:null,
@@ -822,6 +836,10 @@ export default {
     this.getDicts("sys_course_project").then(response => {
       this.projectOptions = response.data;
     });
+    // 查询营期名称
+    listPeriodLabel().then(response => {
+      this.scheduleLists = response.rows;
+    });
 
     // 设置默认当天时间 xgb 防止频繁查询大量数据
     this.setToday();
@@ -1258,6 +1276,7 @@ export default {
         companyUserId: null,
         companyId: null,
         courseId: null,
+        periodId:null,
         sTime:null,
         eTime:null,
         upSTime:null,
@@ -1418,7 +1437,10 @@ export default {
       if(this.queryParams.sendType == 1) {
         this.queryParams.qwUserName = null;
       }
-      this.handleQuery(); // 重新查询列表
+      setTimeout(() => {
+        this.handleQuery();
+      }, 200);
+
     },
 
 

+ 24 - 1
src/views/course/courseWatchLog/watchLog.vue

@@ -68,6 +68,17 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <!-- 营期名称  periodIds-->
+      <el-form-item label="营期名称" prop="periodId">
+        <el-select filterable  v-model="queryParams.periodId" placeholder="请选择营期名称"  clearable size="small">
+          <el-option
+            v-for="dict in scheduleLists"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </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)">
@@ -370,6 +381,7 @@
           <img v-else :src="scope.row.externalUserAvatar" style="width:50px;height:50px" />
         </template>
       </el-table-column>
+      <el-table-column label="营期名称" align="center" prop="periodIdName" v-if="this.queryParams.sendType==1" />
       <el-table-column label="课程名称" align="center" prop="courseName"/>
       <el-table-column label="小节名称" align="center" prop="videoName"/>
       <el-table-column label="记录类型" align="center" prop="logType">
@@ -671,6 +683,7 @@ import {
   updateCourseWatchLog
 } from "@/api/course/courseWatchLog";
 import {courseList, myListCourseRedPacketLog, videoList} from '@/api/course/courseRedPacketLog'
+import {listPeriodLabel} from "@/api/course/userCoursePeriod";
 import {myListLogs} from "@/api/course/courseAnswerlogs";
 import {getMyQwUserList} from "@/api/qw/user";
 import {searchTags} from "../../../api/qw/tag";
@@ -732,6 +745,7 @@ export default {
         }
       },
       courseLists: [],
+      scheduleLists:[], // 营期名称
       videoList: [],
       myQwUserList: [],
       logTypeOptions: [],
@@ -833,6 +847,7 @@ export default {
         companyUserId: null,
         companyId: null,
         courseId: null,
+        periodId:null,
         sTime: null,
         eTime: null,
         upSTime:null,
@@ -875,6 +890,10 @@ export default {
     });
     this.getDicts("sys_course_project").then(response => {
       this.projectOptions = response.data;
+    });
+       // 查询营期名称
+    listPeriodLabel().then(response => {
+      this.scheduleLists = response.rows;
     });
     // 设置默认当天时间 xgb 防止频繁查询大量数据
     this.setToday();
@@ -920,7 +939,10 @@ export default {
       // 强制重新渲染表格
       this.tableKey += 1;
 
-      this.getList();
+      setTimeout(() => {
+        this.getList();
+      }, 200);
+
     },
 
     // 重置日历组件
@@ -1200,6 +1222,7 @@ export default {
         companyUserId: null,
         companyId: null,
         courseId: null,
+        periodId:null,
         sTime:null,
         eTime:null,
         upSTime:null,

+ 53 - 56
src/views/course/userCoursePeriod/index.vue

@@ -33,40 +33,6 @@
     </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="['course:period:add']"-->
-<!--        >新增-->
-<!--        </el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['course:period:export']"-->
-<!--        >导出-->
-<!--        </el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="primary"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          @click="handleBatchSetRedPacket"-->
-<!--          v-hasPermi="['course:period:export']"-->
-<!--          :disabled="batchSetRedPacketDisabled"-->
-<!--        >批量设置红包-->
-<!--        </el-button>-->
-<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -95,6 +61,31 @@
             @click="handlePeriodSettings(scope.row)"
           >营期相关设置
           </el-button>
+          <!-- 根据 isNeedRegisterMember 动态显示按钮 -->
+          <el-button
+            v-if="scope.row.isNeedRegisterMember === '0'"
+            size="mini"
+            type="text"
+            icon="el-icon-open"
+            @click="handlePeriodUser(scope.row, '1')"
+          >开启单独注册会员
+          </el-button>
+          <el-button
+            v-else-if="scope.row.isNeedRegisterMember === '1'"
+            size="mini"
+            type="text"
+            icon="el-icon-turn-off"
+            @click="handlePeriodUser(scope.row, '0')"
+          >关闭单独注册会员
+          </el-button>
+<!--          <el-button-->
+<!--          v-else-->
+<!--          size="mini"-->
+<!--          type="text"-->
+<!--          icon="el-icon-open"-->
+<!--          @click="handlePeriodUser(scope.row, '1')"-->
+<!--        >开启单独注册会员-->
+<!--        </el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -248,13 +239,6 @@
       </div>
     </el-dialog>
 
-    <!--    <red-packet-->
-    <!--      :visible.sync="redPacketVisible"-->
-    <!--      :periodId="currentRedPacketData.periodId"-->
-    <!--      :videoId="currentRedPacketData.videoId"-->
-    <!--      @success="handleRedPacketSuccess"-->
-    <!--    />-->
-
     <!-- 营期相关设置抽屉 -->
     <el-drawer
       title="营期相关设置"
@@ -316,6 +300,7 @@ import {
   getPeriod,
   pagePeriod,
   updatePeriod,
+  updatePeriodIsNeedRegisterMember,
   getDays,
   addCourse,
   updateCourseTime,
@@ -455,7 +440,6 @@ export default {
     };
   },
   created() {
-
     courseList().then(response => {
       this.courseList = response.list;
     });
@@ -569,6 +553,33 @@ export default {
         this.isDisabledDateRange = true;
       });
     },
+    /** 处理单独注册会员开关 */
+    handlePeriodUser(data, open) {
+      const actionText = open === '1' ? '开启' : '关闭';
+      this.$confirm(`确定要${actionText}【${data.periodName}】的单独注册会员功能吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        var data1 = {
+          periodId:data.periodId,
+          isNeedRegisterMember:open,
+        }
+        updatePeriodIsNeedRegisterMember(data1).then(response => {
+          if (response.code === 200) {
+            this.msgSuccess(`${actionText}成功`);
+            this.getList();
+          } else {
+            this.msgError(response.msg || `${actionText}失败`);
+          }
+        }).catch(error => {
+          console.error(`${actionText}单独注册会员失败:`, error);
+          this.msgError(`${actionText}失败`);
+        });
+      }).catch(() => {
+        this.$message.info('已取消操作');
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
@@ -646,19 +657,6 @@ export default {
       this.batchRedPacketVisible = true;
     },
 
-    /** 处理批量设置红包保存 */
-    // handleBatchRedPacketSave(data) {
-    //   // 这里等待接口提供后补充具体实现
-    //   // 示例代码:
-    //   // batchSetRedPacket(data).then(response => {
-    //   //   if (response.code === 200) {
-    //   //     this.$message.success('批量设置成功');
-    //   //     this.getList();
-    //   //   }
-    //   // });
-    //   this.batchRedPacketVisible = false;
-    // },
-
     /** 获取公司下拉列表*/
     getCompanyList() {
       this.loading = true;
@@ -942,7 +940,6 @@ export default {
         this.form.periodStartingTime = this.form.dateRange[0];
         this.form.periodEndTime = this.form.dateRange[1];
 
-
         // 转换为天数
         let days = this.getDiff(this.form.periodStartingTime, this.form.periodEndTime);
         for (let i = 0; i < days; i++) {

+ 8 - 3
src/views/fastGpt/fastGptRole/fastGptRole.vue

@@ -51,7 +51,7 @@
             @click="handleBindAi(scope.row)"
           >绑定AI客服</el-button>
 
-          <el-button
+<!--          <el-button
             style="margin-top: 2%"
             v-if="scope.row.corpName!=null"
             size="mini"
@@ -59,7 +59,7 @@
             plain
             icon="el-icon-edit"
             @click="handleRelieveAi(scope.row)"
-          >解绑</el-button>
+          >解绑</el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -120,7 +120,8 @@ export default {
         kfId: null,
         kfUrl: null,
         avatar: null,
-        kfMediaId: null
+        kfMediaId: null,
+        bindCorpId: null,
       },
       // 表单参数
       form: {},
@@ -146,6 +147,7 @@ export default {
     /** 查询应用列表 */
     getList() {
       this.loading = true;
+      this.queryParams.bindCorpId = this.corpId;
       listFastGptRole(this.queryParams).then(response => {
         this.fastGptRoleList = response.rows;
         this.total = response.total;
@@ -226,6 +228,9 @@ export default {
     handleBindAiData(val){
       this.qwUserId=val.id;
       this.corpId=val.corpId;
+      this.queryParams.bindCorpId = val.corpId;
+      // 设置完数据后主动查询
+      this.getList();
     }
   }
 };

+ 2648 - 0
src/views/hisStore/storeOrder/index.vue

@@ -0,0 +1,2648 @@
+<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  v-model="queryParams.companyId" placeholder="请选择公司名"  @change="companyChange" 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>-->
+<!--          <treeselect style="width: 220px" :clearable="false"  v-model="queryParams.deptId"  :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />-->
+<!--     </el-form-item>-->
+
+      <!-- <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="orderCodes">
+        <div class="tag-input-container">
+          <!-- 标签显示区域 -->
+          <div class="tags-wrapper" @click="focusInput">
+            <!-- 已添加的订单号标签 -->
+            <el-tag
+              v-for="(code, index) in queryParams.orderCodes"
+              :key="index"
+              closable
+              size="small"
+              @close="removeOrderCode(index)"
+              class="order-tag"
+              :class="{ 'tag-error': false }"
+            >
+              {{ code }}
+            </el-tag>
+
+            <!-- 输入框 -->
+            <el-input
+              ref="tagInput"
+              v-model="currentInput"
+              v-show="inputVisible || queryParams.orderCodes.length === 0"
+              :placeholder="queryParams.orderCodes.length === 0 ? '请输入订单号,按回车或逗号分隔' : '继续输入...'"
+              size="small"
+              class="tag-input"
+              @keydown.native="handleKeyDown"
+              @keyup.native="handleKeyUp"
+              @blur="handleInputConfirm"
+              @focus="inputVisible = true"
+              clearable
+            />
+
+            <!-- 添加按钮(当没有输入时显示) -->
+            <el-button
+              v-if="!inputVisible && queryParams.orderCodes.length > 0"
+              class="button-new-tag"
+              size="small"
+              @click="showInput"
+              icon="el-icon-plus"
+              type="text"
+            >
+              添加订单号
+            </el-button>
+          </div>
+
+          <!-- 输入提示 -->
+          <div class="input-tips">
+            <span class="tip-text">
+              支持:回车、逗号、空格分隔 |
+              已添加 {{ queryParams.orderCodes.length }} 个订单号
+              <span v-if="maxOrderCodes > 0"> (最多{{ maxOrderCodes }}个)</span>
+            </span>
+          </div>
+        </div>
+      </el-form-item>
+
+       <el-form-item label="运单号" prop="deliveryId">
+        <el-input
+          v-model="queryParams.deliveryId"
+          placeholder="请输入运单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="产品名称" prop="productName">
+        <el-input
+          v-model="queryParams.productName"
+          placeholder="请输入产品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="手机号" prop="userPhone">
+        <el-input
+          v-model="queryParams.userPhone"
+          placeholder="请输入手机号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="收件人" prop="realName">
+        <el-input
+          v-model="queryParams.realName"
+          placeholder="请输入收件人姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"/>
+      </el-form-item>
+
+      <el-form-item label="员工姓名" prop="companyUserNickName">
+        <el-input
+          v-model="queryParams.companyUserNickName"
+          placeholder="请输入员工姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="订单类型" prop="orderType">
+         <el-select   v-model="queryParams.orderType" placeholder="请选择订单类型" clearable size="small" >
+         <el-option
+                v-for="item in orderTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="支付方式" prop="payType">
+         <el-select   v-model="queryParams.payType" placeholder="请选择支付方式" clearable size="small" >
+         <el-option
+                v-for="item in payTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="上传凭证" prop="isUpload">
+         <el-select   v-model="queryParams.isUpload" placeholder="请选择" clearable size="small" >
+          <el-option key="0"  label="未上传" value="0" />
+             <el-option key="1"  label="已上传" value="1" />
+        </el-select>
+      </el-form-item>
+
+
+
+      <el-form-item label="物流状态" prop="deliveryStatus">
+         <el-select   v-model="queryParams.deliveryStatus" placeholder="请选择物流状态" clearable size="small" >
+         <el-option
+                v-for="item in deliveryStatusOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="结算状态" prop="deliveryPayStatus">
+         <el-select  v-model="queryParams.deliveryPayStatus" placeholder="请选择物流结算状态" clearable size="small" >
+         <el-option
+                v-for="item in deliveryPayStatusOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="小程序" prop="appId">
+        <el-select v-model="queryParams.appId" placeholder="请选择所属小程序" clearable size="small">
+          <el-option
+            v-for="dict in appMallOptions"
+            :key="dict.appid"
+            :label="dict.name + '(' + dict.appid + ')'"
+            :value="dict.appid"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="下单时间" prop="createTimeRange">
+        <el-date-picker
+          style="width:215px"
+          clearable size="small"
+          v-model="createTimeRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="支付时间" prop="payTimeRange">
+        <el-date-picker
+          style="width: 215px"
+          clearable size="small"
+          v-model="payTimeRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="发货时间" prop="deliverySendTimeRange">
+        <el-date-picker
+          style="width:215px"
+          clearable size="small"
+          v-model="deliverySendTimeRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="回单时间" prop="deliveryImportTimeRange">
+        <el-date-picker
+          style="width:215px"
+          clearable size="small"
+          v-model="deliveryImportTimeRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+<!--      <el-form-item label="档期归属" prop="scheduleId"  >-->
+<!--            <el-select filterable style="width: 215px" v-model="queryParams.scheduleId" placeholder="请选择档期" clearable size="small" >-->
+<!--              <el-option-->
+<!--                      v-for="item in scheduleOptions"-->
+<!--                      :key="item.id"-->
+<!--                      :label="item.name"-->
+<!--                      :value="item.id"-->
+<!--                    />-->
+<!--            </el-select>-->
+<!--        </el-form-item>-->
+        <el-form-item label="代服账户" prop="erpAccount" v-if="SFDFopen">
+          <el-select v-model="queryParams.erpAccount" style="width: 215px" placeholder="ERP账户" clearable size="small">
+            <el-option
+              v-for="dict in erpAccountQueryList"
+              :key="dict"
+              :label="dict"
+              :value="dict"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="代服电话" prop="erpPhoneNumber" v-if="SFDFopen">
+          <el-input
+            v-model="queryParams.erpPhoneNumber"
+            placeholder="ERP电话"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" 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="['store:storeOrder:add']"
+        >创建订单</el-button>
+      </el-col> -->
+      <el-col :span="1.5">
+            <el-button  plain type="info" icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['store:storeOrder:importExpress']">导入银行回单</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            type="warning"
+          icon="el-icon-download"
+          size="mini"
+            @click="handleOrderExport"
+          v-hasPermi="['store:storeOrder:export']"
+        >导出订单</el-button>
+      </el-col>
+        <el-col :span="1.5">
+        <el-button
+            type="warning"
+          icon="el-icon-download"
+          size="mini"
+            @click="handleExportItems"
+          v-hasPermi="['store:storeOrder:exportItems']"
+        >导出订单明细</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-s-order"
+          size="mini"
+          @click="openDeliveryNote"
+        >批量导入物流单号</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExportDetails"
+          v-hasPermi="['store:storeOrder:export:details']"
+        >导出订单(明文)</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExportItemsDetails"
+          v-hasPermi="['store:storeOrder:exportItems:details']"
+        >导出订单明细(明文)</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleOrderDelete"
+          v-hasPermi="['store:storeOrder:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6"> <!--待推送erp-->
+        <el-tooltip content="默认erp推送手机号" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-phone"
+            size="mini"
+            @click="handleErpPhone"
+            v-hasPermi="['store:storeOrder:erpphone']"
+          >推送手机号码</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
+        <el-tooltip content="批量设置erp推送手机号" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-phone"
+            size="mini"
+
+            @click="setErpPhone"
+            v-hasPermi="['his:storeOrder:createErpOrder']"
+          >设置推送手机</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
+        <el-tooltip content="批量设置erp账户" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-s-cooperation"
+            size="mini"
+            @click="showErpAccountSetDialog"
+            v-hasPermi="['his:storeOrder:createErpOrder']"
+          >数据分捡</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
+        <el-tooltip content="批量推送erp" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-s-cooperation"
+            size="mini"
+            @click="showErpAccountDialog"
+            v-hasPermi="['his:storeOrder:createErpOrder']"
+          >创建erp</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+      >应付金额: {{ payPriceTotal}}</el-button>
+    </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+      >实付金额: {{payMoneyTotal}}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+      >物流代收金额: {{payRemainTotal }}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+      >订单量/金额: {{ total }}/{{payPriceTotal }}</el-button>
+      </el-col>
+
+      <el-col :span="1.5">
+        <el-input
+          v-model="orderItemNum"
+          disabled
+          size="mini"
+          />
+      </el-col>
+	    <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="全部订单" name="00"></el-tab-pane>
+      <el-tab-pane label="待支付" name="0"></el-tab-pane>
+      <el-tab-pane label="待推送" name="6"></el-tab-pane>
+      <el-tab-pane label="待发货" name="1"></el-tab-pane>
+      <el-tab-pane label="待收货" name="2"></el-tab-pane>
+      <el-tab-pane label="交易完成" name="3"></el-tab-pane>
+      <el-tab-pane label="退款中" name="-1"></el-tab-pane>
+      <el-tab-pane label="已退款" name="-2"></el-tab-pane>
+      <el-tab-pane label="已取消" name="-3"></el-tab-pane>
+    </el-tabs>
+    <el-table  ref="orderTable" height="500" border v-loading="loading" :data="storeOrderList" @selection-change="handleSelectionChange"
+    @sort-change="handleSortChange" :default-sort="{prop: 'createTime', order: 'descending'}">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="订单号" align="center" prop="orderCode" width="200px" />
+      <el-table-column label="ERP电话" align="center" prop="erpPhone" width="120px" v-if="SFDFopen "/>
+      <el-table-column label="ERP账号" align="center" prop="erpAccount" width="120px" v-if="SFDFopen"/>
+      <el-table-column label="所属公司" align="center" prop="companyName" />
+      <el-table-column label="所属员工" align="center" prop="companyUserNickName" width="120px" sortable="custom" :sort-orders="['ascending', 'descending']">
+          <template slot="header" slot-scope="scope">
+            <span>所属员工</span>
+            <el-tooltip content="按所属员工排序" placement="top"/>
+          </template>
+        </el-table-column>
+      <el-table-column label="小程序名称" width="120px" align="center" prop="miniProgramName"/>
+      <el-table-column label="用户昵称" align="center" prop="nickname" width="150px" >
+          <template slot-scope="scope">
+              <span>{{scope.row.nickname}} </span>
+          </template>
+      </el-table-column>
+      <el-table-column label="收件人" align="center" prop="realName" width="150px" >
+          <template slot-scope="scope">
+              <span>{{scope.row.realName}} </span>
+          </template>
+      </el-table-column>
+      <!-- <el-table-column label="商品" align="center" width="300px" >
+          <template slot-scope="scope">
+              <div  v-for="(item, index) in scope.row.items" class="items"  >
+                <img class="pic" :src="JSON.parse(item.jsonInfo).image" />
+                <div class="goods-content">
+                  <div class="goods-title">{{ JSON.parse(item.jsonInfo).productName}}</div>
+                  <div class="sku">{{ JSON.parse(item.jsonInfo).sku}}</div>
+                  <div class="price">¥{{JSON.parse(item.jsonInfo).price}}×{{item.num}}</div>
+                </div>
+              </div>
+          </template>
+      </el-table-column> -->
+      <el-table-column label="订单金额" align="center" prop="totalPrice" >
+          <template slot-scope="scope">
+              <span v-if="scope.row.totalPrice!=null">{{scope.row.totalPrice.toFixed(2)}}</span>
+          </template>
+      </el-table-column>
+       <!-- <el-table-column label="应付金额" align="center" prop="payPrice" >
+          <template slot-scope="scope">
+              <span v-if="scope.row.payPrice!=null">{{scope.row.payPrice.toFixed(2)}}</span>
+          </template>
+      </el-table-column> -->
+      <el-table-column label="应付金额" align="center" prop="payPrice" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
+          <template slot="header" slot-scope="scope">
+            <span >应收金额</span>
+            <el-tooltip content="按应收金额排序" placement="top"/>
+          </template>
+        </el-table-column>
+      <el-table-column label="实付金额" align="center" prop="payMoney" >
+        <template slot="header" slot-scope="scope">
+          <span>实收金额</span>
+          <el-tooltip content="按实收金额排序" placement="top"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="物流代收金额" align="center" prop="payDelivery" >
+          <template slot-scope="scope">
+              <span v-if="scope.row.payPrice!=null">{{scope.row.payDelivery.toFixed(2)}}</span>
+          </template>
+      </el-table-column>
+      <el-table-column label="下单时间" align="center" prop="createTime" />
+      <!-- <el-table-column label="支付状态" align="center" prop="paid" /> -->
+      <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
+      <el-table-column label="发货时间" align="center" prop="deliverySendTime" width="180"></el-table-column>
+      <el-table-column label="支付方式" align="center" prop="payType" >
+          <template slot-scope="scope">
+              <el-tag prop="payType" v-for="(item, index) in payTypeOptions"    v-if="scope.row.payType==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="订单类型" align="center" prop="orderType" >
+          <template slot-scope="scope">
+              <el-tag prop="orderType" v-for="(item, index) in orderTypeOptions"    v-if="scope.row.orderType==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="媒体来源" align="center" prop="orderMedium" >
+          <template slot-scope="scope">
+              <el-tag prop="orderMedium" v-for="(item, index) in orderMediumOptions"    v-if="scope.row.orderMedium==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="产品名称" align="center" width="200px">
+        <template slot-scope="scope">
+          <div v-if="scope.row.items && scope.row.items.length > 0">
+            <el-tag
+              v-for="(item, index) in scope.row.items"
+              :key="index"
+              size="mini"
+              class="product-tag"
+            >
+              {{ JSON.parse(item.jsonInfo).productName }} × {{ item.num }}
+            </el-tag>
+          </div>
+          <span v-else class="no-products">暂无商品</span>
+        </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"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="运单号" align="center" prop="deliveryId" >
+      </el-table-column>
+      <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
+          <template slot-scope="scope">
+              <el-tag prop="status" v-for="(item, index) in deliveryStatusOptions"    v-if="scope.row.deliveryStatus==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="物流结算状态" align="center" prop="deliveryPayStatus" >
+          <template slot-scope="scope">
+              <el-tag prop="status" v-for="(item, index) in deliveryPayStatusOptions"    v-if="scope.row.deliveryPayStatus==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+
+      <el-table-column label="操作" fixed="right" width="80px" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleDetails(scope.row)"
+            v-hasPermi="['store:storeOrder:query']"
+          >查看</el-button>
+          <!-- <el-button
+            size="mini"
+            type="text"
+            @click="handleGenPayUrl(scope.row)"
+            v-hasPermi="['store:storeOrder:genPayUrl']"
+          >生成付款链接</el-button> -->
+        </template>
+      </el-table-column>
+    </el-table>
+    <div>
+        商品数量合计:{{ productInfo }}
+    </div>
+    <!-- 排序状态显示 -->
+    <div v-if="currentSort.prop" class="sort-info">
+        <el-tag size="small" type="info" closable @close="clearSort">
+          <i class="el-icon-sort"></i>
+          当前排序:{{ getSortLabel(currentSort.prop) }}
+          {{ currentSort.order === 'ascending' ? '升序' : '降序' }}
+        </el-tag>
+          <el-button
+            type="text"
+            size="mini"
+            @click="clearSort"
+            style="margin-left: 8px; color: #909399;"
+          >
+        </el-button>
+      </div>
+
+    <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">
+      <product-order  ref="order" />
+    </el-drawer>
+
+     <el-dialog :title="title" v-if="open" :visible.sync="open" width="1000px" append-to-body>
+        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+           <el-form-item label="会员信息" prop="userId">
+                <el-row  >
+                  <el-col >
+                      <el-input placeholder="请输入会员手机号" style="width:240px;cursor:pointer" v-model="phone">
+                      </el-input>
+                      <el-button plain style="margin-left:10px;"    @click="searchUser()">查询</el-button>
+                      <el-button plain style="margin-left:10px;" icon="el-icon-plus"  type="primary" @click="handleAddUser()">添加会员</el-button>
+                  </el-col>
+                </el-row>
+                <el-table border style="margin-top:5px;"  v-loading="userloading" :data="users">
+                  <el-table-column label="ID" align="center" prop="userId" />
+                  <el-table-column label="会员头像" align="center" width="80">
+                    <template slot-scope="scope">
+                      <el-popover
+                        placement="right"
+                        title=""
+                        trigger="hover"
+                      >
+                        <img slot="reference" :src="scope.row.avatar" width="50" >
+                        <img :src="scope.row.avatar" style="max-width: 120px;">
+                      </el-popover>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="昵称" align="center" prop="nickname" />
+                  <el-table-column label="手机号" align="center" prop="phone" />
+                  <el-table-column label="状态" align="center" prop="status" >
+                      <template slot-scope="scope">
+                          <el-tag prop="status" v-for="(item, index) in userStatusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+                      </template>
+                  </el-table-column>
+                </el-table>
+            </el-form-item>
+            <el-form-item label="收货信息" prop="addressId">
+              <el-row  >
+                <el-col >
+                      <el-button plain  type="primary" icon="el-icon-plus"  @click="handleAddUserAddress()">添加收货地址</el-button>
+                </el-col>
+              </el-row>
+              <el-radio-group v-model="form.addressId" style="width:100%">
+              <el-table border  style="margin-top:5px;"  v-loading="addressloading" :data="address">
+                <el-table-column label="ID" align="center"  >
+                    <template slot-scope="scope">
+                       <el-radio :label="scope.row.id"></el-radio>
+                    </template>
+                </el-table-column>
+                <el-table-column label="收货人姓名" align="center" prop="realName" />
+                <el-table-column label="收货人电话" align="center" prop="phone" />
+                <el-table-column label="地址" align="center" prop="detail" >
+                    <template slot-scope="scope">
+                       {{scope.row.province}} {{scope.row.city}} {{scope.row.district}} {{scope.row.detail}}
+                    </template>
+                </el-table-column>
+              </el-table>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item label="商品列表" >
+              <el-row  >
+                <el-col >
+                      <el-button plain  type="primary" icon="el-icon-plus" @click="handleAddProduct">添加商品</el-button>
+                </el-col>
+              </el-row>
+              <el-table border :key = "tablekey" width="100%" style="margin-top:5px;"  :data="products">
+                <el-table-column label="商品编号" align="center" prop="barCode" />
+                <el-table-column label="商品图片" align="center" width="100">
+                  <template slot-scope="scope">
+                    <el-popover
+                      placement="right"
+                      title=""
+                      trigger="hover"
+                    >
+                      <img slot="reference" :src="scope.row.image" width="50">
+                      <img :src="scope.row.image" style="max-width: 50px;">
+                    </el-popover>
+                  </template>
+                </el-table-column>
+                <el-table-column label="产品名称" show-overflow-tooltip align="center" prop="productName" />
+                <el-table-column label="商品规格" align="center" prop="sku" />
+                <el-table-column label="库存" align="center" prop="stock" />
+                <el-table-column label="单价" align="center" prop="price" />
+                <el-table-column label="数量" align="center"  prop="count" width="200px" :key="tablekey">
+                   <template slot-scope="scope">
+                    <div>
+                        <el-input-number v-model="scope.row.count"  @change="handleProductCountChange(scope.row)"  size="mini" :min="1" :max="scope.row.stock"  ></el-input-number>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="小计" align="center" prop="money"   />
+                <el-table-column label="操作" align="center" width="100px" >
+                  <template slot-scope="scope">
+                    <el-button
+                      size="mini"
+                      type="text"
+                      icon="el-icon-delete"
+                      @click="handleDelete(scope.row)"
+                    >删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-row>
+                <el-col>
+                      <span>商品合计:{{products.length}}</span><span style="margin-left:10px;">商品总价:{{totalMoney.toFixed(2)}}</span>
+                </el-col>
+              </el-row>
+            </el-form-item>
+            <el-form-item label="订单备注" prop="mark">
+              <el-input  type="textarea" rows="2" v-model="form.mark" 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="product.title" v-if="product.open"  :visible.sync="product.open" width="1000px" append-to-body>
+        <product-select  @selectProduct="selectProduct" />
+    </el-dialog>
+    <el-dialog :title="user.title" v-if="user.open"  :visible.sync="user.open" width="500px" append-to-body>
+        <add-user @addUser="addUser" />
+    </el-dialog>
+    <el-dialog :title="userAddress.title" v-if="userAddress.open"  :visible.sync="userAddress.open" width="800px" append-to-body>
+        <add-user-address ref="addUserAddress"   @addUserAddress="addUserAddress" />
+    </el-dialog>
+    <el-dialog :title="payQr.title" v-if="payQr.open"  :visible.sync="payQr.open" width="240px" append-to-body>
+        <div style="padding-bottom:15px;" >
+            <div  class="qrcode" ref="qrCodeUrl"></div>
+        </div>
+    </el-dialog>
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" append-to-body width="400px">
+      <el-upload ref="upload" :action="upload.url + '?updateSupport=' + upload.updateSupport" :auto-upload="false" :disabled="upload.isUploading"
+                 :headers="upload.headers" :limit="1"
+                 :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" accept=".xlsx, .xls" drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <div slot="tip" class="el-upload__tip">
+          <!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据 -->
+          <el-link
+            style="font-size:12px"
+            type="info"
+            id="templateDownloadLink"
+          >
+          下载模板
+          </el-link>
+        </div>
+        <div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="importMsgOpen"
+               append-to-body title="导入结果" width="500px"
+    >
+      <h1>{{importMsg}}</h1>
+    </el-dialog>
+
+    <!-- 批量发货 -->
+    <el-dialog
+      :before-close="handleClose"
+      :visible.sync="deliveryNoteOpen"
+      center
+      title="批量发货"
+      width="35%"
+    >
+      <span slot="footer" class="dialog-footer">
+        <!-- 小程序Appid选择 -->
+<!--        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">-->
+<!--          <el-form-item label="小程序:" prop="miniAppId">-->
+<!--        <el-select-->
+<!--          v-model="ruleForm.miniAppId"-->
+<!--          clearable-->
+<!--          placeholder="请选择发货小程序"-->
+<!--          style="width: 100%"-->
+<!--        >-->
+<!--          <el-option-->
+<!--            v-for="item in miniAppList"-->
+<!--            :key="item.appId"-->
+<!--            :label="item.appName"-->
+<!--            :value="item.appId"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+<!--        </el-form>-->
+
+        <el-upload ref="upload" :action="orderUpload.url" :auto-upload="false" :disabled="orderUpload.isUploading" :headers="orderUpload.headers"
+                   :limit="1" :on-progress="handleFileUploadProgress"
+                   :on-success="handleFileSuccess" accept=".xlsx, .xls" drag
+        >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <div slot="tip" class="el-upload__tip">
+          <el-link
+            type="info"
+            id="templateDownloadLink"
+            @click.prevent="importDeliveryNoteTemplate"
+            >
+            下载模板
+          </el-link>
+        </div>
+        <div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+        <el-divider></el-divider>
+        <el-button @click="deliveryNoteOpen = false">取 消</el-button>
+        <el-button type="primary" @click="submitDeliveryNote">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 设置推送手机对话框 -->
+    <el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
+      <div style="margin-bottom: 20px;">
+        <el-button type="primary" size="small" @click="handleAddPhone">新增手机号</el-button>
+      </div>
+      <el-table :data="phoneList" border style="width: 100%">
+        <el-table-column prop="phone" label="手机号" align="center">
+          <template slot-scope="scope">
+            <el-input
+              v-if="scope.row.editing"
+              v-model="scope.row.phone"
+              placeholder="请输入手机号"
+              @blur="validatePhone(scope.row)"
+              @keyup.enter.native="handleSavePhone(scope.$index)"
+            />
+            <span v-else>{{ scope.row.phone }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="300">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.editing"
+              type="success"
+              size="mini"
+              @click="handleSavePhone(scope.$index)"
+            >保存</el-button>
+            <el-button
+              v-if="scope.row.editing"
+              type="info"
+              size="mini"
+              @click="handleCancelEdit(scope.$index)"
+            >取消</el-button>
+            <el-button
+              v-if="!scope.row.editing"
+              type="primary"
+              size="mini"
+              @click="handleEditPhone(scope.$index)"
+            >修改</el-button>
+            <el-button
+              type="danger"
+              size="mini"
+              @click="handleDeletePhone(scope.$index)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="handleSavePhoneList">确 定</el-button>
+        <el-button @click="handleCancelPhoneDialog">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog :title="erpPhone.title" :visible.sync="setPhoneOpen" width="600px" append-to-body>
+      <el-select v-model="erpPhoneValue" multiple placeholder="请选择">
+        <el-option
+          v-for="item in phoneList"
+          :key="item.phone"
+          :label="item.phone"
+          :value="item.phone">
+        </el-option>
+      </el-select>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitErpPhone">确 定</el-button>
+        <el-button @click="handleCancelErpPhone">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- ERP账户选择对话框 -->
+    <el-dialog :title="erpAccountDialog.title" :visible.sync="erpAccountDialog.open" width="600px" append-to-body>
+      <div v-loading="erpAccountDialog.loading">
+        <el-form :model="erpAccountForm" label-width="100px">
+          <el-form-item label="ERP账户" required>
+            <el-select
+              v-model="erpAccountForm.selectedAccount"
+              placeholder="请选择ERP账户"
+              style="width: 100%"
+              filterable
+            >
+              <el-option
+                v-for="account in erpAccountList"
+                :key="account"
+                :label="account"
+                :value="account"
+              >
+                <span style="float: left">{{ account}}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ account.accountCode }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+
+        <!-- 订单统计信息 -->
+        <div class="order-summary" v-if="orderSummary">
+          <el-divider content-position="left">订单统计</el-divider>
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <div class="summary-item">
+                <span class="label">选中订单数:</span>
+                <span class="value">{{ orderSummary.selectedCount }}</span>
+              </div>
+            </el-col>
+            <el-col :span="8">
+              <div class="summary-item">
+                <span class="label">总金额:</span>
+                <span class="value">¥{{ orderSummary.totalAmount }}</span>
+              </div>
+            </el-col>
+            <el-col :span="8">
+              <div class="summary-item">
+                <span class="label">查询条件订单:</span>
+                <span class="value">{{ orderSummary.queryCount }}</span>
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelErpAccountDialog">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="confirmCreateErpOrder"
+          :disabled="!erpAccountForm.selectedAccount"
+          :loading="erpAccountDialog.submitting"
+        >确认</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 导出字段选择对话框 -->
+    <el-dialog :title="exportFieldDialog.title" :visible.sync="exportFieldDialog.open" width="800px" append-to-body>
+      <div v-loading="exportFieldDialog.loading">
+        <div style="margin-bottom: 20px;">
+          <el-button type="primary" size="small" @click="selectAllFields">全选</el-button>
+          <el-button type="default" size="small" @click="unselectAllFields">全不选</el-button>
+          <el-button type="success" size="small" @click="selectDefaultFields">选择常用</el-button>
+        </div>
+
+        <div class="field-selection-container">
+          <el-row :gutter="20">
+            <el-col :span="8" v-for="field in exportFieldOptions" :key="field.key">
+              <el-checkbox
+                v-model="field.checked"
+                :label="field.label"
+                style="margin-bottom: 12px; width: 100%;"
+              >
+                {{ field.label }}
+              </el-checkbox>
+            </el-col>
+          </el-row>
+        </div>
+
+        <div class="field-count-info" style="margin-top: 20px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
+          <i class="el-icon-info"></i>
+          <span v-if="getSelectedFieldsCount() > 0">
+            已选择 <span style="color: #409EFF; font-weight: bold;">{{ getSelectedFieldsCount() }}</span> 个字段
+          </span>
+          <span v-else style="color: #E6A23C; font-weight: bold;">
+            <i class="el-icon-warning"></i>
+            未选择任何字段,将导出所有字段
+          </span>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelExportFieldDialog">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="confirmExportFields"
+        >确认导出</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import {
+  importTemplate,
+  exportStoreOrderItems,
+  createUserOrder,
+  listStoreOrder,
+  getStoreOrder,
+  delStoreOrder,
+  addStoreOrder,
+  updateStoreOrder,
+  exportStoreOrder,
+  getOrderItemsNum,
+  importDeliveryNoteExpressTemplate, exportStoreOrderDetails, exportStoreOrderItemsDetails,getErpAccount,
+  queryErpPhone,
+  saveErpPhone,editErpPhone,batchCreateErpOrder,batchSetErpOrder
+} from '@/api/hisStore/storeOrder'
+import { getUserList } from "@/api/hisStore/user";
+import { getAddressList } from "@/api/hisStore/userAddress";
+import productOrder from "../components/productOrder";
+import productSelect from "../components/productSelect";
+import addUser from "../components/addUser";
+import addUserAddress from "../components/addUserAddress";
+import { getToken } from "@/utils/auth";
+import QRCode from 'qrcodejs2'
+import { getCompanyList } from "@/api/company/company";
+// import { getTcmScheduleList } from "@/api/company/schedule";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { getConfigByKey } from '@/api/system/config'
+import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
+
+export default {
+  components: { productOrder,productSelect,addUser,addUserAddress,Treeselect },
+  name: "HisStoreOrder",
+  watch: {
+    // 监听deptId
+    'deptId': 'currDeptChange'
+  },
+  data() {
+    return {
+      orderStatus:null,
+      productInfo:"",
+      payPriceTotal:"0",
+      payMoneyTotal:"0",
+      payRemainTotal:"0",
+      // 新增排序相关数据
+      currentSort: {
+        prop: null,
+        order: null
+      },
+
+      // 排序字段映射
+      sortFieldMap: {
+        'companyUserName': '员工',
+        'packageName': '套餐名称',
+        'payPrice': '应收金额',
+        'payMoney': '实收金额',
+        'createTime': '下单时间'
+      },
+      erpSettingType:'set',
+      SFDFopen:false,
+      // 最大订单号数量限制
+      maxOrderCodes: {
+        type: Number,
+        default: 50
+      },
+      // 输入框是否可见
+      inputVisible: false,
+
+      // 无效订单号对话框
+      showInvalidDialog: false,
+      // 当前输入值
+      currentInput: '',
+      deptOpen:true,
+      // ERP账户相关数据
+      erpAccountDialog: {
+        open: false,
+        title: "选择ERP账户",
+        loading: false,
+        submitting: false
+      },
+      erpAccountList: [], // ERP账户列表
+      erpAccountQueryList:[], // ERP账户查询条件列表
+      erpAccountForm: {
+        selectedAccount: [] // 选中的账户ID
+      },
+      orderSummary: null, // 订单统计信息
+      erpPhoneValue:[],
+      setPhoneOpen:false,
+      erpPhone:{
+        open:false,
+        title:"设置推送手机号"
+      },
+      phoneList: [], // 手机号列表
+      originalPhoneList: [], // 原始手机号列表,用于取消时恢复
+      exportFieldDialog: {
+        open: false,
+        title: "选择导出字段",
+        loading: false,
+        type:null
+      },
+      // 可选择的导出字段列表
+      exportFieldOptions: [
+        { key: 'orderCode', label: '订单号', checked: true },
+        { key: 'miniProgramName', label: '小程序名称', checked: true },
+        { key: 'companyName', label: '公司名称', checked: true },
+        { key: 'companyUserNickName', label: '所属销售', checked: true },
+        { key: 'patientName', label: '就诊人', checked: true },
+        { key: 'productName', label: '编号', checked: true },
+        { key: 'barCode', label: '药品信息', checked: false },
+        { key: 'payMoney', label: '实收金额', checked: true },
+        { key: 'payRemain', label: '物流代收金额', checked: false },
+        { key: 'payType', label: '支付方式', checked: true },
+        { key: 'createTime', label: '下单时间', checked: true },
+        { key: 'payTime', label: '支付时间', checked: true },
+        { key: 'status', label: '订单状态', checked: true },
+        { key: 'userName', label: '收货人姓名', checked: true },
+        { key: 'userPhone', label: '收货人电话', checked: true },
+        { key: 'userAddress', label: '详细地址', checked: true },
+        { key: 'deliveryCode', label: '快递公司编号', checked: false },
+        { key: 'deliveryName', label: '快递公司', checked: false },
+        { key: 'deliverySn', label: '快递单号', checked: false },
+        { key: 'remark', label: '备注', checked: false },
+        { key: 'erpPhone', label: 'ERP电话', checked: false },
+        { key: 'erpAccount', label: 'ERP账号', checked: false },
+
+      ],
+
+      itemlist : [],
+      importMsgOpen:false,
+      importMsg:"",
+      scheduleOptions:[],
+      deliveryPayStatusOptions:[],
+      deliveryStatusOptions:[],
+      companys:[],
+      deptOptions:[],
+      companyId:undefined,
+      deptId:undefined,
+      orderMediumOptions:[],
+      orderTypeOptions:[],
+      payTypeOptions:[],
+      appMallOptions:[],
+      payQr:{
+        open:false,
+        title:"付款二维码"
+      },
+      user:{
+        open:false,
+        title:"创建会员"
+      },
+      userAddress:{
+        open:false,
+        title:"创建收货地址"
+      },
+      tablekey:false,
+      totalMoney:0.00,
+      products:[],
+      product:{
+        open:false,
+        title:"商品选择"
+      },
+      userStatusOptions:[],
+      phone:null,
+      address:[],
+      addressloading: false,
+      userloading: false,
+      users:[],
+      show:{
+        open:false,
+        title:"订单详情"
+      },
+      activeName:"00",
+      statusOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单表格数据
+      storeOrderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      createTimeRange:[],
+      payTimeRange:[],
+      deliveryImportTimeRange:[],
+      deliverySendTimeRange:[],
+      orderItemNum:"",
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderCode: null,
+        orderCodes:[],
+        extendOrderId: null,
+        userId: null,
+        realName: null,
+        userPhone: null,
+        userAddress: null,
+        cartId: null,
+        freightPrice: null,
+        totalNum: null,
+        totalPrice: null,
+        totalPostage: null,
+        payPrice: null,
+        payPostage: null,
+        deductionPrice: null,
+        couponId: null,
+        couponPrice: null,
+        paid: null,
+        payTime: null,
+        payType: null,
+        status: null,
+        refundStatus: null,
+        refundReasonWapImg: null,
+        refundReasonWapExplain: null,
+        refundReasonTime: null,
+        refundReasonWap: null,
+        refundReason: null,
+        refundPrice: null,
+        deliverySn: null,
+        deliveryName: null,
+        deliveryType: null,
+        deliveryId: null,
+        gainIntegral: null,
+        useIntegral: null,
+        payIntegral: null,
+        backIntegral: null,
+        mark: null,
+        isDel: null,
+        cost: null,
+        verifyCode: null,
+        storeId: null,
+        shippingType: null,
+        isChannel: null,
+        isRemind: null,
+        isSysDel: null,
+        deptId:null,
+        isUpload:null,
+        productName:null,
+
+      },
+      // 表单参数
+      form: {
+        addressId:null,
+        userId:null,
+      },
+      // 表单校验
+      rules: {
+        userId: [
+          { required: true, message: "会员信息不能为空" }
+        ],
+        addressId: [
+          { required: true, message: "收货信息不能为空" }
+        ],
+
+      },
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/store/storeOrder/importExpress",
+      },
+      orderUpload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/store/store/storeOrder/importDeliveryNoteExpress',
+      },
+      deliveryNoteOpen:false,
+      miniAppList: [],
+      ruleForm:{
+        miniAppId: 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();
+    //     }
+    // });
+    if(process.env.NODE_ENV === "prod-hst"){
+      this.getDicts("store_order_medium").then((response) => {
+        this.orderMediumOptions = response.data;
+      });
+    } else {
+      this.getDicts("crm_customer_source").then((response) => {
+        this.orderMediumOptions = response.data;
+      });
+    }
+    this.getDicts("store_order_type").then((response) => {
+      this.orderTypeOptions = response.data;
+    });
+    this.getDicts("user_status").then((response) => {
+      this.userStatusOptions = response.data;
+    });
+    this.getDicts("store_pay_type").then((response) => {
+      this.payTypeOptions = response.data;
+    });
+    this.getDicts("store_order_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("store_order_delivery_status").then((response) => {
+      this.deliveryStatusOptions = response.data;
+    });
+    this.getDicts("store_delivery_pay_status").then((response) => {
+      this.deliveryPayStatusOptions = response.data;
+    });
+    this.getList();
+    this.getItemsNum();
+    this.getErpAccountList();
+    this.getAppMallOptions();
+  },
+  methods: {
+    // 新增排序处理方法
+    handleSortChange({ column, prop, order }) {
+      console.log('排序变化:', { column, prop, order });
+
+      // 更新当前排序状态
+      this.currentSort = {
+        prop: prop,
+        order: order
+      };
+
+      // 更新查询参数
+      if (order) {
+        this.queryParams.sortField = prop;
+        this.queryParams.sortOrder = order === 'ascending' ? 'asc' : 'desc';
+      } else {
+        this.queryParams.sortField = null;
+        this.queryParams.sortOrder = null;
+      }
+
+      // 重新查询数据
+      this.queryParams.pageNum = 1; // 重置到第一页
+      this.getList();
+
+      // 显示排序提示
+      if (order) {
+        const fieldLabel = this.getSortLabel(prop);
+        const orderLabel = order === 'ascending' ? '升序' : '降序';
+        this.$message.success(`已按${fieldLabel}${orderLabel}排序`);
+      }
+    },
+
+    // 获取排序字段的中文标签
+    getSortLabel(prop) {
+      return this.sortFieldMap[prop] || prop;
+    },
+
+    // 清除排序
+    clearSort() {
+      this.currentSort = {
+        prop: null,
+        order: null
+      };
+      this.queryParams.sortField = null;
+      this.queryParams.sortOrder = null;
+      this.queryParams.pageNum = 1;
+      // 重置表格排序状态 - 关键代码
+      this.$nextTick(() => {
+        if (this.$refs.orderTable) {
+          this.$refs.orderTable.clearSort();
+        }
+      });
+      this.getList();
+      this.$message.success('已清除排序');
+    },
+     // 处理键盘按下事件
+     handleKeyDown(event) {
+      const { key, target } = event
+
+      // 处理退格键删除标签
+      if (key === 'Backspace' && !target.value && this.queryParams.orderCodes.length > 0) {
+        event.preventDefault()
+        this.removeOrderCode(this.queryParams.orderCodes.length - 1)
+      }
+
+      // 处理分隔符
+      if ([',', ',', ' ', 'Enter'].includes(key)) {
+        event.preventDefault()
+        this.handleInputConfirm()
+      }
+    },
+
+    // 处理键盘抬起事件(实时分割输入)
+    handleKeyUp(event) {
+      const value = event.target.value
+
+      // 检查是否包含分隔符
+      if (/[,,\s]/.test(value)) {
+        this.handleInputConfirm()
+      }
+    },
+
+    // 确认输入
+    handleInputConfirm() {
+      const inputValue = this.currentInput.trim()
+
+      if (inputValue) {
+        // 分割多个订单号
+        const codes = inputValue.split(/[,,\s]+/).filter(code => code.trim())
+
+        codes.forEach(code => {
+          this.addOrderCode(code.trim())
+        })
+      }
+
+      this.currentInput = ''
+    },
+
+    // 添加订单号
+    addOrderCode(code) {
+      if (!code) return
+
+      // 检查数量限制
+      if (this.maxOrderCodes > 0 && this.queryParams.orderCodes.length >= this.maxOrderCodes) {
+        this.$message.warning(`最多只能添加 ${this.maxOrderCodes} 个订单号`)
+        return
+      }
+
+      // 检查重复
+      if (this.queryParams.orderCodes.includes(code)) {
+        this.$message.warning(`订单号 "${code}" 已存在`)
+        return
+      }
+
+      // 添加到列表
+      this.queryParams.orderCodes.push(code)
+
+    },
+    // 清空所有标签
+    clearAllTags() {
+      this.$confirm('确认清空所有订单号吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.queryParams.orderCodes = []
+        this.$message.success('已清空所有订单号')
+      })
+    },
+    // 显示输入框
+    showInput() {
+      this.inputVisible = true
+      this.$nextTick(() => {
+        this.$refs.tagInput.focus()
+      })
+    },
+    // 删除订单号
+    removeOrderCode(index) {
+      this.queryParams.orderCodes.splice(index, 1)
+    },
+    // 聚焦输入框
+    focusInput() {
+      if (!this.inputVisible) {
+        this.showInput()
+      }
+    },
+    // 设置erp账户
+    showErpAccountSetDialog() {
+      this.erpAccountDialog.open = true;
+      this.erpSettingType = 'set'
+      this.calculateOrderSummary();
+    },
+    //显示ERP账户选择对话框
+    showErpAccountDialog() {
+      this.erpAccountDialog.open = true;
+      this.erpSettingType = 'push'
+      this.calculateOrderSummary();
+    },
+
+    //获取ERP账户列表
+    async getErpAccountList() {
+      try {
+        const response = await getErpAccount();
+        if (response.code === 200) {
+          const list = response.data || [];
+          this.erpAccountList = [...list];
+          this.erpAccountQueryList = [...list, '未分拣'];
+          // 设置默认值:第一条真实账户
+          if (list.length && !this.queryParams.erpAccount) {
+              this.$set(this.queryParams, 'erpAccount', list[0]);
+              this.getList();
+          }
+        } else {
+          this.$message.error(response.msg || '获取ERP账户列表失败');
+          this.erpAccountList = [];
+        }
+
+      } catch (error) {
+        console.error('获取ERP账户列表失败:', error);
+        this.$message.error('获取ERP账户列表失败');
+        this.erpAccountList = [];
+      } finally {
+        this.erpAccountDialog.loading = false;
+      }
+    },
+
+    // 新增:计算订单统计信息
+    calculateOrderSummary() {
+      let selectedCount = 0;
+      let totalAmount = 0;
+      let queryCount = this.total || 0;
+
+      if (this.ids.length > 0) {
+        // 如果有选中的订单,统计选中的订单
+        selectedCount = this.ids.length;
+        this.storeOrderList.forEach(order => {
+          if (this.ids.includes(order.orderId)) {
+            totalAmount += parseFloat(order.payMoney || 0);
+          }
+        });
+      } else {
+        // 如果没有选中订单,统计当前查询条件下的所有订单
+        selectedCount = queryCount;
+        this.storeOrderList.forEach(order => {
+          totalAmount += parseFloat(order.payMoney || 0);
+        });
+      }
+
+      this.orderSummary = {
+        selectedCount,
+        totalAmount: totalAmount.toFixed(2),
+        queryCount
+      };
+    },
+
+    //确认创建ERP订单
+    confirmCreateErpOrder() {
+      if (!this.erpAccountForm.selectedAccount) {
+        this.$message.warning('请选择ERP账户');
+        return;
+      }
+      console.log("-----------------",this.erpSettingType)
+      if(this.erpSettingType == 'set'){
+        this.$confirm(
+          `确认将订单设置ERP账户为"${this.erpAccountForm.selectedAccount}"吗?`,
+          '确认',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(() => {
+          this.executSetErpOrder();
+        });
+      } else if(this.erpSettingType == 'push'){
+        this.$confirm(
+          `确认将订单推送到ERP账户"${this.erpAccountForm.selectedAccount}"吗?`,
+          '确认推送',
+          {
+            confirmButtonText: '确定推送',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(() => {
+          this.executeCreateErpOrder();
+        });
+      }
+    },
+
+    async executSetErpOrder() {
+      this.erpAccountDialog.submitting = true;
+
+      try {
+        let param = {
+          loginAccount: this.erpAccountForm.selectedAccount
+        };
+
+        if (this.ids.length > 0) {
+          // 如果有选中的订单,只推送选中的
+          param.orderIds = this.ids;
+        } else {
+          // 如果没有选中订单,推送查询条件下的所有订单
+          // 合并查询参数
+          param = { ...param, ...this.queryParams };
+        }
+
+        const response = await batchSetErpOrder(param);
+        if (response.code === 200) {
+          this.$message.success('订单ERP账号设置成功');
+          this.cancelErpAccountDialog();
+          this.getErpAccountList(); // 刷新列表
+          this.getList();
+        } else {
+          this.$message.error(response.msg || 'ERP账号设置失败');
+        }
+      } catch (error) {
+        console.error('ERP账号设置失败:', error);
+        this.$message.error('ERP账号设置失败');
+      } finally {
+        this.erpAccountDialog.submitting = false;
+      }
+    },
+
+    //执行创建ERP订单
+    async executeCreateErpOrder() {
+      this.erpAccountDialog.submitting = true;
+
+      try {
+        let param = {
+          loginAccount: this.erpAccountForm.selectedAccount
+        };
+
+        if (this.ids.length > 0) {
+          // 如果有选中的订单,只推送选中的
+          param.orderIds = this.ids;
+        } else {
+          // 如果没有选中订单,推送查询条件下的所有订单
+          // 合并查询参数
+          param = { ...param, ...this.queryParams };
+        }
+
+        const response = await batchCreateErpOrder(param);
+        if (response.code === 200) {
+          this.$message.success('ERP订单创建成功');
+          this.cancelErpAccountDialog();
+          this.getErpAccountList(); // 刷新列表
+          this.getList();
+        } else {
+          this.$message.error(response.msg || 'ERP订单创建失败');
+        }
+      } catch (error) {
+        console.error('创建ERP订单失败:', error);
+        this.$message.error('创建ERP订单失败');
+      } finally {
+        this.erpAccountDialog.submitting = false;
+      }
+    },
+
+    // 新增:取消ERP账户选择对话框
+    cancelErpAccountDialog() {
+      this.erpAccountDialog.open = false;
+      this.erpAccountForm.selectedAccount = null;
+      this.orderSummary = null;
+      this.erpAccountList = [];
+    },
+    handleCancelErpPhone(){
+      this.erpPhoneValue = [];
+      this.setPhoneOpen = false;
+    },
+    submitErpPhone(){
+      let param = {};
+      if(this.ids.length>0){
+        param = {orderIds:this.ids,erpPhone:this.erpPhoneValue};
+      } else {
+        param = this.queryParams;
+        param.erpPhone=this.erpPhoneValue;
+      }
+
+      editErpPhone(param).then(response=>{
+        this.msgSuccess("修改成功");
+        this.setPhoneOpen = false;
+        this.getList();
+      })
+    },
+    setErpPhone(){
+      this.getErpPhoneList();
+      this.setPhoneOpen = true;
+    },
+    // 设置推送手机相关方法
+    handleErpPhone(){
+      //查询配置手机号
+      this.getErpPhoneList();
+      this.erpPhone.open = true
+    },
+    getErpPhoneList(){
+      queryErpPhone().then(response =>{
+        if(response.data && response.data != null && response.data.length >0){
+          const phones = response.data.filter(phone => phone.trim());
+          this.phoneList = phones.map(phone => ({
+            phone: phone.trim(),
+            editing: false,
+            originalPhone: phone.trim()
+          }));
+        }
+
+        // 保存原始数据用于取消操作
+        this.originalPhoneList = this.phoneList;
+      });
+    },
+    // 新增手机号
+    handleAddPhone() {
+      this.phoneList.push({
+        phone: '',
+        editing: true,
+        originalPhone: '',
+        isNew: true
+      });
+    },
+    // 编辑手机号
+    handleEditPhone(index) {
+      this.$set(this.phoneList[index], 'editing', true);
+      this.$set(this.phoneList[index], 'originalPhone', this.phoneList[index].phone);
+    },
+    // 保存手机号
+    handleSavePhone(index) {
+      const phone = this.phoneList[index].phone.trim();
+      if (!phone) {
+        this.$message.error('手机号不能为空');
+        return;
+      }
+      if (!this.validatePhoneFormat(phone)) {
+        this.$message.error('请输入正确的手机号格式');
+        return;
+      }
+      // 检查是否重复
+      const duplicateIndex = this.phoneList.findIndex((item, idx) =>
+        idx !== index && item.phone === phone
+      );
+      if (duplicateIndex !== -1) {
+        this.$message.error('手机号已存在');
+        return;
+      }
+      this.$set(this.phoneList[index], 'editing', false);
+      this.$set(this.phoneList[index], 'isNew', false);
+    },
+    // 取消编辑
+    handleCancelEdit(index) {
+      if (this.phoneList[index].isNew) {
+        // 如果是新增的,直接删除
+        this.phoneList.splice(index, 1);
+      } else {
+        // 如果是编辑的,恢复原值
+        this.$set(this.phoneList[index], 'phone', this.phoneList[index].originalPhone);
+        this.$set(this.phoneList[index], 'editing', false);
+      }
+    },
+    // 删除手机号
+    handleDeletePhone(index) {
+      this.$confirm('确认删除该手机号?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.phoneList.splice(index, 1);
+        this.$message.success('删除成功');
+      });
+    },
+    // 验证手机号格式
+    validatePhoneFormat(phone) {
+      const phoneRegex = /^1[3-9]\d{9}$/;
+      return phoneRegex.test(phone);
+    },
+    // 验证手机号
+    validatePhone(row) {
+      if (row.phone && !this.validatePhoneFormat(row.phone)) {
+        this.$message.error('请输入正确的手机号格式');
+      }
+    },
+    // 保存手机号列表
+    handleSavePhoneList() {
+      // 检查是否有正在编辑的项
+      const editingItem = this.phoneList.find(item => item.editing);
+      if (editingItem) {
+        this.$message.error('请先保存正在编辑的手机号');
+        return;
+      }
+
+      // 检查是否有空的手机号
+      const emptyPhone = this.phoneList.find(item => !item.phone.trim());
+      if (emptyPhone) {
+        this.$message.error('存在空的手机号,请删除或填写完整');
+        return;
+      }
+
+      // 构造手机号列表
+      const phoneList = this.phoneList.map(item => item.phone);
+
+      // 调用保存接口
+      saveErpPhone(phoneList).then(response => {
+        if (response.code === 200) {
+          this.$message.success('保存成功');
+          this.erpPhone.open = false;
+        } else {
+          this.$message.error(response.msg || '保存失败');
+        }
+        this.getList();
+      }).catch(() => {
+        this.$message.error('保存失败');
+      });
+    },
+    // 取消手机号对话框
+    handleCancelPhoneDialog() {
+      // 恢复原始数据
+      this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
+      this.erpPhone.open = false;
+    },
+
+    // 获取小程序选项列表
+    getAppMallOptions() {
+      getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
+        this.appMallOptions = response.rows;
+      })
+    },
+    // 获取已选择字段数量
+    getSelectedFieldsCount() {
+      return this.exportFieldOptions.filter(field => field.checked).length;
+    },
+
+    // 取消导出字段选择
+    cancelExportFieldDialog() {
+      this.exportFieldDialog.open = false;
+      this.exportFieldDialog.type = null;
+    },
+       // 选择常用字段
+       selectDefaultFields() {
+      // 先全不选
+      this.unselectAllFields();
+      // 然后选择常用字段
+      const defaultFields = ['orderCode', 'prescribeCode', 'companyName', 'companyUserNickName',
+                           'storeName', 'miniProgramName', 'userName', 'userPhone', 'userAddress', 'totalPrice',
+                           'totalNum', 'payPrice', 'payMoney', 'createTime', 'payTime',
+                           'payType', 'status', 'packageName', 'patientName'];
+      this.exportFieldOptions.forEach(field => {
+        if (defaultFields.includes(field.key)) {
+          field.checked = true;
+        }
+      });
+    },
+
+    // 确认导出字段
+    confirmExportFields() {
+      // 获取已选择的字段
+      const selectedFieldsArray = this.exportFieldOptions.filter(field => field.checked);
+
+      let selectedFields = '';
+      if (selectedFieldsArray.length === 0) {
+        // 如果没有选择任何字段,则导出全部字段(不传filter参数)
+        selectedFields = null;
+      } else {
+        // 如果选择了字段,则只导出选中的字段
+        selectedFields = selectedFieldsArray.map(field => field.key).join(',');
+      }
+
+      // 关闭弹窗
+      this.exportFieldDialog.open = false;
+
+      // 执行导出操作
+      this.doExportOrder(selectedFields);
+    },
+
+    // 执行导出操作
+    doExportOrder(selectedFields) {
+
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      if(this.deliverySendTimeRange!=null&&this.deliverySendTimeRange.length==2){
+        this.queryParams.deliverySendTimeRange=this.deliverySendTimeRange[0]+"--"+this.deliverySendTimeRange[1]
+      }
+      else{
+        this.queryParams.deliverySendTimeRange=null;
+      }
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange);
+
+      // 根据是否选择字段显示不同的确认消息
+      let confirmMessage = '';
+      if (selectedFields === null) {
+        confirmMessage = '没有选择字段,将导出所有字段的订单数据,确认继续?';
+      } else {
+        const fieldCount = selectedFields.split(',').length;
+        confirmMessage = `确认导出选中的 ${fieldCount} 个字段的订单数据?`;
+      }
+
+      this.$confirm('是否确认导出所有订单数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(()=> {
+          this.exportLoading = true;
+          // 构建请求参数
+          const requestParams = {...queryParams};
+          // 只有当selectedFields不为null时才添加filter参数
+          if (selectedFields !== null) {
+            requestParams.filter = selectedFields;
+          }
+          console.log(requestParams)
+          if(this.exportFieldDialog.type == 1){
+            return exportStoreOrder(requestParams);
+          } else if (this.exportFieldDialog.type == 2){
+            return exportStoreOrderDetails(requestParams);
+          }
+
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    },
+
+     // 导出字段选择相关方法
+    // 全选字段
+    selectAllFields() {
+      this.exportFieldOptions.forEach(field => {
+        field.checked = true;
+      });
+    },
+      // 全不选字段
+      unselectAllFields() {
+      this.exportFieldOptions.forEach(field => {
+        field.checked = false;
+      });
+    },
+
+
+
+    handleGenPayUrl(row){
+      this.payQr.open=true;
+      setTimeout(() => {
+        var qrcode = new QRCode(this.$refs.qrCodeUrl, {
+            text: config.payQRUrl+row.id, // 需要转换为二维码的内容
+            width: 200,
+            height: 200,
+            colorDark: '#000000',
+            colorLight: '#ffffff',
+            correctLevel: QRCode.CorrectLevel.H
+        })
+      }, 200);
+    },
+    handleAddUser(){
+      this.user.open=true;
+    },
+    handleAddUserAddress(){
+      if(this.form.userId==null){
+        this.msgError("请选择会员");
+        return;
+      }
+      this.userAddress.open=true;
+      setTimeout(() => {
+        this.$refs.addUserAddress.init(this.form.userId);
+      }, 500);
+    },
+    addUser(){
+      this.user.open=false;
+    },
+    addUserAddress(){
+      this.userAddress.open=false;
+      //获取地址
+      this.getAddressList(this.form.userId);
+    },
+    compute(){
+      this.totalMoney=0;
+      var that=this;
+      this.products.forEach (function (value) {
+          that.totalMoney += value.money;
+      });
+      console.log(that.totalMoney)
+    },
+    handleProductCountChange(row){
+      this.tablekey = !this.tablekey
+      console.log(row)
+      row.money=row.count*row.price;
+      this.$forceUpdate();
+      this.compute();
+    },
+    selectProduct(row){
+      console.log(row);
+      for(var i=0;i<this.products.length;i++){
+        if(this.products[i].id==row.id){
+          return;
+        }
+      }
+      row.count=1;
+      row.money=row.count*row.price;
+      this.products.push(row);
+      this.compute();
+    },
+    handleAddProduct(){
+      this.product.open=true;
+    },
+    searchUser(){
+      if(this.phone==null||this.phone==""){
+        return;
+      }
+      var data={phone:this.phone}
+      this.userloading = true;
+      this.users=[];
+      this.address=[];
+      getUserList(data).then(response => {
+        this.users = response.data;
+        this.userloading = false;
+        if(this.users!=null&&this.users.length==1){
+          this.form.userId=this.users[0].userId;
+          this.getAddressList(this.form.userId)
+        }
+      });
+    },
+    getAddressList(userId){
+      var data={userId:userId}
+      this.addressloading = true;
+      this.address=[];
+      getAddressList(data).then(response => {
+        this.address = response.data;
+        this.addressloading = false;
+      });
+    },
+    handleDetails(row){
+      this.show.open=true;
+      const orderId = row.id ;
+      setTimeout(() => {
+        this.$refs.order.getOrder(orderId);
+      }, 500);
+    },
+    handleClick(tab, event) {
+      this.orderStatus = tab.name;
+      this.activeName=tab.name;
+      this.queryParams.status=tab.name
+      console.log(this.queryParams.status)
+      this.getList();
+    },
+    /** 查询订单列表 */
+    getList() {
+      this.loading = true;
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      if(this.deliverySendTimeRange!=null&&this.deliverySendTimeRange.length==2){
+        this.queryParams.deliverySendTimeRange=this.deliverySendTimeRange[0]+"--"+this.deliverySendTimeRange[1]
+      }
+      else{
+        this.queryParams.deliverySendTimeRange=null;
+      }
+
+      // 处理订单号数组
+      if (this.queryParams.orderCodes && this.queryParams.orderCodes.length > 0) {
+        this.queryParams.orderCodeList = this.queryParams.orderCodes.join(',');
+      } else {
+        this.queryParams.orderCodeList = null;
+      }
+
+      listStoreOrder(this.queryParams).then(response => {
+        this.storeOrderList = response.rows;
+        this.total = response.total;
+        if(this.total>0){
+          this.payPriceTotal = response.payPriceTotal;
+          this.payMoneyTotal = response.payMoneyTotal;
+          this.payRemainTotal = response.payRemainTotal;
+          this.productInfo = response.productInfo;
+        } else {
+          this.payPriceTotal = "0"
+          this.payMoneyTotal = "0"
+          this.payRemainTotal = "0"
+          this.productInfo = response.productInfo;
+        }
+        this.loading = false;
+        if(response.msg == 'knt'){
+          this.SFDFopen = true;
+        } else{
+          this.SFDFopen = false;
+        }
+
+        // 如果有排序,显示排序结果提示
+        if (this.currentSort.prop) {
+          const fieldLabel = this.getSortLabel(this.currentSort.prop);
+          const orderLabel = this.currentSort.order === 'ascending' ? '升序' : '降序';
+          console.log(`数据已按${fieldLabel}${orderLabel}加载`);
+        }
+      }).catch(error => {
+        console.error('查询失败:', error);
+        this.loading = false;
+        this.$message.error('查询数据失败');
+      });
+    },
+    getItemsNum() {
+      this.loading = true;
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      if(this.deliverySendTimeRange!=null&&this.deliverySendTimeRange.length==2){
+        this.queryParams.deliverySendTimeRange=this.deliverySendTimeRange[0]+"--"+this.deliverySendTimeRange[1]
+      }
+      else{
+        this.queryParams.deliverySendTimeRange=null;
+      }
+
+      getOrderItemsNum(this.queryParams).then(response => {
+        this.orderItemNum = response.orderItemsNum;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        addressId:null,
+        userId:null,
+
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+      this.getItemsNum();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.payTimeRange = []
+      this.createTimeRange = []
+      this.deliverySendTimeRange = []
+      this.deliveryImportTimeRange = []
+      this.resetForm("queryForm");
+      // 清除排序
+      this.currentSort = {
+        prop: null,
+        order: null
+      };
+      this.queryParams.sortField = null;
+      this.queryParams.sortOrder = null;
+      // 重置表格排序状态 - 关键代码
+      this.$nextTick(() => {
+        if (this.$refs.orderTable) {
+          this.$refs.orderTable.clearSort();
+        }
+      });
+      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
+      getStoreOrder(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改订单";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        this.form.products=this.products;
+        if (valid) {
+          console.log(this.form);
+          createUserOrder(this.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("创建成功");
+              this.open = false;
+              this.getList();
+            }
+          });
+
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+       this.products.splice(this.products.findIndex(item => item.id === row.id), 1)
+       this.compute();
+
+    },
+    /** 删除按钮操作 */
+    handleOrderDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除当前选择的订单数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delStoreOrder(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleOrderExport() {
+      // 打开字段选择对话框
+      this.exportFieldDialog.open = true;
+      this.exportFieldDialog.type = 1;
+    },
+
+    handleExportItemsDetails() {
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      if(this.deliverySendTimeRange!=null&&this.deliverySendTimeRange.length==2){
+        this.queryParams.deliverySendTimeRange=this.deliverySendTimeRange[0]+"--"+this.deliverySendTimeRange[1]
+      }
+      else{
+        this.queryParams.deliverySendTimeRange=null;
+      }
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange);
+      this.$confirm('是否确认导出所有订单明细数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportStoreOrderItemsDetails(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExportDetails() {
+
+      this.exportFieldDialog.open = true;
+      this.exportFieldDialog.type = 2;
+    },
+    handleExportItems() {
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      if(this.deliverySendTimeRange!=null&&this.deliverySendTimeRange.length==2){
+        this.queryParams.deliverySendTimeRange=this.deliverySendTimeRange[0]+"--"+this.deliverySendTimeRange[1]
+      }
+      else{
+        this.queryParams.deliverySendTimeRange=null;
+      }
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange);
+      this.$confirm('是否确认导出所有订单明细数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return exportStoreOrderItems(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      }).catch(function() {});
+    },
+    handleImport() {
+      this.upload.title = "导入银行回单";
+      this.upload.open = true;
+    },
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    handleDownloadTemplate() {
+      console.log("===== 点击了下载模板,进入 importTemplate 方法 ====="); // 新增这行
+      importTemplate().then((response) => {
+        console.log("接口返回的下载链接:", response.msg);
+        this.download(response.msg);
+      }).catch((error) => {
+        console.error("下载模板接口调用失败:", error); // 新增失败回调日志
+      });
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.importMsgOpen=true;
+      this.importMsg=response.msg
+      // this.$alert(response.msg, '导入结果', {
+      //     dangerouslyUseHTMLString: true
+      //   });
+      this.getList();
+    },
+        /** 查询部门下拉树结构 */
+    getTreeselect() {
+        var that=this;
+        var param={companyId:this.companyId}
+        treeselect(param).then((response) => {
+          this.deptOptions = response.data;
+          console.log(this.deptOptions)
+          if(response.data!=null&&response.data.length>0){
+            //this.queryParams.deptId=response.data[0].id;
+          }
+        });
+    },
+     companyChange(val){
+      console.log(val);
+      this.companyId=val;
+      this.getTreeselect();
+    },
+     currDeptChange(val){
+          console.log(val)
+          this.queryParams.deptId=val;
+          this.getList();
+    },
+    //打开发货单
+    openDeliveryNote(){
+      this.deliveryNoteOpen=true;
+      // this.getAppList();
+    },
+    handleClose(done) {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+          done();
+        })
+        .catch(_ => {});
+    },
+    //发货单模板下载
+    importDeliveryNoteTemplate(){
+      importDeliveryNoteExpressTemplate().then((response) => {
+        this.download(response.msg)
+      })
+    },
+    getAppList() {
+      this.miniAppList = []
+      const key = "courseMa.config"
+      getConfigByKey(key).then(response => {
+        const {code,data} = response
+        if (code === 200) {
+          let value = data?.configValue
+          if (value) {
+            console.log("打印-----------------》",value)
+            const appList = JSON.parse(value);
+            this.miniAppList = appList.filter(v => v.type === '1').map(v => {
+              return { appId: v.appid, appName: v.name }
+            })
+          }
+        }
+      })
+    },
+    // 提交发货单
+    submitDeliveryNote() {
+      const uploadFiles = this.$refs.upload.uploadFiles;
+      if (uploadFiles.length === 0) {
+        this.$message.error('请选择要上传的文件');
+        return;
+      }
+      this.$refs.upload.submit();
+    },
+  }
+};
+</script>
+<style scoped lang="scss">
+.items{
+  margin: 5px 0px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-start;
+  .pic{
+    width:60px;
+    height:60px;
+  }
+  .goods-content{
+    margin-left: 10px;
+    max-width: 200px;
+    text-align: left;
+    .goods-title{
+
+      overflow:hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+      -o-text-overflow:ellipsis;
+    }
+  }
+}
+.el-message-box__message p{
+  max-height: 400px;
+  overflow:scroll;
+}
+.import-msg{
+  height: 500px;
+  overflow: auto;
+}
+</style>
+<style>
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+
+</style>
+<style scoped>
+.tag-input-order-search {
+  padding: 20px;
+  background: #fff;
+  border-radius: 4px;
+}
+
+.tag-input-container {
+  min-width: 445px;
+}
+
+.tags-wrapper {
+  min-height: 32px;
+  padding: 4px 8px;
+  border: 1px solid #dcdfe6;
+  border-radius: 4px;
+  cursor: text;
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+  gap: 4px;
+  transition: border-color 0.2s;
+}
+
+.tags-wrapper:hover {
+  border-color: #c0c4cc;
+}
+
+.tags-wrapper:focus-within {
+  border-color: #409eff;
+  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
+}
+
+.order-tag {
+  margin: 2px;
+  flex-shrink: 0;
+}
+
+.tag-error {
+  background-color: #fef0f0;
+  border-color: #fbc4c4;
+  color: #f56c6c;
+}
+
+.tag-input {
+  border: none;
+  outline: none;
+  flex: 1;
+  min-width: 120px;
+}
+
+.tag-input >>> .el-input__inner {
+  border: none;
+  padding: 0;
+  height: 24px;
+  line-height: 24px;
+}
+
+.button-new-tag {
+  height: 24px;
+  line-height: 22px;
+  padding: 0 8px;
+  margin: 2px;
+}
+
+.input-tips {
+  margin-top: 4px;
+  font-size: 12px;
+  color: #909399;
+}
+
+/* 新增排序相关样式 */
+.sort-info {
+  margin-top: 10px;
+  padding: 8px 0;
+}
+
+/* 表格布局优化 */
+.el-table {
+  min-width: 100%;
+  table-layout: fixed;
+}
+
+.el-table .el-table__body-wrapper {
+  overflow-x: auto;
+}
+
+.tip-text {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+}
+
+.quick-actions {
+  margin-top: 12px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 8px 0;
+  border-top: 1px solid #ebeef5;
+}
+
+.stats-info {
+  font-size: 12px;
+  color: #909399;
+  display: flex;
+  align-items: center;
+  gap: 4px;
+}
+
+.invalid-codes-list {
+  margin: 16px 0;
+  max-height: 200px;
+  overflow-y: auto;
+}
+
+.invalid-tag {
+  margin: 4px;
+}
+
+.debug-preview {
+  margin-top: 20px;
+}
+
+.debug-content {
+  font-size: 12px;
+}
+
+.debug-content code {
+  display: block;
+  background: #f5f5f5;
+  padding: 8px;
+  border-radius: 4px;
+  margin: 4px 0 12px 0;
+  white-space: pre-wrap;
+}
+
+/* 响应式设计 */
+@media (max-width: 768px) {
+  .tag-input-container {
+    min-width: auto;
+    width: 100%;
+  }
+
+  .tags-wrapper {
+    min-height: 40px;
+  }
+
+  .quick-actions {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 8px;
+  }
+}
+</style>
+

+ 1 - 1
src/views/live/components/productAfterSalesOrder.vue

@@ -16,7 +16,7 @@
             <el-tag prop="status" v-for="(item, index) in salesStatusOptions"    v-if="afterSales.salesStatus==item.dictValue">{{item.dictLabel}}</el-tag>
           </span>
           <div class="operate-button-container"  >
-            <el-button size="mini" v-hasPermi="['store:storeAfterSales:edit']" v-show="afterSales.salesStatus==0&&afterSales.status===1"  @click="addDelivery">编辑物流</el-button>
+            <el-button size="mini" v-hasPermi="['live:liveAfterSales:edit']" v-show="afterSales.salesStatus==0&&afterSales.status===1"  @click="addDelivery">编辑物流</el-button>
             <el-button size="mini"  @click="showOrder">查看订单</el-button>
          </div>
         </div>

+ 66 - 32
src/views/live/live/index.vue

@@ -110,9 +110,9 @@
       <el-checkbox :indeterminate="isIndeterminate" v-model="allChecked" @change="toggleSelectAll">
         {{ multipleSelection.length > 0 ? `已选 ${multipleSelection.length} 条` : '选中本页' }}
       </el-checkbox>
-      <el-button  plain size="mini" @click="handleShelf">上架</el-button>
-      <el-button  plain size="mini" @click="handleUnshelf">下架</el-button>
-      <el-button  plain size="mini" @click="handleDeleteSelected">删除</el-button>
+<!--      <el-button  plain size="mini" @click="handleShelf" v-hasPermi="['live:live:operation']">上架</el-button>-->
+<!--      <el-button  plain size="mini" @click="handleUnshelf" v-hasPermi="['live:live:operation']">下架</el-button>-->
+<!--      <el-button  plain size="mini" @click="handleDeleteSelected" v-hasPermi="['live:live:operation']">删除</el-button>-->
 <!--      <el-dropdown>-->
 <!--        <el-button plain size="mini">-->
 <!--          更多操作<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
@@ -174,14 +174,14 @@
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button
-            v-if="scope.row.companyName != '总台'"
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['live:live:edit']"
-          >修改</el-button>
+<!--          <el-button-->
+<!--            v-if="scope.row.companyName != '总台' || scope.row.status != 2"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleUpdate(scope.row)"-->
+<!--            v-hasPermi="['live:live:edit', 'live:live:operation']"-->
+<!--          >修改</el-button>-->
           <el-button
             v-if="scope.row.companyName == '总台'"
             size="mini"
@@ -191,13 +191,13 @@
             @click="handleView(scope.row)"
             v-hasPermi="['live:live:edit']"
           >查看</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-setting"
-            @click="handleConfig(scope.row)"
-            v-hasPermi="['live:config:list']"
-          >配置</el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-setting"-->
+<!--            @click="handleConfig(scope.row)"-->
+<!--            v-hasPermi="['live:config:list']"-->
+<!--          >配置</el-button>-->
           <el-button
             size="mini"
             type="text"
@@ -219,24 +219,31 @@
               </el-dropdown-item>
 
               <!-- 去直播按钮 -->
-              <el-dropdown-item
-                v-if="scope.row.status != 2"
-                @click.native="handleStart(scope.row)"
-              >
-                <i class="el-icon-monitor"></i> 去直播
-              </el-dropdown-item>
+<!--              <el-dropdown-item-->
+<!--                v-if="scope.row.status != 2"-->
+<!--                @click.native="handleStart(scope.row)"-->
+<!--                v-hasPermi="['live:live:operation']"-->
+<!--              >-->
+<!--                <i class="el-icon-monitor"></i> 去直播-->
+<!--              </el-dropdown-item>-->
 
               <!-- 进入直播间按钮 -->
+<!--              <el-dropdown-item-->
+<!--                v-if="scope.row.status == 2"-->
+<!--                @click.native="handleEnded(scope.row)"-->
+<!--                v-hasPermi="['live:live:operation']"-->
+<!--              >-->
+<!--                <i class="el-icon-service"></i> 结束-->
+<!--              </el-dropdown-item>-->
+<!--              <el-dropdown-item-->
+<!--                @click.native="handleCopy(scope.row)"-->
+<!--              >-->
+<!--                <i class="el-icon-service"></i> 复制直播间-->
+<!--              </el-dropdown-item>-->
               <el-dropdown-item
-                v-if="scope.row.status == 2"
-                @click.native="handleEnded(scope.row)"
-              >
-                <i class="el-icon-service"></i> 结束
-              </el-dropdown-item>
-              <el-dropdown-item
-                @click.native="handleCopy(scope.row)"
+                @click.native="handleLink(scope.row)"
               >
-                <i class="el-icon-service"></i> 复制直播间
+                <i class="el-icon-service"></i> 查看小程序链接
               </el-dropdown-item>
               <el-dropdown-item
                 v-if="scope.row.liveCodeUrl == null"
@@ -558,7 +565,34 @@ export default {
       deep: false // startTime 是字符串,无需深度监听
     }
   },
+  computed:{
+    companyUserId() {
+      return this.$store.state.user.user.userId
+    },
+    companyId() {
+      return this.$store.state.user.user.companyId
+    },
+  },
   methods: {
+
+    handleLink(row){
+      if (!row.liveId) {
+        this.$message.error('获取直播间id失败');
+        return
+      }
+      if (!this.companyUserId) {
+        this.$message.error('获取销售id失败');
+        return
+      }
+      if (!this.companyId) {
+        this.$message.error('获取销售公司失败');
+        return
+      }
+      const companyUrl = "/pages_course/living?companyId=" + this.companyId + "&companyUserId=" + this.companyUserId + "&liveId=" + row.liveId
+      this.$alert(companyUrl, '小程序跳转连接', {
+        confirmButtonText: '确定',
+      });
+    },
     beforeAvatarUpload(file) {
       const isLt1M = file.size / 1024 / 1024 < 1;
       if (!isLt1M) {

+ 1 - 1
src/views/live/liveAfteraSales/index.vue

@@ -125,7 +125,7 @@
           size="mini"
           :disabled="exportLoading"
           @click="handleExport"
-          v-hasPermi="['live:liveAfteraSales:export']"
+          v-hasPermi="['live:liveAfterSales:export']"
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>

+ 2 - 2
src/views/live/liveConfig/task.vue

@@ -739,9 +739,9 @@ export default {
         if (this.form.taskType == 1) {
           this.form.content = content.goodsId;
         }else if (this.form.taskType == 2) {
-          this.form.content = content.desc;
+          this.form.content = content.redId;
         }else if (this.form.taskType == 4) {
-          this.form.content = content.desc;
+          this.form.content = content.lotteryId;
         }else if(this.form.taskType == 5){
           this.form.content = content.couponId;
         }else if(this.form.taskType == 6){

+ 38 - 1
src/views/live/liveConsole/LiveConsole.vue

@@ -128,6 +128,7 @@
                     <a style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="blockUser(m)">拉黑</a>
                     <a v-if="m.singleVisible === 1" style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="singleVisible(m)">解除用户自见</a>
                     <a v-else style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="singleVisible(m)">用户自见</a>
+                    <a style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="deleteMsg(m)">删除</a>
                   </el-col>
                 </el-row>
               </el-col>
@@ -248,7 +249,7 @@
 <script>
 import LivePlayer from './LivePlayer.vue';
 import {blockUser, changeUserStatus, getLiveUserTotals, dashBoardWatchUserList} from '@/api/live/liveWatchUser'
-import { listLiveSingleMsg } from '@/api/live/liveMsg'
+import { listLiveSingleMsg,delLiveMsg } from '@/api/live/liveMsg'
 import { getLive } from '@/api/live/live'
 import { consoleList } from '@/api/live/task'
 import ScreenScale from './ScreenScale.vue'; // 路径根据实际位置调整
@@ -444,6 +445,42 @@ export default {
       }
       this.socket.send(JSON.stringify(msg))
     },
+    deleteMsg(m){
+      // 1. 弹出确认对话框
+      this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delLiveMsg(m.msgId).then(res => {
+          if (res.code === 200) {
+            const index = this.msgList.findIndex(item => item.msgId === m.msgId);
+            if (index !== -1) {
+              this.msgList.splice(index, 1);
+              console.log(`消息 ${m.msgId} 已在本地删除。`);
+            }
+            let msg = {
+              liveId: this.liveId,
+              userId: m.userId,
+              msg: m.msgId, // 关键:将消息ID发送给后台
+              cmd: 'deleteMsg',
+            };
+            this.socket.send(JSON.stringify(msg));
+            // 可以在这里给用户一个删除成功的提示
+            this.$message({
+              type: 'success',
+              message: '消息删除成功!'
+            });
+          }
+        })
+      }).catch(() => {
+        // 3. 用户点击“取消”或关闭对话框后的回调
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
     globalVisibleChange( val){
       // 消息自可见
       let msg = {

+ 260 - 124
src/views/live/liveOrder/index.vue

@@ -1,10 +1,31 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="所属部门" prop="deptId">
-        <treeselect style="width:220px" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属部门" />
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+<!--      <el-form-item label="公司名" prop="companyId">-->
+<!--        <el-select filterable v-model="queryParams.companyId" placeholder="请选择公司名" @change="companyChange" 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>-->
+<!--        <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />-->
+<!--      </el-form-item>-->
+
+      <el-form-item label="商品名称" prop="productName">
+        <el-input
+          v-model="queryParams.productName"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
       </el-form-item>
-      <el-form-item label="订单号" prop="orderSn">
+      <el-form-item label="订单号" prop="orderCode">
         <el-input
           v-model="queryParams.orderCode"
           placeholder="请输入订单号"
@@ -13,103 +34,111 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="用户ID" prop="userId">
+
+      <el-form-item label="收货人电话" prop="userPhone">
         <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户ID"
+          v-model="queryParams.userPhone"
+          placeholder="请输入收货人电话"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="收货人" prop="userName">
+
+      <el-form-item label="收货人姓名" prop="userName">
         <el-input
           v-model="queryParams.userName"
-          placeholder="请输入收货人"
+          placeholder="请输入收货人姓名"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="手机号" prop="userPhone">
+
+      <el-form-item label="商品规格" prop="productSpec">
         <el-input
-          v-model="queryParams.userPhone"
-          placeholder="请输入手机号"
+          v-model="queryParams.productSpec"
+          placeholder="请输入商品规格"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="地址" prop="userAddress">
+
+      <el-form-item label="商品数量" prop="totalNum">
         <el-input
-          v-model="queryParams.userAddress"
-          placeholder="请输入地址"
+          v-model="queryParams.totalNum"
+          placeholder="请输入商品数量"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="支付金额" prop="payMoney">
+
+      <el-form-item label="销售价格" prop="price">
         <el-input
-          v-model="queryParams.payMoney"
-          placeholder="请输入支付金额"
+          v-model="queryParams.price"
+          placeholder="请输入销售价格"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="订单金额" prop="orderMoney">
+
+      <el-form-item label="收货地址" prop="userAddress">
         <el-input
-          v-model="queryParams.totalPrice"
-          placeholder="请输入订单金额"
+          v-model="queryParams.userAddress"
+          placeholder="请输入收货地址"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="物流编号" prop="deliveryCode">
+
+      <el-form-item label="商品ID" prop="productId">
         <el-input
-          v-model="queryParams.deliveryCode"
-          placeholder="请输入物流编号"
+          v-model="queryParams.productId"
+          placeholder="请输入商品ID"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="物流名称" prop="deliveryName">
+
+      <el-form-item label="成本价格" prop="cost">
         <el-input
-          v-model="queryParams.deliveryName"
-          placeholder="请输入物流名称"
+          v-model="queryParams.cost"
+          placeholder="请输入成本价格"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="物流单号" prop="deliverySn">
+
+      <el-form-item label="供应商" prop="supplierName">
         <el-input
-          v-model="queryParams.deliverySn"
-          placeholder="请输入物流单号"
+          v-model="queryParams.supplierName"
+          placeholder="请输入供应商名称"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="支付时间" prop="payTime">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.payTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择支付时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="完成时间" prop="finishTime">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.finishTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择完成时间">
-        </el-date-picker>
+
+      <!-- 下单时间范围选择 -->
+      <el-form-item label="下单时间" prop="orderTimeRange">
+        <el-date-picker
+          v-model="orderTimeRange"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          size="small"
+          @change="handleOrderTimeChange"
+        />
       </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>
@@ -117,7 +146,6 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -131,43 +159,78 @@
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
+
     <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
       <el-tab-pane label="全部订单" name="10"></el-tab-pane>
       <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
     </el-tabs>
+
     <el-table border v-loading="loading" :data="liveOrderList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="订单ID" align="center" prop="orderId"/>
       <el-table-column label="订单号" align="center" prop="orderCode" />
-      <el-table-column label="用户ID" align="center" prop="userId" />
-      <el-table-column label="收货人" align="center" prop="userName" />
-      <el-table-column label="手机号" align="center" prop="userPhone" />
-      <el-table-column label="地址" align="center" prop="userAddress" />
-      <el-table-column label="支付金额" align="center" prop="payMoney" />
-      <el-table-column label="订单金额" align="center" prop="totalPrice" />
-      <el-table-column label="物流编号" align="center" prop="deliveryCode" />
-      <el-table-column label="物流名称" align="center" prop="deliveryName" />
-      <el-table-column label="物流单号" align="center" prop="deliverySn" />
-      <el-table-column label="支付时间" align="center" prop="payTime" width="180">
+
+      <el-table-column label="销售ID" align="center" prop="companyUserId" >
+        <template slot-scope="scope">
+          <span v-if="scope.row.companyUserId > 0" >{{ scope.row.companyUserId }}</span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="绑定销售昵称" align="center" prop="companyUserNickName" />
+      <el-table-column label="客户编码" align="center" prop="userId" />
+      <el-table-column label="会员等级" align="center" prop="userLevel">
+      </el-table-column>
+      <el-table-column label="销售绑定手机号" align="center" prop="companyUserPhone" />
+      <el-table-column label="销售创建时间" align="center" prop="companyUserCreateTime" width="180">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span>
+          <span>{{ scope.row.companyUserCreateTime }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="完成时间" align="center" prop="finishTime" width="180">
+      <el-table-column label="客户ID" align="center" prop="userId" />
+      <el-table-column label="客户昵称" align="center" prop="nickName" />
+      <el-table-column label="客户绑定手机号" align="center" prop="userBindPhone" />
+      <el-table-column label="收货人电话" align="center" prop="userPhone" />
+      <el-table-column label="收货人姓名" align="center" prop="userName" />
+      <el-table-column label="累计成交笔数" align="center" prop="totalOrderCount" />
+      <el-table-column label="累计成交总额" align="center" prop="totalOrderAmount" />
+      <el-table-column label="最新绑定时间" align="center" prop="latestBindTime" width="180">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
+          <span>{{ scope.row.latestBindTime }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="状态" align="center" prop="status" :formatter="orderStatusFormatter"/>
-      <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="客户状态" align="center" prop="customerStatus">
+        <template slot-scope="scope">
+          <dict-tag :options="customerStatusOptions" :value="scope.row.customerStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="所属店铺" align="center" prop="storeId" />
+      <el-table-column label="所属店铺名称" align="center" prop="storeName" />
+      <el-table-column label="商品ID" align="center" prop="productId" />
+      <el-table-column label="商品名称" align="center" prop="productName" width="150" />
+      <el-table-column label="商品规格" align="center" prop="productSpec" width="120" />
+      <el-table-column label="商品数量" align="center" prop="totalNum" />
+      <el-table-column label="销售价格" align="center" prop="totalPrice" />
+      <el-table-column label="成交价" align="center" prop="payMoney"/>
+<!--      <el-table-column label="成本价格" align="center" prop="costPrice" />-->
+      <el-table-column label="收货地址" align="center" prop="userAddress" width="200" />
+      <el-table-column label="对应供应商" align="center" prop="supplierName" width="120" />
+      <el-table-column label="下单时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ formatDateTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="订单状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="orderStatusOptions" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handledetails(scope.row)"
-            v-hasPermi="['live:liveOrder:edit']"
+            v-hasPermi="['live:liveOrder:query']"
           >查看</el-button>
         </template>
       </el-table-column>
@@ -180,30 +243,34 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
+
     <el-drawer
       :with-header="false"
       size="75%"
       :title="show.title" :visible.sync="show.open">
-      <liveOrderDetails  ref="Details" />
+      <liveOrderDetails ref="Details" />
     </el-drawer>
-
   </div>
 </template>
 
 <script>
-import { listLiveOrder, exportLiveOrder } from "@/api/live/liveOrder";
+import { listLiveOrderZm, exportLiveOrderZm } from "@/api/live/liveOrder";
 import liveOrderDetails from './liveOrderDetails.vue';
-import { treeselect } from "@/api/company/companyDept";
+import {getCompanyList} from "@/api/company/company";
 import Treeselect from "@riophae/vue-treeselect";
+import {treeselect} from "@/api/company/companyDept";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {parseTime} from "../../../utils/common";
 
 export default {
   name: "LiveOrder",
   components: {Treeselect, liveOrderDetails },
   data() {
     return {
-      //字典
+      // 字典
       orderStatusOptions: [],
+      memberLevelOptions: [],
+      customerStatusOptions: [],
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -220,120 +287,189 @@ export default {
       total: 0,
       // 订单表格数据
       liveOrderList: [],
+      // 公司列表
+      companys: [],
+      companyId: null,
+      // 部门树选项
+      deptOptions: [],
+
+      // 下单时间范围选择器绑定的值
+      orderTimeRange: [],
+
       // 查询参数
       queryParams: {
         pageNum: 1,
         liveId: null,
         pageSize: 10,
-        orderSn: null,
-        userId: null,
-        userName: null,
-        mobile: null,
-        address: null,
-        payMoney: null,
-        orderMoney: null,
-        deliveryCode: null,
-        deliveryName: null,
-        deliverySn: null,
-        payTime: null,
-        finishTime: null,
+        companyId: null,
+        deptId: null,
+        productName: null,
+        productSpec: null,
+        productNum: null,
+        salePrice: null,
+        userAddress: null,
+        productId: null,
+        costPrice: null,
+        supplierName: null,
+        orderStartTime: null,
+        orderEndTime: null,
         status: null,
       },
-      orderOptions:[],
-      actName:"10",
-      show:{
-        title:"订单详情",
-        open:false,
+      orderOptions: [],
+      actName: "10",
+      show: {
+        title: "订单详情",
+        open: false,
       },
-
-      // 部门树选项
-      deptOptions: undefined,
-      deptName: undefined,
     };
   },
-  watch: {
-    // 根据名称筛选部门树
-    deptName(val) {
-      this.$refs.tree.filter(val);
-    },
-  },
   created() {
-    this.getTreeselect();
+    getCompanyList().then(response => {
+      this.companys = response.data;
+      if(this.companys != null && this.companys.length > 0){
+        this.companyId = this.companys[0].companyId;
+        this.getTreeselect();
+      }
+    });
     this.queryParams.liveId = this.$route.query.liveId
     this.getList();
     this.getDicts("sys_live_order_status").then(response => {
       this.orderStatusOptions = response.data;
+      this.orderOptions = this.orderStatusOptions;
+    });
+    // this.getDicts("sys_order_status").then(response => {
+    //   this.orderOptions = response.data;
+    // });
+    this.getDicts("sys_user_level").then(response => {
+      this.memberLevelOptions = response.data;
     });
-    this.getDicts("sys_order_status").then(response => {
-      this.orderOptions = response.data;
+    this.getDicts("sys_customer_status").then(response => {
+      this.customerStatusOptions = response.data;
     });
   },
   methods: {
-    // 查看详情
-    getTreeselect() {
-      treeselect().then((response) => {
-        this.deptOptions = response.data;
-      });
+    parseTime,
+    formatDateTime(isoString) {
+      const date = new Date(isoString); // 解析原始时间字符串
+
+      // 获取年、月、日(月份从0开始,需+1)
+      const year = date.getFullYear();
+      const month = String(date.getMonth() + 1).padStart(2, '0'); // 补0至2位
+      const day = String(date.getDate()).padStart(2, '0');
+
+      // 获取时、分、秒
+      const hours = String(date.getHours()).padStart(2, '0');
+      const minutes = String(date.getMinutes()).padStart(2, '0');
+      const seconds = String(date.getSeconds()).padStart(2, '0');
+
+      // 拼接为目标格式
+      return `${year}-${month}-${day} ${hours}-${minutes}-${seconds}`;
+    },
+
+
+// 下单时间范围选择变化处理
+    handleOrderTimeChange(value) {
+      if (value && value.length === 2) {
+        this.queryParams.createTimeStart = value[0];
+        this.queryParams.createTimeEnd = value[1];
+      } else {
+        this.queryParams.createTimeStart = null;
+        this.queryParams.createTimeEnd = null;
+      }
     },
+
+    // 查看详情
     handledetails(row){
-      this.show.open=true;
+      this.show.open = true;
       setTimeout(() => {
-        this.$refs.Details.getDetails(row.orderId,row.nickName,row.storeName);
+        this.$refs.Details.getDetails(row.orderId, row.nickName, row.storeName);
       }, 1);
     },
+
     // 订单tab切换
-    handleClickX(tab, event) {
+    handleClickX(tab) {
       this.orderStatus = tab.name;
-      if(tab.name=="10"){
-        this.queryParams.status=null;
-      }else{
-        this.queryParams.status=tab.name;
+      if(tab.name == "10"){
+        this.queryParams.status = null;
+      } else {
+        this.queryParams.status = tab.name;
       }
       this.handleQuery();
     },
+
     /** 查询订单列表 */
     getList() {
       this.loading = true;
-      listLiveOrder(this.queryParams).then(response => {
+      listLiveOrderZm(this.queryParams).then(response => {
         this.liveOrderList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
+
     orderStatusFormatter(row, column) {
       return this.selectDictLabel(this.orderStatusOptions, row.status);
     },
+
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.getList();
     },
+
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      // 同时清空范围选择器的值
+      this.orderTimeRange = [];
+      // 清空时间范围参数
+      this.queryParams.orderStartTime = null;
+      this.queryParams.orderEndTime = null;
       this.handleQuery();
     },
+
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.orderId)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
+
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有订单数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportLiveOrder(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
-    }
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportLiveOrderZm(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    },
+
+    getTreeselect() {
+      var param = {companyId: this.companyId}
+      treeselect(param).then((response) => {
+        this.deptOptions = response.data;
+        if(response.data != null && response.data.length > 0){
+          // this.queryParams.deptId = response.data[0].id;
+        }
+      });
+    },
+
+    companyChange(val){
+      this.companyId = val;
+      this.getTreeselect();
+    },
+
+    currDeptChange(val){
+      this.queryParams.deptId = val;
+      this.getList();
+    },
   }
 };
 </script>

+ 2 - 2
src/views/live/liveOrder/liveOrderDetails.vue

@@ -6,7 +6,7 @@
     <div class="contentx" v-if="item!=null">
       <div class="desct"></div>
       <div class="order-status" v-if="item!=null" >
-        <el-steps  :active="item.status==4?item.status:item.status" align-center finish-status="success">
+        <el-steps  :active="item.status+1" align-center>
           <el-step title="待支付"></el-step>
           <el-step title="待发货"></el-step>
           <el-step title="待收货"></el-step>
@@ -378,7 +378,7 @@ export default {
     this.getDicts("sys_store_pay_type").then(response => {
       this.PayOptions = response.data;
     });
-    this.getDicts("sys_order_status").then(response => {
+    this.getDicts("sys_live_order_status").then(response => {
       this.orderOptions = response.data;
     });
     this.getDicts("sys_order_pay").then(response => {

+ 67 - 16
src/views/qw/sopTemp/updateSopTemp.vue

@@ -89,7 +89,7 @@
                                       v-model="content.time"
                                       value-format="HH:mm"
                                       format="HH:mm"
-                                      :picker-options="{ selectableRange: startTimeRange }"
+                                      :picker-options="{ selectableRange: ['01:00:00 - 01:59:00','05:00:00 - 23:59:59'] }"
                                       placeholder="时间"
                                       style="width: 100px;height: 20px;">
                                     </el-time-picker>
@@ -101,7 +101,7 @@
                                       :disabled="formType == 3 || !roles.includes('update_sop_temp_time')"
                                       class="custom-input"
                                       v-model="content.time"
-                                      :picker-options="{ selectableRange: startTimeRange }"
+                                      :picker-options="{ selectableRange: ['00:01:00 - 00:59:00','05:00:00 - 23:59:59']}"
                                       value-format="HH:mm"
                                       format="HH:mm"
                                       placeholder="时间"
@@ -402,6 +402,37 @@
                                               </el-form-item>
                                             </el-card>
                                           </div>
+                                          <div v-if="setList.contentType == 12">
+                                            <!--                                           <div >-->
+                                            <el-card class="box-card">
+                                              <el-form-item label="直播间" >
+                                                <el-select  v-model="setList.liveId"
+                                                            placeholder="请选择直播间" size="mini"
+                                                            @change="liveChange(setList)" >
+                                                  <el-option
+                                                    v-for="dict in liveList"
+                                                    :key="dict.liveId"
+                                                    :label="dict.liveName"
+                                                    :value="dict.liveId"
+                                                  />
+                                                </el-select>
+                                              </el-form-item>
+
+                                              <el-form-item label="标题" prop="miniprogramTitle">
+                                                <el-input v-model="setList.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
+                                                          type="textarea" @input="checkByteLength(content,setList.contentType,content.isOfficial)"   />
+                                              </el-form-item>
+                                              <el-form-item label="封面" prop="miniprogramPicUrl">
+                                                <ImageUpload v-model="setList.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                                              </el-form-item>
+                                              <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
+                                                <el-input v-model="setList.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                                              </el-form-item>
+                                              <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
+                                                <el-input v-model="setList.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
+                                              </el-form-item>
+                                            </el-card>
+                                          </div>
 
 
                                           <div v-if="setList.contentType == 5 ">
@@ -697,6 +728,7 @@ import {
   delRules
 } from "@/api/qw/sopTemp";
 import {courseList, videoList} from "@/api/qw/sop";
+import {listToLiveNoEnd} from "@/api/live/live";
 import ImageUpload from "@/views/qw/sop/ImageUpload";
 import userVideo from "@/views/qw/userVideo/userVideo.vue";
 import {
@@ -734,7 +766,7 @@ export default {
       dayList: [],
       ruleList: [],
       ids: [],
-      startTimeRange: [],
+      // startTimeRange: [],
       courseTypeList: ['1','2', '4','5','6', '7','8','9','10'],
       sysFsSopWatchStatus: [],
       //消息内容类型 企微版
@@ -805,7 +837,8 @@ export default {
         gap: [
           {required: true, message: '间隔天数不能为空', trigger: 'blur'}
         ],
-      }
+      },
+      liveList: [],
     };
   },
   created() {
@@ -818,9 +851,9 @@ export default {
     this.getDicts("sys_fs_sop_watch_status").then(response => {
       this.sysFsSopWatchStatus = response.data;
     });
-    getSelectableRange().then(e => {
-      this.startTimeRange = e.data;
-    })
+    // getSelectableRange().then(e => {
+    //   this.startTimeRange = e.data;
+    // })
 
     this.getDicts("sys_qwSop_contentType").then(response => {
       this.sysQwSopContentType = response.data;
@@ -838,6 +871,10 @@ export default {
       this.courseList = response.list;
     });
 
+    listToLiveNoEnd().then(response => {
+      this.liveList = response.rows;
+    })
+
     const id = this.$route.params && this.$route.params.id;
     this.id = id;
     this.formType = this.$route.params && this.$route.params.type;
@@ -845,6 +882,20 @@ export default {
     this.handleUpdate(id);
   },
   methods: {
+    liveChange(content) {
+      // content.liveId 是选中的直播间 ID(liveId)
+      const selectedLive = this.liveList.find(live => live.liveId === content.liveId);
+      if (selectedLive) {
+        // 从选中的直播间对象中提取标题和封面,赋值给当前内容的对应字段
+        // 假设直播间对象中标题字段为 liveTitle,封面字段为 coverImg(根据实际接口字段调整)
+        content.miniprogramTitle = selectedLive.liveName || ''; // 自动填充标题
+        content.miniprogramPicUrl = selectedLive.liveImgUrl || ''; // 自动填充封面
+      } else {
+        // 若未找到对应直播间,清空标题和封面(可选)
+        content.miniprogramTitle = '';
+        content.miniprogramPicUrl = '';
+      }
+    },
     handleClose(index, tag, content) {
       content.addTag.splice(content.addTag.indexOf(tag), 1);
     },
@@ -1003,12 +1054,12 @@ export default {
             this.loading = false;
           }
         }
-        
+
         // 预加载下一个tab的数据
         this.preloadNextTab(index);
       }
     },
-    
+
     // 应用缓存数据到tab
     applyCachedData(index, newData) {
       const cachedData = this.tabCache[newData.id];
@@ -1045,7 +1096,7 @@ export default {
         }
       });
     },
-    
+
     // 应用新获取的数据到tab
     applyDataToTab(index, newData, data) {
       this.$nextTick(() => {
@@ -1081,7 +1132,7 @@ export default {
         }
       });
     },
-    
+
     // 预加载下一个tab的数据
     async preloadNextTab(currentIndex) {
       const nextIndex = parseInt(currentIndex) + 1;
@@ -1089,21 +1140,21 @@ export default {
       if (nextIndex >= this.setting.length) {
         return;
       }
-      
+
       const nextTabData = this.setting[nextIndex];
       // 只预加载已存在的tab(有id的),跳过新建的tab
       if (!nextTabData.id || !nextTabData.dayNum) {
         return;
       }
-      
+
       // 如果已经加载过或正在加载,则跳过
       if (this.loadedTabs.has(nextIndex) || this.loadingTabs.has(nextIndex) || this.tabCache[nextTabData.id]) {
         return;
       }
-      
+
       // 标记为正在加载
       this.loadingTabs.add(nextIndex);
-      
+
       try {
         const res = await selectRulesInfo(nextTabData.id);
         // 缓存数据
@@ -1177,7 +1228,7 @@ export default {
           ...this.setting[this.tabIndex],
           id: e.data.id,
         });
-        
+
         // 更新缓存中的数据
         const currentTabId = this.setting[this.tabIndex].id;
         if (currentTabId) {

+ 318 - 222
src/views/qw/sopUserLogs/sopUserLogsSchedule.vue

@@ -2,9 +2,10 @@
   <div class="app-container">
     <div style="margin-bottom: 10px">
       <el-card>
-        <span class="custom-style" style="display: block; margin-bottom: 10px">自动化规则名称:{{sopName}}</span>
-        <span class="custom-style" style="display: block; margin-bottom: 10px">自动化规则编号:{{queryParams.sopId}}</span>
-        <span class="custom-style" style="display: block;">模板编号:{{tempId}}</span>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">自动化规则名称:{{ sopName }}</span>
+        <span class="custom-style" style="display: block; margin-bottom: 10px"
+        >自动化规则编号:{{ queryParams.sopId }}</span>
+        <span class="custom-style" style="display: block;">模板编号:{{ tempId }}</span>
       </el-card>
     </div>
 
@@ -32,19 +33,20 @@
                         v-model="queryParams.startTime"
                         type="date"
                         value-format="yyyy-MM-dd"
-                        placeholder="选择营期时间">
+                        placeholder="选择营期时间"
+        >
         </el-date-picker>
       </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 sopUserLogsDelStatus"-->
-<!--            :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 sopUserLogsDelStatus"-->
+      <!--            :key="dict.dictValue"-->
+      <!--            :label="dict.dictLabel"-->
+      <!--            :value="dict.dictValue"-->
+      <!--          />-->
+      <!--        </el-select>-->
+      <!--      </el-form-item>-->
       <el-form-item label="客户名称" prop="externalUserName">
         <el-input
           v-model="queryParams.externalUserName"
@@ -72,7 +74,9 @@
     <el-row :gutter="10" class="mb8" v-if="filterMode == 1">
 
       <el-col :span="1.5">
-        <el-tooltip class="item" effect="dark" content="此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】" placement="top">
+        <el-tooltip class="item" effect="dark"
+                    content="此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】" placement="top"
+        >
           <el-button
             type="warning"
             icon="el-icon-s-promotion"
@@ -80,24 +84,27 @@
             :disabled="multiple"
             @click="handleCampSendMsg"
             v-hasPermi="['qw:sopUserLogsInfo:msgSchedule']"
-          >营期一键群发(或草稿)</el-button>
+          >营期一键群发(或草稿)
+          </el-button>
         </el-tooltip>
       </el-col>
 
-<!--      <el-col :span="1.5">-->
-<!--        <el-tooltip class="item" effect="dark" content="修改选择的群聊营期时间" placement="top">-->
-<!--          <el-button-->
-<!--            type="danger"-->
-<!--            icon="el-icon-edit"-->
-<!--            size="medium"-->
-<!--            :disabled="multiple"-->
-<!--            @click="updateGroupTime"-->
-<!--          >批量修改营期时间</el-button>-->
-<!--        </el-tooltip>-->
-<!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-tooltip class="item" effect="dark" content="修改选择的群聊营期时间" placement="top">-->
+      <!--          <el-button-->
+      <!--            type="danger"-->
+      <!--            icon="el-icon-edit"-->
+      <!--            size="medium"-->
+      <!--            :disabled="multiple"-->
+      <!--            @click="updateGroupTime"-->
+      <!--          >批量修改营期时间</el-button>-->
+      <!--        </el-tooltip>-->
+      <!--      </el-col>-->
 
       <el-col :span="1.5">
-        <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的客户发送消息,ps:删除之后不可恢复" placement="top">
+        <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的客户发送消息,ps:删除之后不可恢复"
+                    placement="top"
+        >
           <el-button
             type="danger"
             icon="el-icon-s-promotion"
@@ -105,7 +112,8 @@
             :disabled="multiple"
             @click="handleDeleteUserLogs"
             v-hasPermi="['qw:sopUserLogs:remove']"
-          >批量删除营期</el-button>
+          >批量删除营期
+          </el-button>
 
         </el-tooltip>
       </el-col>
@@ -119,7 +127,8 @@
             icon="el-icon-plus"
             size="medium"
             @click="addGroup"
-          >追加群聊</el-button>
+          >追加群聊
+          </el-button>
         </el-tooltip>
       </el-col>
 
@@ -131,11 +140,14 @@
             size="medium"
             :disabled="multiple"
             @click="updateGroupTime"
-          >批量修改营期时间</el-button>
+          >批量修改营期时间
+          </el-button>
         </el-tooltip>
       </el-col>
       <el-col :span="1.5">
-        <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的群发送消息,ps:删除之后不可恢复" placement="top">
+        <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的群发送消息,ps:删除之后不可恢复"
+                    placement="top"
+        >
           <el-button
             type="danger"
             icon="el-icon-s-promotion"
@@ -143,47 +155,55 @@
             :disabled="multiple"
             @click="handleDeleteUserLogs"
             v-hasPermi="['qw:sopUserLogs:remove']"
-          >批量删除营期</el-button>
+          >批量删除营期
+          </el-button>
         </el-tooltip>
       </el-col>
-                  <el-col :span="1.5">
-        <el-tooltip class="item" effect="dark" content="批量更换实际发送人" placement="top" >
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="批量更换实际发送人" placement="top">
           <el-button
             type="primary"
             icon="el-icon-s-custom"
             size="medium"
             :disabled="multiple"
             @click="handleUpdateSender"
-          >批量更换实际发送人</el-button>
+          >批量更换实际发送人
+          </el-button>
         </el-tooltip>
       </el-col>
     </el-row>
-    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px"
+         v-if="filterMode == 1"
+    >
       <i class="el-icon-info"></i>
       【营期一键群发】:此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】
     </div>
-    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px"
+         v-if="filterMode == 1"
+    >
       <i class="el-icon-info"></i>
       【批量删除营期】:此功能用于删除选中的【整个营期】,删除之后将不会在给原营期的客户发送消息,ps:删除之后不可恢复
     </div>
-    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px"
+         v-if="filterMode == 1"
+    >
       <i class="el-icon-info"></i>
       【天数】:【列表:营期时间】对应列表中的天数是几 就代表着 插件助手 会发送【任务模板】里的第几天的消息
     </div>
     <el-table border v-loading="loading" :data="sopUserLogsList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="营期编号" align="center" prop="id" />
-      <el-table-column label="企微员工账号" align="center" prop="qwUserId" />
-      <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
-      <el-table-column label="实际发送人" align="center" prop="actualQwUserName" />
-      <el-table-column label="群聊" align="center" prop="chatName" v-if="filterMode == 2" />
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="营期编号" align="center" prop="id"/>
+      <el-table-column label="企微员工账号" align="center" prop="qwUserId"/>
+      <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
+      <el-table-column label="实际发送人" align="center" prop="actualQwUserName"/>
+      <el-table-column label="群聊" align="center" prop="chatName" v-if="filterMode == 2"/>
       <el-table-column label="营期时间" align="center" prop="startTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="天数" align="center" prop="countDays" />
-      <el-table-column label="状态" align="center" prop="status" >
+      <el-table-column label="天数" align="center" prop="countDays"/>
+      <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
           <div v-if="scope.row.userId && scope.row.userId.includes('null')">
             <span style="color: orange;">营期异常</span>
@@ -204,7 +224,8 @@
             icon="el-icon-edit"
             @click="handleSelect(scope.row)"
             v-hasPermi="['qw:sop:list']"
-          >营期详情</el-button>
+          >营期详情
+          </el-button>
           <el-button
             v-if="scope.row.userId && scope.row.userId.includes('null')"
             size="mini"
@@ -212,7 +233,8 @@
             icon="el-icon-s-check"
             @click="handleRepairLogs(scope.row)"
             v-hasPermi="['qw:sop:list']"
-          >修复营期</el-button>
+          >修复营期
+          </el-button>
           <!--          <el-button-->
           <!--            size="mini"-->
           <!--            type="text"-->
@@ -222,6 +244,17 @@
         </template>
       </el-table-column>
 
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="filterMode == 2">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="getLink(scope.row)"
+          >获取当天群链接
+          </el-button>
+        </template>
+      </el-table-column>
+
     </el-table>
 
     <pagination
@@ -234,15 +267,19 @@
 
 
     <!--  执行详情  -->
-    <el-drawer :title="logsInfoDetailsOpen.title" :visible.sync="logsInfoDetailsOpen.open" size="88%" style="font-weight: bolder">
-      <sop-user-logs-info-details ref="SopUserLogsInfoDetails" :rowDetailFrom="logsInfoDetailsOpen.item" @flashNotify="flashNotify"></sop-user-logs-info-details>
+    <el-drawer :title="logsInfoDetailsOpen.title" :visible.sync="logsInfoDetailsOpen.open" size="88%"
+               style="font-weight: bolder"
+    >
+      <sop-user-logs-info-details ref="SopUserLogsInfoDetails" :rowDetailFrom="logsInfoDetailsOpen.item"
+                                  @flashNotify="flashNotify"
+      ></sop-user-logs-info-details>
     </el-drawer>
 
-    <send-msg-open-tool ref="sendMsgOpenTool" ></send-msg-open-tool>
-    <el-dialog title="修改营期时间" :visible.sync="updateTimeData.open"  width="800px" append-to-body>
+    <send-msg-open-tool ref="sendMsgOpenTool"></send-msg-open-tool>
+    <el-dialog title="修改营期时间" :visible.sync="updateTimeData.open" width="800px" append-to-body>
       <p>
         <span>选择群聊:</span>
-        <el-tag v-for="name in chatNames">{{name}}</el-tag>
+        <el-tag v-for="name in chatNames">{{ name }}</el-tag>
       </p>
       <el-form ref="msgForm" :model="updateTimeData.form" label-width="100px">
         <el-form-item label="日期">
@@ -250,7 +287,8 @@
             v-model="updateTimeData.form.date"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择日期">
+            placeholder="选择日期"
+          >
           </el-date-picker>
         </el-form-item>
       </el-form>
@@ -259,15 +297,15 @@
         <el-button @click="updateTimeData.open = false">取 消</el-button>
       </div>
     </el-dialog>
-    <el-dialog title="选择企微" :visible.sync="addGroupData.userOpen" width="1300px"   append-to-body>
+    <el-dialog title="选择企微" :visible.sync="addGroupData.userOpen" width="1300px" append-to-body>
       <qwUserList ref="QwUserList" @selectUserList="selectUserList"></qwUserList>
     </el-dialog>
 
-        <el-dialog :title="listUser.title" :visible.sync="listUser.open" width="1300px"   append-to-body>
+    <el-dialog :title="listUser.title" :visible.sync="listUser.open" width="1300px" append-to-body>
       <qwUserSelectOne ref="QwUserListSender" @selectUser="selectSenderSingle"></qwUserSelectOne>
     </el-dialog>
 
-    <el-dialog title="追加群聊" :visible.sync="addGroupData.open"  width="800px" append-to-body>
+    <el-dialog title="追加群聊" :visible.sync="addGroupData.open" width="800px" append-to-body>
       <el-form ref="msgForm" :model="addGroupData.form" label-width="100px">
         <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%">
           <div>
@@ -275,7 +313,9 @@
               size="medium"
               icon="el-icon-circle-plus-outline"
               plain
-              @click="handleCompanyUser">请选择使用员工</el-button>
+              @click="handleCompanyUser"
+            >请选择使用员工
+            </el-button>
           </div>
           <div>
             <el-tag
@@ -285,14 +325,18 @@
               v-for="id in userSelectList"
               closable
               :disable-transitions="false"
-              @close="handleClosegroupUser(id)">
-              <span v-for="list in companyUserLists " :key="list.userId" v-if="list.id == id">{{list.qwUserName}}</span>
+              @close="handleClosegroupUser(id)"
+            >
+              <span v-for="list in companyUserLists " :key="list.userId" v-if="list.id == id"
+              >{{ list.qwUserName }}</span>
             </el-tag>
           </div>
         </el-form-item>
         <el-form-item label="群聊">
           <el-select multiple filterable clearable v-model="addGroupData.form.chatIds">
-            <el-option v-for="item in addGroupData.selectChat" :key="item.chatId" :label="item.name" :value="item.chatId"/>
+            <el-option v-for="item in addGroupData.selectChat" :key="item.chatId" :label="item.name"
+                       :value="item.chatId"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="日期">
@@ -300,7 +344,8 @@
             v-model="addGroupData.form.date"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择日期">
+            placeholder="选择日期"
+          >
           </el-date-picker>
         </el-form-item>
       </el-form>
@@ -309,6 +354,29 @@
         <el-button @click="addGroupData.open = false">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title="链接" :visible.sync="mini.open" width="800px" append-to-body>
+
+      <el-form ref="msgForm" :model="addGroupData.form" label-width="100px">
+        <el-form-item label="小程序" prop="qwUserIds" style="margin-top: 2%">
+          <el-select v-model="mini.appId" placeholder="选择小程序" size="small">
+            <el-option
+              v-for="miniApp in companyMiniAppList"
+              :key="miniApp.appid"
+              :label="miniApp.name"
+              :value="miniApp.appid"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="链接" prop="qwUserIds" style="margin-top: 2%" :loading="mini.loading">
+          {{ mini.link || "无" }}
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="genMiniLink">生 成</el-button>
+        <el-button @click="mini.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -318,37 +386,46 @@ import {
   exportSopUserLogs,
   listSopUserLogs,
   repairSopUserLogs,
+  getShortLink,
   getSelectChat,
   addGroupChat,
-  updateLogDate,UpdateTimeSopUserLogs,replaceUser
-} from "../../../api/qw/sopUserLogs";
-import sopLogsDetails from "@/views/qw/sopLogs/sopLogsList.vue";
-import SopUserLogsInfoDetails from "@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue";
-import sendMsgOpenTool from "../../../views/qw/sopUserLogsInfo/sendMsgOpenTool.vue";
-import {listAll as chatListAll} from "@/api/qw/groupChat";
-import companyUserList from "@/views/company/companyUser/companyUserList.vue";
-import qwUserList from "@/views/qw/user/qwUserList.vue";
-import qwUserSelectOne from "@/views/qw/user/qwUserSelectOne.vue";
-import {getQwAllUserList, listUser} from "@/api/company/companyUser";
+  updateLogDate, UpdateTimeSopUserLogs, replaceUser
+} from '@/api/qw/sopUserLogs'
+import {
+  getCompanyMiniAppList
+} from '@/api/company/companyConfig'
+import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
+import SopUserLogsInfoDetails from '@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue'
+import sendMsgOpenTool from '../../../views/qw/sopUserLogsInfo/sendMsgOpenTool.vue'
+import { listAll as chatListAll } from '@/api/qw/groupChat'
+import companyUserList from '@/views/company/companyUser/companyUserList.vue'
+import qwUserList from '@/views/qw/user/qwUserList.vue'
+import qwUserSelectOne from '@/views/qw/user/qwUserSelectOne.vue'
+import { getQwAllUserList, listUser } from '@/api/company/companyUser'
 
 export default {
-  name: "sopUserLogsSchedule",
-  components: {qwUserList, qwUserSelectOne, companyUserList, SopUserLogsInfoDetails, sopLogsDetails,sendMsgOpenTool},
-  props:{
-    rowDetailFrom:{},
+  name: 'sopUserLogsSchedule',
+  components: { qwUserList, qwUserSelectOne, companyUserList, SopUserLogsInfoDetails, sopLogsDetails, sendMsgOpenTool },
+  props: {
+    rowDetailFrom: {}
   },
 
   data() {
     return {
       qwUserIds: [],
-      sopUserLogId:null,
-      companyUserLists:[],
-      sopName:'',
-      tempId:'',
+      sopUserLogId: null,
+      companyUserLists: [],
+      sopName: '',
+      tempId: '',
       listUser: {
         title: '选择发送人',
         open: false
       },
+      mini: {
+        open: false,
+        loading: false,
+        row: {},
+      },
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -366,17 +443,17 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
-      logsInfoDetailsOpen:{
-        title:"",
-        open:false,
+      logsInfoDetailsOpen: {
+        title: '',
+        open: false
       },
-      sysQwSopAiContentType:[],
-      userSelectList:[],
+      sysQwSopAiContentType: [],
+      userSelectList: [],
       // sopUserLogs表格数据
       sopUserLogsList: [],
-      sopUserLogsDelStatus:[],
+      sopUserLogsDelStatus: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -385,22 +462,22 @@ export default {
         userOpen: false,
         selectChat: [],
         form: {
-          chatIds: [],
-        },
+          chatIds: []
+        }
       },
       updateTimeData: {
         open: false,
         form: {
-          date: null,
-        },
+          date: null
+        }
       },
       queryParams: {
         pageNum: 1,
         pageSize: 10,
         sopId: null,
-        userLogsId:null,
-        externalUserName:null,
-        externalId:null,
+        userLogsId: null,
+        externalUserName: null,
+        externalId: null,
         sopTempId: null,
         qwUserId: null,
         qwUserName: null,
@@ -408,85 +485,103 @@ export default {
         startTime: null,
         status: null,
         userId: null,
-        type:null,
+        type: null
       },
-      sendMsgOpen:{
-        title:'营期一键批量群发',
-        open:false,
-        ids:null,
+      sendMsgOpen: {
+        title: '营期一键批量群发',
+        open: false,
+        ids: null
       },
-      setting:[],
+      setting: [],
+      companyMiniAppList: [],
       // 表单参数
       form: {},
       tempForm: {
-        setting:null,
-        videoIdSet:null,
-        courseIdSet:null,
+        setting: null,
+        videoIdSet: null,
+        courseIdSet: null
       },
       // 表单校验
-      rules: {
-      }
-    };
+      rules: {}
+    }
   },
   created() {
 
-    this.getDicts("sys_company_status").then(response => {
-      this.statusOptions = response.data;
-    });
-
-    this.getDicts("sop_user_logs_del_status").then(response => {
-      this.sopUserLogsDelStatus = response.data;
-    });
-    this.getDicts("sys_qwSopAi_contentType").then(response => {
-      this.sysQwSopAiContentType = response.data;
-    });
-    this.queryParams.sopId = this.$route.params.id;
-    this.sopName = this.$route.query.name;
-    this.filterMode = this.$route.query.filterMode;
-    this.tempId = this.$route.query.tempId;
-    this.queryParams.corpId= this.$route.query.corpId;
-    this.queryParams.type= this.$route.query.type;
+    this.getDicts('sys_company_status').then(response => {
+      this.statusOptions = response.data
+    })
+
+    this.getDicts('sop_user_logs_del_status').then(response => {
+      this.sopUserLogsDelStatus = response.data
+    })
+    this.getDicts('sys_qwSopAi_contentType').then(response => {
+      this.sysQwSopAiContentType = response.data
+    })
+    this.queryParams.sopId = this.$route.params.id
+    this.sopName = this.$route.query.name
+    this.filterMode = this.$route.query.filterMode
+    this.tempId = this.$route.query.tempId
+    this.queryParams.corpId = this.$route.query.corpId
+    this.queryParams.type = this.$route.query.type
     getQwAllUserList(this.queryParams.corpId).then(response => {
-      this.companyUserLists = response.data;
-    });
+      this.companyUserLists = response.data
+    })
     this.getList()
 
   },
   methods: {
-        selectSenderSingle(user){
-      this.listUser.open=false;
-      const data = { ids: this.ids };
+    selectSenderSingle(user) {
+      this.listUser.open = false
+      const data = { ids: this.ids }
       // 仅在选中员工时携带 actualQwUserId 与 actualQwId,否则两字段均不传,后端按清空处理
       if (user && user.qwUserId) {
-        data.actualQwUserId = user.qwUserId;
-        data.actualQwId     = user.id;
+        data.actualQwUserId = user.qwUserId
+        data.actualQwId = user.id
       }
       replaceUser(data).then(res => {
-        this.msgSuccess(user && user.qwUserId ? "修改成功" : "已清空实际发送人");
-        this.getList();
+        this.msgSuccess(user && user.qwUserId ? '修改成功' : '已清空实际发送人')
+        this.getList()
+      })
+    },
+    getLink(row) {
+      getCompanyMiniAppList().then(res => {
+        this.companyMiniAppList = res.data
+        this.mini.open = true;
+        this.mini.row = row;
+      }).catch(res => {
+        console.log(res)
+      })
+    },
+    genMiniLink() {
+      this.mini.loading = true;
+      getShortLink({ id: this.mini.row.id, sopId: this.mini.row.sopId, appId: this.mini.appId }).then(response => {
+        this.mini.link = response.urlLink;
+        this.$forceUpdate();
+      }).finally(e =>{
+        this.mini.loading = false;
       })
     },
     /** 查询sopUserLogs列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listSopUserLogs(this.queryParams).then(response => {
-        this.sopUserLogsList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.sopUserLogsList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
-    addSetList(){
+    addSetList() {
       const newSetting = {
-        contentType:'1',
-        value: '',
-      };
+        contentType: '1',
+        value: ''
+      }
       // 将新设置项添加到 content.setting 数组中
-      this.setting.push(newSetting);
+      this.setting.push(newSetting)
 
     },
     // 表单重置
@@ -496,189 +591,190 @@ export default {
         sopId: null,
         sopTempId: null,
         qwUserId: null,
-        externalId:null,
+        externalId: null,
         corpId: null,
         startTime: null,
         status: 0,
         userId: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
 
     /**
      * 营期一键群发
      */
-    handleCampSendMsg(){
+    handleCampSendMsg() {
 
       setTimeout(() => {
-        this.$refs.sendMsgOpenTool.oneClickGroupSending(this.ids,2,this.queryParams.corpId);
-      }, 500);
+        this.$refs.sendMsgOpenTool.oneClickGroupSending(this.ids, 2, this.queryParams.corpId)
+      }, 500)
 
     },
 
-        /**
+    /**
      * 批量更换实际发送人
      */
     handleUpdateSender() {
-      this.listUser.open = true;
+      this.listUser.open = true
       this.$nextTick(() => {
-        this.$refs.QwUserListSender.getDetails(this.queryParams.corpId);
+        this.$refs.QwUserListSender.getDetails(this.queryParams.corpId)
       })
     },
     /**
      *  删除营期
      */
-    handleDeleteUserLogs(){
-      const ids =  this.ids;
-      this.$confirm('是否确认删除编号为"' + ids + '"的数据项【注意!!删除后不可恢复,请谨慎操作】?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+    handleDeleteUserLogs() {
+      const ids = this.ids
+      this.$confirm('是否确认删除编号为"' + ids + '"的数据项【注意!!删除后不可恢复,请谨慎操作】?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       }).then(function() {
-        return delSopUserLogs(ids);
+        return delSopUserLogs(ids)
       }).then(() => {
-        this.getList();
-        this.msgSuccess("删除成功");
-      }).catch(() => {});
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(() => {
+      })
     },
 
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
 
-    flashNotify(){
-      this.getList();
+    flashNotify() {
+      this.getList()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      if(this.filterMode == 2){
-        this.chatNames = selection.map(item => item.chatName);
+      if (this.filterMode == 2) {
+        this.chatNames = selection.map(item => item.chatName)
       }
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
 
-    handleSelect(val){
-      val.filterMode = this.filterMode;
-      this.logsInfoDetailsOpen.title='企微账号:'+val.qwUserId+'  '+'营期时间:'+val.startTime+'  '+'天数:' + val.countDays;
-      this.logsInfoDetailsOpen.open=true;
-      const externalUserName = this.queryParams.externalUserName;
+    handleSelect(val) {
+      val.filterMode = this.filterMode
+      this.logsInfoDetailsOpen.title = '企微账号:' + val.qwUserId + '  ' + '营期时间:' + val.startTime + '  ' + '天数:' + val.countDays
+      this.logsInfoDetailsOpen.open = true
+      const externalUserName = this.queryParams.externalUserName
       setTimeout(() => {
-        this.$refs.SopUserLogsInfoDetails.selectSopUserLogsInfo(val, externalUserName);
-      }, 500);
+        this.$refs.SopUserLogsInfoDetails.selectSopUserLogsInfo(val, externalUserName)
+      }, 500)
 
     },
 
     handleRepairLogs(val) {
-      this.loading = true;
+      this.loading = true
       let loadingRock = this.$loading({
         lock: true,
         text: '正在修复中请稍后~~!!',
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
-      });
+      })
 
       repairSopUserLogs(val).then(res => {
-        this.msgSuccess("修复成功成功");
+        this.msgSuccess('修复成功成功')
       }).catch(res => {
       }).finally(res => {
-        loadingRock.close();
-        this.loading = false;
-        this.getList();
+        loadingRock.close()
+        this.loading = false
+        this.getList()
       })
 
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有sopUserLogs数据项?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有sopUserLogs数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       }).then(() => {
-        this.exportLoading = true;
-        return exportSopUserLogs(queryParams);
+        this.exportLoading = true
+        return exportSopUserLogs(queryParams)
       }).then(response => {
-        this.download(response.msg);
-        this.exportLoading = false;
+        this.download(response.msg)
+        this.exportLoading = false
       }).catch(() => {
-      });
+      })
     },
     addGroup() {
-      this.addGroupData.open = true;
-      this.addGroupData.form = {date: new Date(), chatIds: []};
+      this.addGroupData.open = true
+      this.addGroupData.form = { date: new Date(), chatIds: [] }
     },
     updateGroupTime() {
-      this.updateTimeData.open = true;
-      this.updateTimeData.form = {date: new Date()};
+      this.updateTimeData.open = true
+      this.updateTimeData.form = { date: new Date() }
     },
     submitUpdateTimeForm() {
       let form = {
         date: this.updateTimeData.form.date,
-        ids: this.ids,
+        ids: this.ids
       }
       updateLogDate(form).then(response => {
-        if (response.data!=null){
-          this.msgInfo("部分时间已有营期:"+response.data);
+        if (response.data != null) {
+          this.msgInfo('部分时间已有营期:' + response.data)
         }
 
-        this.updateTimeData.open = false;
-        this.getList();
-      });
+        this.updateTimeData.open = false
+        this.getList()
+      })
     },
     submitAddGroupForm() {
       let form = {
         id: this.queryParams.sopId,
         qwUserIds: this.userSelectList.join(),
         chatIds: this.addGroupData.form.chatIds.join(),
-        date: this.addGroupData.form.date,
+        date: this.addGroupData.form.date
       }
       addGroupChat(form).then(e => {
-        this.addGroupData.open = false;
-        this.getList();
-      });
+        this.addGroupData.open = false
+        this.getList()
+      })
     },
     handleCompanyUser() {
       setTimeout(() => {
-        this.$refs.QwUserList.getDetails(this.queryParams.corpId, this.queryParams.type, 2);
-      }, 1);
-      this.addGroupData.userOpen = true;
+        this.$refs.QwUserList.getDetails(this.queryParams.corpId, this.queryParams.type, 2)
+      }, 1)
+      this.addGroupData.userOpen = true
     },
     handleClosegroupUser(list) {
-      const index = this.userSelectList.findIndex(t => t === list);
+      const index = this.userSelectList.findIndex(t => t === list)
       if (index !== -1) {
-        this.userSelectList.splice(index, 1);
-        this.qwUserIds.splice(index, 1);
+        this.userSelectList.splice(index, 1)
+        this.qwUserIds.splice(index, 1)
         this.loadChatList()
       }
     },
     loadChatList() {
       chatListAll(this.qwUserIds.join(), this.queryParams.corpId, this.queryParams.sopId).then(e => {
-        this.addGroupData.selectChat = e.data;
+        this.addGroupData.selectChat = e.data
       })
     },
     selectUserList(list) {
-      this.addGroupData.userOpen = false;
+      this.addGroupData.userOpen = false
       list.forEach(obj => {
         if (!this.userSelectList.some(item => item == obj.id)) {
           console.info(this.userSelectList)
-          this.userSelectList.push(obj.id);
-          this.qwUserIds.push(obj.qwUserId);
+          this.userSelectList.push(obj.id)
+          this.qwUserIds.push(obj.qwUserId)
         }
-      });
+      })
       this.loadChatList()
 
-    },
+    }
   }
-};
+}
 </script>
 
 <style>

+ 53 - 2
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -57,6 +57,37 @@
                       </el-radio-group>
                     </el-form-item>
                     <el-form-item label="内容" style="margin-bottom: 2%" >
+                      <div v-if="item.contentType == 12">
+                        <!--                                           <div >-->
+                        <el-card class="box-card">
+                          <el-form-item label="直播间" >
+                            <el-select  v-model="item.liveId"
+                                        placeholder="请选择直播间" size="mini"
+                                        @change="liveChange(item)" >
+                              <el-option
+                                v-for="dict in liveList"
+                                :key="dict.liveId"
+                                :label="dict.liveName"
+                                :value="dict.liveId"
+                              />
+                            </el-select>
+                          </el-form-item>
+
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
+                                      type="textarea"   />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                          <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
+                            <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                          </el-form-item>
+                          <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
+                            <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
+                          </el-form-item>
+                        </el-card>
+                      </div>
                       <el-input
                         v-if="item.contentType == 1"
                         v-model="item.value"
@@ -191,6 +222,7 @@
                             ></el-image>
 
                           </el-form-item>
+
                           <el-form-item label="简介:" label-width="100px">
                             <el-input type="textarea" :rows="3"
                                       v-model="item.desc"
@@ -204,6 +236,7 @@
                         </el-card>
                       </div>
 
+
                     </el-form-item>
 
                     <el-form-item label="添加短链" v-if="item.contentType == 1 "  >
@@ -274,6 +307,7 @@ import { sendMsgSopType,} from "../../../api/qw/sopUserLogsInfo";
 import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
 import {courseList, videoList} from "@/api/qw/sop";
 import userVideo from "@/views/qw/userVideo/userVideo";
+import {listToLiveNoEnd} from "@/api/live/live";
 
 
 export default {
@@ -372,6 +406,7 @@ export default {
         ],
       },
       msgRules:{},
+      liveList: [],
     };
   },
 
@@ -386,9 +421,26 @@ export default {
     courseList().then(response => {
       this.courseList = response.list;
     });
+
+    listToLiveNoEnd().then(response => {
+      this.liveList = response.rows;
+    })
   },
   methods: {
-
+    liveChange(content) {
+      // content.liveId 是选中的直播间 ID(liveId)
+      const selectedLive = this.liveList.find(live => live.liveId === content.liveId);
+      if (selectedLive) {
+        // 从选中的直播间对象中提取标题和封面,赋值给当前内容的对应字段
+        // 假设直播间对象中标题字段为 liveTitle,封面字段为 coverImg(根据实际接口字段调整)
+        content.miniprogramTitle = selectedLive.liveName || ''; // 自动填充标题
+        content.miniprogramPicUrl = selectedLive.liveImgUrl || ''; // 自动填充封面
+      } else {
+        // 若未找到对应直播间,清空标题和封面(可选)
+        content.miniprogramTitle = '';
+        content.miniprogramPicUrl = '';
+      }
+    },
     qwUserVideoResult(val) {
 
       // 根据选中的内容,将返回的数据更新到相应的表单项
@@ -671,7 +723,6 @@ export default {
     },
 
     handleContentTypeChange() {
-
       //如果是链接的才上
       if (this.msgForm.courseId != null ) {
         const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);

+ 53 - 1
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue

@@ -384,6 +384,37 @@
                         placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
                         @input="handleInputVideoText(item.value,item)"/>
                     </div>
+                    <div v-if="item.contentType == 12">
+                      <!--                                           <div >-->
+                      <el-card class="box-card">
+                        <el-form-item label="直播间" >
+                          <el-select  v-model="item.liveId"
+                                      placeholder="请选择直播间" size="mini"
+                                      @change="liveChange(item)" >
+                            <el-option
+                              v-for="dict in liveList"
+                              :key="dict.liveId"
+                              :label="dict.liveName"
+                              :value="dict.liveId"
+                            />
+                          </el-select>
+                        </el-form-item>
+
+                        <el-form-item label="标题" prop="miniprogramTitle">
+                          <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
+                                    type="textarea"   />
+                        </el-form-item>
+                        <el-form-item label="封面" prop="miniprogramPicUrl">
+                          <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                        </el-form-item>
+                        <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
+                          <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                        </el-form-item>
+                        <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
+                          <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
+                        </el-form-item>
+                      </el-card>
+                    </div>
                     <div v-if="item.contentType == 8">
                       <el-button type="primary"
                                  style="margin-bottom: 1%"
@@ -553,6 +584,7 @@ import {listTag} from "@/api/qw/tag";
 import {searchTags} from "../../../api/qw/tag";
 import userVideo from "@/views/qw/userVideo/userVideo.vue";
 import PaginationMore from "../../../components/PaginationMore/index.vue";
+import {listToLiveNoEnd} from "@/api/live/live";
 
 export default {
   name: "sopUserLogsInfoDetails",
@@ -671,6 +703,7 @@ export default {
         ],
       },
       msgRules:{},
+      liveList: [],
     };
   },
 
@@ -695,9 +728,28 @@ export default {
     courseList().then(response => {
       this.courseList = response.list;
     });
+
+
+    listToLiveNoEnd().then(response => {
+      this.liveList = response.rows;
+    })
+
   },
   methods: {
-
+    liveChange(content) {
+      // content.liveId 是选中的直播间 ID(liveId)
+      const selectedLive = this.liveList.find(live => live.liveId === content.liveId);
+      if (selectedLive) {
+        // 从选中的直播间对象中提取标题和封面,赋值给当前内容的对应字段
+        // 假设直播间对象中标题字段为 liveTitle,封面字段为 coverImg(根据实际接口字段调整)
+        content.miniprogramTitle = selectedLive.liveName || ''; // 自动填充标题
+        content.miniprogramPicUrl = selectedLive.liveImgUrl || ''; // 自动填充封面
+      } else {
+        // 若未找到对应直播间,清空标题和封面(可选)
+        content.miniprogramTitle = '';
+        content.miniprogramPicUrl = '';
+      }
+    },
     selectSopUserLogsInfo(val,externalUserName){
 
       this.loading = true;

+ 243 - 0
src/views/store/collectionSchedule/collection.vue

@@ -0,0 +1,243 @@
+<template>
+    <div class="app-container">
+        <el-form validate-on-rule-change :rules="rules" ref="form" :model="form" label-width="140px">
+            <!-- <el-button v-if="form.id" size="mini" type="text" @click="handleShare" icon="el-icon-coin"
+                v-hasPermi="['hisStore:collection:WxaCodeCollectionUnLimit']">分享
+            </el-button> -->
+            <el-form-item label="信息模板" prop="questionId">
+                <el-select @change="selectQuestion" v-model="form.questionId" placeholder="请选择问答">
+                    <el-option v-for="dict in questionOptions" :key="dict.dictValue" :label="dict.dictLabel"
+                        :value="parseInt(dict.dictValue)" />
+                </el-select>
+            </el-form-item>
+            <div style="margin-bottom: 20px;margin-top: 20px;" v-for="(answer, index) in form.answers">
+                <div style="margin-bottom: 20px;margin-top: 20px;" >
+                    <span style="font-size: 15px;font-weight: bold;    margin-left: 31px">{{ answer.title }}</span>
+                </div>
+                <div style="margin-left: 31px;">
+                    <el-checkbox-group v-model="form.answers[index].value" size="mini">
+                        <el-checkbox v-for="dict in answer.options" :label="dict.value">{{ dict.name }}</el-checkbox>
+                    </el-checkbox-group>
+                    <!-- <el-radio-group :disabled="form.answers[index].flag" v-model="form.answers[index].value">
+                        <el-radio v-for="dict in answer.options" :label="dict.value">{{ dict.name }}</el-radio>
+                    </el-radio-group> -->
+                </div>
+
+            </div>
+            <el-form-item label="用户姓名" prop="userName">
+                <el-input v-model="form.userName" placeholder="请输入用户姓名"></el-input>
+            </el-form-item>
+            <el-form-item label="用户手机号后四位" prop="userPhoneFour">
+                <el-input v-model="form.userPhoneFour" placeholder="请输入手机号后四位"></el-input>
+            </el-form-item>
+            <el-form-item label="用户性别" prop="sex">
+                <el-select v-model="form.sex" placeholder="请选择用户性别">
+                    <el-option label="男" :value="1" />
+                    <el-option label="女" :value="0" />
+                </el-select>
+            </el-form-item>
+            
+            <el-form-item label="过敏情况" prop="allergy">
+                <el-input type="textarea" :rows="2" placeholder="请输入过敏情况" v-model="form.allergy">
+                </el-input>
+            </el-form-item>
+            <el-form-item label="备注" prop="remark">
+                <el-input type="textarea" :rows="2" placeholder="请输入备注" v-model="form.remark">
+                </el-input>
+            </el-form-item>
+            <el-form-item v-if="form.questionId" label="是否关联产品疗法" prop="isPackage">
+                <el-radio-group v-model="form.isPackage">
+                    <el-radio :label="0">否</el-radio>
+                    <el-radio :label="1">是</el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item v-if="form.isPackage == 1" label="产品疗法" prop="packageId">
+                <el-select filterable v-model="form.packageId" placeholder="请选择产品疗法">
+                    <el-option v-for="dict in privatePackageOptions" :key="dict.dictValue" :label="dict.dictLabel"
+                        :value="parseInt(dict.dictValue)" />
+                </el-select>
+            </el-form-item>
+            <el-form-item v-if="form.packageId && form.isPackage && form.isPackage == 1" label="支付类型" prop="payType">
+                <el-radio-group v-model="form.payType">
+                    <el-radio :label="1">全款</el-radio>
+                    <el-radio :label="2">物流代收</el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item v-if="form.packageId && form.payType == 2 && form.isPackage && form.isPackage == 1"
+                label="预付金额" prop="amount">
+                <el-input v-model="form.amount" placeholder="请输入物流代收金额" type="number" />
+            </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 :title="collectionForm.title" v-if="collectionForm.open" :visible.sync="collectionForm.open"
+            width="450px" append-to-body>
+            <div style="padding-bottom:15px;">
+                <img :src="codeImage" width="400px">
+            </div>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click="downloadImage(codeImage, collectionForm.name + '.png')">下载二维码</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import { questionOptions, getAnswer } from "@/api/hisStore/answer";
+import { allPrivatePackage } from "@/api/store/package";
+import { getInfo, addCollection, updateCollection, getWxaCodeCollectionUnLimit } from "@/api/hisStore/collection";
+export default {
+    name: "collection",
+    components: {},
+    data() {
+        return {
+            form: {
+                answers: []
+            },
+            userId: null,
+            questionOptions: [],
+            privatePackageOptions: [],
+            collectionForm: {
+                open: false,
+                title: "用户信息采集分享",
+                name: null,
+            },
+            codeImage: null,
+
+            rules: {
+                questionId: [
+                    { required: true, message: '请选择信息模板', trigger: 'change' }
+                ],
+                packageId: [
+                    { required: true, message: '请选择套餐包', trigger: 'change' }
+                ],
+                isPackage: [
+                    { required: true, message: '请选择是否关联套餐包', trigger: 'change' }
+                ],
+                payType: [
+                    { required: true, message: '请选择支付类型', trigger: 'change' }
+                ],
+                amount: [
+                    { required: true, message: '请填写物流代收金额', trigger: 'blur' }
+                ]
+            }
+        };
+    },
+    created() {
+        this.getQuestionOptions();
+        this.getAllPrivatePackge();
+    },
+    methods: {
+        downloadImage(imageSrc, fileName) {
+            const link = document.createElement('a');
+            link.href = imageSrc;
+            link.download = fileName || '付款二维码.png';
+            document.body.appendChild(link);
+            link.click();
+            document.body.removeChild(link);
+        },
+        handleShare(id) {
+            let loadingRock = this.$loading({
+                lock: true,
+                text: '生成二维码中~~请不要刷新页面!!',
+                spinner: 'el-icon-loading',
+                background: 'rgba(0, 0, 0, 0.7)'
+            });
+
+            getWxaCodeCollectionUnLimit(id).then(response => {
+                this.codeImage = response.url
+                this.collectionForm.open = true;
+                this.collectionForm.name = id;
+                loadingRock.close();
+            }).finally(res => {
+                loadingRock.close();
+            })
+        },
+        //获取问答模板
+        getQuestionOptions() {
+            console.log("this.userId", this.userId)
+            questionOptions().then(response => {
+                this.questionOptions = response.rows;
+            })
+        },
+        getAllPrivatePackge() {
+            allPrivatePackage().then(res => {
+                this.privatePackageOptions = res.rows;
+            })
+        },
+        getCollectionInfo(userId) {
+            const queryParams = {
+                userId: userId,
+            }
+            this.userId = userId;
+            getInfo(queryParams).then(res => {
+                if (res.data.id) {
+                    this.form = res.data;
+                } else {
+                    this.form = {
+                        answers: []
+                    }
+                }
+            })
+        },
+        //选择问答模板
+        selectQuestion(val) {
+            console.log(val)
+            this.form = {
+                answers: []
+            };
+            const queryParams = {
+                userId: this.userId,
+                questionId: val
+            }
+            getInfo(queryParams).then(res => {
+                this.form = res.data;
+            })
+            // getAnswer(val).then(response =>{
+
+            //     this.form.answers = response.data.answers;
+            //     console.log(this.form)
+            // })
+        },
+
+        submitForm() {
+            console.log(this.form)
+            this.form.userId = this.userId;
+            this.$refs["form"].validate(valid => {
+                if (valid) {
+                    if (this.form.id != null) {
+                        updateCollection(this.form).then(res => {
+                            this.msgSuccess("修改成功");
+                            this.open = false;
+                            this.$parent.$parent.closeCollection();
+                            this.$refs['form'].resetFields();
+                            this.handleShare(res.data);
+                        })
+
+                    } else {
+                        addCollection(this.form).then(res => {
+                            this.msgSuccess("添加成功");
+                            this.open = false;
+                            this.$parent.$parent.closeCollection();
+                            this.$refs['form'].resetFields();
+                            this.handleShare(res.data);
+                        })
+                    }
+                    // this.resetForm("form");
+                }
+            });
+
+        },
+        cancel() {
+
+        },
+    },
+};
+
+
+
+</script>

+ 357 - 0
src/views/store/collectionSchedule/index.vue

@@ -0,0 +1,357 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="客户姓名" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入客户姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="约诊医生" prop="doctorName">
+        <el-input
+          v-model="queryParams.doctorName"
+          placeholder="请输入约诊医生"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商品名称" prop="packageName">
+        <el-input
+          v-model="queryParams.packageName"
+          placeholder="请输入挂载商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <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="currentStep">
+        <el-select v-model="queryParams.currentStep" placeholder="当前状态" clearable size="small">
+          <el-option
+            v-for="dict in currentStepOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="完成时间" prop="completedTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.completedTime"
+          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-table border v-loading="loading" :data="collectionScheduleList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="客户姓名" align="center" prop="userName" />
+      <el-table-column label="约诊医生" align="center" prop="doctorName" />
+      <el-table-column label="订单号" align="center" prop="orderCode" />
+      <el-table-column label="挂载商品" align="center" prop="packageName" />
+      <el-table-column label="当前状态" align="center" prop="currentStep">
+        <template slot-scope="scope">
+          <el-tag
+            v-if="scope.row.currentStep != null"
+            :type="stepColorMap[scope.row.currentStep] || 'info'"
+            size="small"
+          >
+            {{ getStepLabel(scope.row.currentStep) }}
+          </el-tag>
+          <span v-else>—</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="完成时间" align="center" prop="completedTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.completedTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="中止时间" align="center" prop="terminatedTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.terminatedTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <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-delete"
+            @click="endProcess(scope.row)"
+            v-hasPermi="['his:collectionSchedule:stop']"
+            :disabled="scope.row.status !== 1"
+            :style="{ color: scope.row.status === 1 ? '#f56c6c' : '#999' }"
+          >终止</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="终止进度" :visible.sync="endProcessVisible" width="400px" @close="resetEndForm">
+      <el-form :model="endForm" ref="endFormRef" label-width="80px">
+        <el-form-item label="终止原因" prop="remark" :rules="[{ required: true, message: '请输入终止原因', trigger: 'blur' }]">
+          <el-input
+            v-model="endForm.remark"
+            type="textarea"
+            :rows="4"
+            placeholder="请输入终止原因"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="endProcessVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitEndProcess">确 定</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { listCollectionSchedule, addCollectionSchedule, updateCollectionSchedule, exportCollectionSchedule,getCollectionScheduleSteps,stop } from "@/api/store/collectionSchedule";
+
+export default {
+  name: "CollectionSchedule",
+  data() {
+    // 定义状态颜色映射(若依常用色系)
+    const stepColorMap = {
+      1: 'primary',   // 待用户第一次确认 —— 蓝色
+      2: 'warning',   // 待开方 —— 橙色
+      3: 'danger',    // 待药师审核 —— 红色
+      4: 'success',   // 待建议 —— 绿色
+      5: 'info',      // 待用户二次确认 —— 灰蓝
+      6: 'success'    // 完成 —— 蓝色
+    };
+    return {
+      // === 新增:终止弹窗相关 ===
+      endProcessVisible: false,
+      endForm: {
+        id: null,
+        collectionId: null,
+        remark: ''
+      },
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户信息采集进度表格数据
+      collectionScheduleList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 当前流程节点字典:(1:待用户第一次确认、2:待开方、3:待药师审核、4:待建议、5:待用户二次确认、6:完成);其中带疗法模式有1,2,3,5,6;无疗法模式只有1,4,5,6
+      currentStepOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        collectionId: null,
+        userId: null,
+        userName: null,
+        doctorId: null,
+        doctorName: null,
+        orderCode: null,
+        packageId: null,
+        packageName: null,
+        currentStep: null,
+        status: null,
+        completedTime: null,
+        terminatedTime: null,
+        terminatedBy: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      stepColorMap, // 暴露给模板使用
+    };
+  },
+  created() {
+    this.getList();
+    getCollectionScheduleSteps().then(response => {
+      this.currentStepOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询用户信息采集进度列表 */
+    getList() {
+      this.loading = true;
+      listCollectionSchedule(this.queryParams).then(response => {
+        this.collectionScheduleList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        collectionId: null,
+        userId: null,
+        userName: null,
+        doctorId: null,
+        doctorName: null,
+        orderCode: null,
+        packageId: null,
+        packageName: null,
+        currentStep: null,
+        status: 0,
+        createTime: null,
+        completedTime: null,
+        terminatedTime: null,
+        terminatedBy: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+    /** 终止按钮操作 - 打开弹窗 */
+    endProcess(row) {
+      this.endForm.id = row.id;
+      this.endForm.collectionId = row.collectionId;
+      this.endForm.remark = '';
+      this.endProcessVisible = true;
+    },
+    /** 提交终止操作 */
+    /** 提交终止操作 */
+    submitEndProcess() {
+      this.$refs["endFormRef"].validate(valid => {
+        if (valid) {
+          const { id, collectionId, remark } = this.endForm
+          this.$confirm('确认终止该采集进度?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            stop({ id, collectionId, remark }).then(response => {
+              this.msgSuccess("终止成功");
+              this.endProcessVisible = false;
+              this.getList();
+            }).catch(() => {
+              // 可选:错误提示
+            });
+          }).catch(() => {
+            // 取消
+          });
+        }
+      });
+    },
+    /** 重置终止表单 */
+    resetEndForm() {
+      this.$refs["endFormRef"] && this.$refs["endFormRef"].resetFields();
+      this.endForm.id = null;
+      this.endForm.collectionId = null;
+      this.endForm.remark = '';
+    },
+
+
+    // 多选框选中数据
+    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 = "添加用户信息采集进度";
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateCollectionSchedule(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCollectionSchedule(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有用户信息采集进度数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportCollectionSchedule(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+    getStepLabel(currentStep) {
+      if (currentStep == null) return '—';
+      const option = this.currentStepOptions.find(opt => opt.dictValue === currentStep);
+      return option ? option.dictLabel : '未知状态';
+    }
+  }
+};
+</script>

+ 248 - 3
src/views/store/components/packageOrderDetails.vue

@@ -162,6 +162,23 @@
                    <el-descriptions-item label="代收金额" ><span v-if="item.payRemain!=null">¥{{item.payRemain.toFixed(2)}}</span></el-descriptions-item>
         </el-descriptions>
            </div>
+
+       <!-- 首诊图片管理 -->
+       <div class="contentx" v-if="item!=null">
+         <div class="desct">
+           首诊图片管理
+           <el-button
+             type="primary"
+             size="mini"
+             style="float: right; margin-top: -5px;"
+             @click="showPatientImagesDialog"
+             :disabled="item.status == 3"
+           >
+             管理首诊图片
+           </el-button>
+         </div>
+       </div>
+
        <el-drawer
            :with-header="false"
            :append-to-body="true"
@@ -200,19 +217,85 @@
           <el-dialog :title="addSms.title" :visible.sync="addSms.open" width="800px" append-to-body>
               <add-sms ref="sms" @close="closeSms()"></add-sms>
           </el-dialog>
+
+          <!-- 首诊图片管理对话框 -->
+          <el-dialog
+            title="首诊图片管理"
+            :visible.sync="patientImagesDialog.visible"
+            width="80%"
+            append-to-body
+            @close="closePatientImagesDialog"
+          >
+            <div v-loading="patientImagesDialog.loading">
+              <div style="margin-bottom: 20px;">
+                <h4>当前首诊图片:</h4>
+                <div v-if="patientImagesDialog.images.length > 0" class="image-gallery">
+                  <div
+                    v-for="(image, index) in patientImagesDialog.images"
+                    :key="index"
+                    class="image-item"
+                  >
+                    <img :src="image" class="thumbnail" @click="previewImage(image)" />
+                    <div class="image-actions">
+                      <el-button
+                        size="mini"
+                        type="danger"
+                        icon="el-icon-delete"
+                        circle
+                        @click="removeImage(index)"
+                      ></el-button>
+                    </div>
+                  </div>
+                </div>
+                <div v-else style="color: #999; text-align: center; padding: 20px;">
+                  暂无首诊图片
+                </div>
+              </div>
+
+              <div style="margin-bottom: 20px;">
+                <h4>添加新图片:</h4>
+                <ImageUpload
+                  v-model="patientImagesDialog.newImages"
+                  :limit="10"
+                  :file-size="5"
+                  :file-type="['jpg', 'jpeg', 'png', 'gif']"
+                />
+              </div>
+            </div>
+
+            <div slot="footer" class="dialog-footer">
+              <el-button @click="closePatientImagesDialog">取 消</el-button>
+              <el-button type="primary" @click="savePatientImages" :loading="patientImagesDialog.saving">
+                保 存
+              </el-button>
+            </div>
+          </el-dialog>
+
+          <!-- 图片预览对话框 -->
+          <el-dialog
+            title="图片预览"
+            :visible.sync="previewDialog.visible"
+            width="60%"
+            append-to-body
+          >
+            <div style="text-align: center;">
+              <img :src="previewDialog.image" style="max-width: 100%; max-height: 500px;" />
+            </div>
+          </el-dialog>
       </div>
 </template>
 
 <script>
 
-import { listPackageOrder,storeRefund,inquiryRefund, payment,getPackageOrder, delPackageOrder,refundAudit, addPackageOrder,refund, updatePackageOrder, exportPackageOrder,getUserPhone } from "@/api/store/packageOrder";
+import { listPackageOrder,storeRefund,inquiryRefund, payment,getPackageOrder, delPackageOrder,refundAudit, addPackageOrder,refund, updatePackageOrder, exportPackageOrder,getUserPhone, editPatientImages } from "@/api/store/packageOrder";
 import { listOrderitem} from "@/api/store/storeOrder";
 import storeOrderDetails from '../components/storeOrderDetails2.vue';
 import inquiryOrderDetails from '../components/inquiryOrderDetails.vue';
 import addSms from '../../crm/components/addSms.vue';
+import ImageUpload from '@/components/ImageUpload/index.vue';
   export default {
     name: "patdetails",
-    components: { storeOrderDetails,inquiryOrderDetails,addSms },
+    components: { storeOrderDetails,inquiryOrderDetails,addSms, ImageUpload },
     props:["data"],
     data() {
 
@@ -248,6 +331,19 @@ import addSms from '../../crm/components/addSms.vue';
       refundStatusOptions: [],
         item:null,
       pay:[],
+      // 患者图片管理对话框数据
+      patientImagesDialog: {
+        visible: false,
+        loading: false,
+        saving: false,
+        images: [], // 当前患者图片列表
+        newImages: '' // 新上传的图片
+      },
+      // 图片预览对话框数据
+      previewDialog: {
+        visible: false,
+        image: ''
+      }
       }
     },
     computed: {
@@ -282,7 +378,7 @@ import addSms from '../../crm/components/addSms.vue';
         setTimeout(() => {
             that.$refs.sms.getPackageOrderId(this.item.orderId,mobile,3);
         }, 500);
-        
+
       },
       handlePhone(){
         const orderId = this.item.orderId;
@@ -408,6 +504,114 @@ import addSms from '../../crm/components/addSms.vue';
             });
           }).catch(function() {});
       },
+      // 显示患者图片管理对话框
+      showPatientImagesDialog() {
+        // 解析patientJson中的firstVisitImages字段
+        if (this.item.patientJson) {
+          try {
+            const patientData = JSON.parse(this.item.patientJson);
+            // 修改:imagesList参数接受的是图片的path字符串,可能包含多个路径用逗号分隔
+            const imagesPath = patientData.firstVisitImages;
+            if (imagesPath) {
+              // 如果是字符串,按逗号分割成数组用于显示
+              if (typeof imagesPath === 'string') {
+                this.patientImagesDialog.images = imagesPath.split(',').filter(img => img.trim() !== '');
+              } else {
+                // 如果已经是数组,直接使用
+                this.patientImagesDialog.images = imagesPath;
+              }
+            } else {
+              this.patientImagesDialog.images = [];
+            }
+          } catch (e) {
+            console.error('解析patientJson失败:', e);
+            this.patientImagesDialog.images = [];
+          }
+        } else {
+          this.patientImagesDialog.images = [];
+        }
+
+        // 重置新上传的图片
+        this.patientImagesDialog.newImages = '';
+        this.patientImagesDialog.visible = true;
+      },
+
+      // 关闭患者图片管理对话框
+      closePatientImagesDialog() {
+        this.patientImagesDialog.visible = false;
+        this.patientImagesDialog.images = [];
+        this.patientImagesDialog.newImages = '';
+      },
+
+      // 预览图片
+      previewImage(image) {
+        this.previewDialog.image = image;
+        this.previewDialog.visible = true;
+      },
+
+      // 移除图片
+      removeImage(index) {
+        this.$confirm('确定要删除这张图片吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.patientImagesDialog.images.splice(index, 1);
+          this.$message.success('删除成功');
+        }).catch(() => {});
+      },
+
+      // 保存患者图片
+      savePatientImages() {
+        this.patientImagesDialog.saving = true;
+
+        // 合并原有图片和新上传的图片
+        let allImages = [...this.patientImagesDialog.images];
+
+        // 如果有新上传的图片,添加到列表中
+        if (this.patientImagesDialog.newImages) {
+          const newImages = this.patientImagesDialog.newImages.split(',').filter(img => img.trim() !== '');
+          allImages = [...allImages, ...newImages];
+        }
+
+        // 修改:根据后端API要求,imagesList参数应该是字符串类型
+        // 将所有图片路径用逗号连接成一个字符串
+        const imagesParam = allImages.join(',');
+
+        console.log('保存患者图片,参数:', {
+          orderId: this.item.orderId,
+          imagesParam: imagesParam
+        });
+
+        // 调用API保存图片
+        editPatientImages(this.item.orderId, imagesParam).then(response => {
+          console.log('保存患者图片成功:', response);
+          this.$message.success('保存成功');
+          this.patientImagesDialog.saving = false;
+          this.patientImagesDialog.visible = false;
+
+          // 更新item中的patientJson
+          if (this.item.patientJson) {
+            try {
+              const patientData = JSON.parse(this.item.patientJson);
+              // 保存时保持与API一致的格式,存储字符串
+              patientData.firstVisitImages = imagesParam;
+              this.item.patientJson = JSON.stringify(patientData);
+            } catch (e) {
+              console.error('更新patientJson失败:', e);
+            }
+          }
+        }).catch(error => {
+          console.error('保存患者图片失败:', error);
+          this.$message.error('保存失败: ' + (error.message || '未知错误'));
+          this.patientImagesDialog.saving = false;
+        }).finally(() => {
+          // 确保无论成功还是失败,都重置saving状态
+          if (this.patientImagesDialog.saving) {
+            this.patientImagesDialog.saving = false;
+          }
+        });
+      }
     }
   }
 </script>
@@ -450,5 +654,46 @@ import addSms from '../../crm/components/addSms.vue';
   float: right;
   margin-right: 20px
 }
+
+/* 图片画廊样式 */
+.image-gallery {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 15px;
+  margin-top: 10px;
+}
+
+.image-item {
+  position: relative;
+  width: 120px;
+  height: 120px;
+  border: 1px solid #ddd;
+  border-radius: 4px;
+  overflow: hidden;
+}
+
+.thumbnail {
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+  cursor: pointer;
+  transition: transform 0.3s;
+}
+
+.thumbnail:hover {
+  transform: scale(1.05);
+}
+
+.image-actions {
+  position: absolute;
+  top: 5px;
+  right: 5px;
+  opacity: 0;
+  transition: opacity 0.3s;
+}
+
+.image-item:hover .image-actions {
+  opacity: 1;
+}
 </style>