Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	package.json
xyx 2 days ago
parent
commit
ad4611cf11

+ 40 - 0
.env.prod-gzzdy

@@ -0,0 +1,40 @@
+# 页面标题
+VUE_APP_TITLE =郑多燕总管理系统
+# 首页菜单标题
+VUE_APP_TITLE_INDEX =郑多燕管理系统
+# 公司名称
+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
+# 存储桶配置
+VUE_APP_OBS_ACCESS_KEY_ID = K2UTJGIN7UTZJR2XMXYG
+# 存储桶配置
+VUE_APP_OBS_SECRET_ACCESS_KEY = sbyeNJLbcYmH6copxeFP9pAoksM4NIT9Zw4x0SRX
+# 存储桶配置
+VUE_APP_OBS_SERVER = https://obs.cn-north-4.myhuaweicloud.com
+# 存储桶配置
+VUE_APP_OBS_BUCKET = gzzdy1-hw079058881
+# 存储桶配置
+VUE_APP_COS_BUCKET = gzzdy-1323137866
+# 存储桶配置
+VUE_APP_COS_REGION = ap-chongqing
+# 线路一地址
+VUE_APP_VIDEO_LINE_1 = https://gzzdytcpv.ylrzcloud.com
+# 线路二地址
+VUE_APP_VIDEO_LINE_2 = https://gzzdyobs.ylrztop.com
+
+# 开发环境配置
+ENV = 'development'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 9 - 3
.env.prod-sft

@@ -17,12 +17,18 @@ VUE_APP_OBS_SECRET_ACCESS_KEY = sbyeNJLbcYmH6copxeFP9pAoksM4NIT9Zw4x0SRX
 # 存储桶配置
 # 存储桶配置
 VUE_APP_OBS_SERVER = https://obs.cn-north-4.myhuaweicloud.com
 VUE_APP_OBS_SERVER = https://obs.cn-north-4.myhuaweicloud.com
 # 存储桶配置
 # 存储桶配置
-VUE_APP_COS_BUCKET = sft-1361917636
+#VUE_APP_COS_BUCKET = sft-1361917636
+VUE_APP_COS_BUCKET = cqsft-1323137866
+# 存储桶配置
+VUE_APP_OBS_BUCKET = sft-hw079058881
 # 存储桶配置
 # 存储桶配置
 VUE_APP_COS_REGION = ap-chongqing
 VUE_APP_COS_REGION = ap-chongqing
-# 线路一地址
-VUE_APP_VIDEO_LINE_1 = https://video.sft12.cn
 
 
+# 线路一地址
+#VUE_APP_VIDEO_LINE_1 = https://video.sft12.cn
+VUE_APP_VIDEO_LINE_1 = https://cqsfttcpv.ylrzcloud.com
+# 线路二地址
+VUE_APP_VIDEO_LINE_2 = https://sftobs.ylrztop.com
 
 
 # 开发环境配置
 # 开发环境配置
 ENV = 'development'
 ENV = 'development'

+ 3 - 0
.gitignore

@@ -25,3 +25,6 @@ pnpm-debug.log*
 
 
 package-lock.json
 package-lock.json
 yarn.lock
 yarn.lock
+
+# AGENTS.md - 项目指导文档,不上传到远程仓库
+AGENTS.md

+ 1 - 0
package.json

@@ -50,6 +50,7 @@
     "build:prod-ddgy": "vue-cli-service build --mode prod-ddgy",
     "build:prod-ddgy": "vue-cli-service build --mode prod-ddgy",
     "build:prod-yxj": "vue-cli-service build --mode prod-yxj",
     "build:prod-yxj": "vue-cli-service build --mode prod-yxj",
     "build:prod-bjzm": "vue-cli-service build --mode prod-bjzm",
     "build:prod-bjzm": "vue-cli-service build --mode prod-bjzm",
+    "build:prod-gzzdy": "vue-cli-service build --mode prod-gzzdy",
     "build:prod-cfryt": "vue-cli-service build --mode prod-cfryt",
     "build:prod-cfryt": "vue-cli-service build --mode prod-cfryt",
     "preview": "node build/index.js --preview",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src"
     "lint": "eslint --ext .js,.vue src"

+ 8 - 0
src/api/his/integralOrder.js

@@ -132,4 +132,12 @@ export function getIntegralTemplate(){
     url: '/his/integralOrder/importUpdateOrderTemplate',
     url: '/his/integralOrder/importUpdateOrderTemplate',
     method: 'get'
     method: 'get'
   })
   })
+}
+
+// 获取订单操作记录
+export function getOrderLogs(orderId) {
+  return request({
+    url: '/his/logs/order/' + orderId,
+    method: 'get'
+  })
 }
 }

+ 10 - 0
src/api/live/liveAfterSales.js

@@ -90,3 +90,13 @@ export function audit2(data) {
     data: data
     data: data
   })
   })
 }
 }
+
+export function handleImmediatelyRefund(data) {
+  return request({
+    url: '/live/liveAfterSales/handleImmediatelyRefund',
+    method: 'post',
+    data: data
+  })
+}
+
+

BIN
src/assets/logo/gzzdy_logo.png


+ 4 - 4
src/utils/obs.js

@@ -40,10 +40,10 @@ export const uploadToOBS = async (file, progressCallback, type, cancelCallback)
         })
         })
       }
       }
       //四福堂专属配置
       //四福堂专属配置
-      // resolve({
-      //   "RequestId": "",
-      //   "urlPath": ""
-      // })
+   /*   resolve({
+        "RequestId": "",
+        "urlPath": ""
+      })*/
       obsClient.putObject(
       obsClient.putObject(
         {
         {
           Bucket: process.env.VUE_APP_OBS_BUCKET,
           Bucket: process.env.VUE_APP_OBS_BUCKET,

+ 225 - 3
src/views/components/course/userCourseCatalogDetails.vue

@@ -157,6 +157,89 @@
         </el-form-item>
         </el-form-item>
         <el-form-item label="红包金额" prop="redPacketMoney">
         <el-form-item label="红包金额" prop="redPacketMoney">
           <el-input-number v-model="form.redPacketMoney" :min="0.1" :max="200" :step="0.1"></el-input-number>
           <el-input-number v-model="form.redPacketMoney" :min="0.1" :max="200" :step="0.1"></el-input-number>
+        </el-form-item>
+         <!-- v-if="!!form.randomRedPacketRulesArr" -->
+        <el-form-item label="随机红包金额"  >
+          <template >
+          <div v-for="(rule, index) in form.randomRedPacketRulesArr" :key="index" class="form-row">
+           <el-form-item
+            label="随机红包金额区间"
+            :prop="`randomRedPacketRulesArr.${index}.minAmount`"
+            :rules="[
+              { required: true, message: '请输入最小金额', trigger: 'blur' },
+              { validator: validateMinAmount, trigger: 'blur', index: index }
+            ]"
+            class="form-item-amount"
+          >
+            <el-input
+              v-model.number="rule.minAmount"
+              type="number"
+              :min="0.01"
+              :precision="2"
+              :step="0.01"
+              placeholder="最小金额"
+              size="small"
+              class="amount-input"
+              @input="handleAmountInput(rule, 'minAmount')"
+            ></el-input>
+            <span class="separator">-</span>
+            <el-input
+              v-model.number="rule.maxAmount"
+              type="number"
+              :min="rule.minAmount || 0.01"
+              :precision="2"
+              :step="0.01"
+              placeholder="最大金额"
+              size="small"
+              class="amount-input"
+              @input="handleAmountInput(rule, 'maxAmount')"
+            ></el-input>
+            <span class="suffix">元</span>
+          </el-form-item>
+              <el-form-item
+                label="随机权重"
+                :prop="`randomRedPacketRulesArr.${index}.weight`"
+                :rules="[
+                  { required: true, message: '请输入权重', trigger: 'blur' },
+                  { type: 'integer', message: '权重必须为整数', trigger: 'blur' },
+                ]"
+                class="form-item-weight"
+              >
+                <el-input
+                  v-model.number="rule.weight"
+                  type="number"
+                  :min="1"
+                  placeholder="权重"
+                  size="small"
+                ></el-input>
+              </el-form-item>
+              <el-tooltip class="item" effect="dark" content="权重越高,被随机到的概率越大" placement="top">
+                <i class="el-icon-question"></i>
+              </el-tooltip>
+              <div class="action-buttons">
+                <el-button
+                  icon="el-icon-plus"
+                  size="mini"
+                  type="text"
+                  @click="addRule(index)"
+                  class="add-btn"
+                >
+                  新增
+                </el-button>
+                <el-button
+                  icon="el-icon-delete"
+                  size="mini"
+                  type="text"
+                  @click="deleteRule(index)"
+                  :disabled="form.randomRedPacketRulesArr.length <= 1"
+                  class="delete-btn"
+                >
+                  删除
+                </el-button>
+              </div>
+          </div>
+        </template>
+           
         </el-form-item>
         </el-form-item>
         <el-form-item label="是否关联商品">
         <el-form-item label="是否关联商品">
           <el-radio v-model="form.isProduct" :label=0>否</el-radio>
           <el-radio v-model="form.isProduct" :label=0>否</el-radio>
@@ -355,10 +438,21 @@ import {getByIds} from '@/api/course/courseQuestionBank'
 import CourseWatchComment from "./courseWatchComment.vue";
 import CourseWatchComment from "./courseWatchComment.vue";
 import {getCateListByPid, getCatePidList} from '@/api/course/userCourseCategory'
 import {getCateListByPid, getCatePidList} from '@/api/course/userCourseCategory'
 import draggable from 'vuedraggable'
 import draggable from 'vuedraggable'
+import { getConfigByKey } from '@/api/system/config'
 
 
 export default {
 export default {
   name: "userCourseCatalog",
   name: "userCourseCatalog",
   components: {VideoUpload, QuestionBank, CourseWatchComment, CourseProduct, draggable},
   components: {VideoUpload, QuestionBank, CourseWatchComment, CourseProduct, draggable},
+  watch:{
+    // 深度监听 rules 数组的变化,以更新总权重
+    "form.randomRedPacketRulesArr": {
+      handler(val) {
+        // this.calculateTotalWeight();
+        this.validateRules();
+      },
+      deep: true,
+    },
+  },
   data() {
   data() {
     return {
     return {
       duration: null,
       duration: null,
@@ -454,7 +548,15 @@ export default {
       openVideoSort: false,
       openVideoSort: false,
       // 表单参数
       // 表单参数
       form: {
       form: {
-        courseProducts: []
+        courseProducts: [],
+        randomRedPacketRules:null,
+        randomRedPacketRulesArr:[
+           {
+            minAmount: 0.01,
+            maxAmount: 0.01,
+            weight: 100,
+          }
+        ]
       },
       },
       updateBatchData: {
       updateBatchData: {
         open: false,
         open: false,
@@ -477,12 +579,25 @@ export default {
         videoId: null,
         videoId: null,
         title: ""
         title: ""
       },
       },
+      enableRandomRedPacket:false
     }
     }
   },
   },
   created() {
   created() {
     this.getDicts("sys_course_temp_type").then(response => {
     this.getDicts("sys_course_temp_type").then(response => {
       this.typeOptions = response.data;
       this.typeOptions = response.data;
     });
     });
+        getConfigByKey('randomRedpacket:config').then(res=>{
+        let configData = res.data;
+        if(!!configData && !!configData.configValue){
+           let configValue = JSON.parse(configData.configValue);
+           if(!!configValue.enableRandomRedpacket){
+            this.enableRandomRedPacket = configValue.enableRandomRedpacket;
+            console.log("this.enableRandomRedPacket ::" + this.enableRandomRedPacket)
+           }
+        }
+    }).catch(res=>{
+
+    })
   },
   },
   methods: {
   methods: {
     getPickerOptions() {
     getPickerOptions() {
@@ -713,6 +828,14 @@ export default {
         isFirst: 0,
         isFirst: 0,
         listingStartTime: null,
         listingStartTime: null,
         listingEndTime: null,
         listingEndTime: null,
+        randomRedPacketRules:null,
+        randomRedPacketRulesArr:[
+          {
+            minAmount: 0.01,
+            maxAmount: 0.01,
+            weight: 100,
+          }
+        ]
       };
       };
       this.videoURL = '';
       this.videoURL = '';
       this.progress = 0;
       this.progress = 0;
@@ -768,7 +891,19 @@ export default {
       this.packageList = [];
       this.packageList = [];
       const videoId = row.videoId || this.ids
       const videoId = row.videoId || this.ids
       getUserCourseVideo(videoId).then(response => {
       getUserCourseVideo(videoId).then(response => {
+        console.log(response);
         this.form = response.data;
         this.form = response.data;
+        if(!!this.form.randomRedPacketRules){
+           this.$set(this.form, 'randomRedPacketRulesArr', JSON.parse(this.form.randomRedPacketRules)) ;
+          // this.form.randomRedPacketRulesArr = JSON.parse(this.form.randomRedPacketRules);
+        }else{
+          //处理初始值
+         this.form.randomRedPacketRulesArr = [{
+            minAmount: 0.01,
+            maxAmount: 0.01,
+            weight: 100,
+          }]
+        }
         if (response.data.videoUrl != null && response.data.videoUrl !== '') {
         if (response.data.videoUrl != null && response.data.videoUrl !== '') {
           this.videoUrl = response.data.videoUrl;
           this.videoUrl = response.data.videoUrl;
         }
         }
@@ -813,7 +948,7 @@ export default {
             });
             });
             return
             return
           }
           }
-          if (this.form.isProduct != null && this.form.isProduct == 1 && this.form.courseProducts.length < 1) {
+          if (this.form.isProduct != null && this.form.isProduct == 1 && (this.form.courseProducts == null || this.form.courseProducts.length < 1)) {
             this.$message({
             this.$message({
               message: '请选择关联商品',
               message: '请选择关联商品',
               type: 'warning'
               type: 'warning'
@@ -829,6 +964,11 @@ export default {
           if (this.form.courseProducts != null) {
           if (this.form.courseProducts != null) {
             this.form.productId = this.form.courseProducts.map(item => item.id).join(',');
             this.form.productId = this.form.courseProducts.map(item => item.id).join(',');
           }
           }
+          if(!!this.form.randomRedPacketRulesArr){
+            let rulesJson = JSON.stringify(this.form.randomRedPacketRulesArr);
+            this.form.randomRedPacketRules =  rulesJson;
+          }
+
           if (this.form.videoId != null) {
           if (this.form.videoId != null) {
             updateUserCourseVideo(this.form).then(response => {
             updateUserCourseVideo(this.form).then(response => {
               this.msgSuccess("修改成功");
               this.msgSuccess("修改成功");
@@ -981,7 +1121,15 @@ export default {
       this.redData.loading = true;
       this.redData.loading = true;
       this.redData.queryParams.courseId = this.courseId;
       this.redData.queryParams.courseId = this.courseId;
       getVideoListByCourseId(this.redData.queryParams).then(response => {
       getVideoListByCourseId(this.redData.queryParams).then(response => {
-        this.redData.list = response.rows;
+        if(!!response.rows && response.rows.length >0){
+          for(let i = 0; i < response.rows.length; i++){
+            if(!!response.rows[i].randomRedPacketRules){
+             this.$set(response.rows[i], 'randomRedPacketRulesArr', JSON.parse(response.rows[i].randomRedPacketRules)) ;
+            }
+          }
+        }
+         this.redData.list = response.rows;
+         console.log(this.redData.list);
         this.redData.loading = false;
         this.redData.loading = false;
       });
       });
     },
     },
@@ -998,6 +1146,80 @@ export default {
       this.commentDialog.title = `查看评论 - ${row.title}`;
       this.commentDialog.title = `查看评论 - ${row.title}`;
       this.commentDialog.open = true;
       this.commentDialog.open = true;
     },
     },
+    // 实时过滤金额输入,只允许两位小数
+    handleAmountInput(rule, field) {
+      let value = rule[field];
+      if (value === null || value === undefined) return;
+      
+      // 转换为字符串处理
+      let str = value.toString();
+      
+      // 移除除数字和小数点外的所有字符
+      str = str.replace(/[^0-9.]/g, '');
+      
+      // 只保留一个小数点
+      const dotIndex = str.indexOf('.');
+      if (dotIndex !== -1) {
+        str = str.substring(0, dotIndex + 1) + str.substring(dotIndex + 1).replace(/\./g, '');
+      }
+      
+      // 限制小数点后最多两位
+      if (dotIndex !== -1 && str.length > dotIndex + 3) {
+        str = str.substring(0, dotIndex + 3);
+      }
+      
+      // 转换回数字并更新
+      rule[field] = parseFloat(str) || 0;
+    },
+      deleteRule(index) {
+      this.$confirm("确定要删除这个区间吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.form.randomRedPacketRulesArr.splice(index, 1);
+        this.$message({
+          type: "success",
+          message: "删除成功!",
+        });
+      });
+    },
+      addRule(index) {
+      // 在当前行的后面插入一个新行
+      this.form.randomRedPacketRulesArr.splice(index + 1, 0, {
+        minAmount: 0.01,
+        maxAmount: 0.01,
+        weight: 100,
+      });
+    },
+       // 自定义校验规则:确保最大金额大于最小金额
+    validateMinAmount(rule, value, callback) {
+      // debugger;
+      // const maxAmount = this.form29.rules[].maxAmount
+      
+      const index = rule.index;
+      const maxAmount = this.form.randomRedPacketRulesArr[index].maxAmount;
+
+      if (value > maxAmount) {
+        callback(new Error("最小金额不能大于最大金额"));
+      } else {
+        callback();
+      }
+    },
+      validateRules() {        
+      this.form.randomRedPacketRulesArr.forEach((rule) => {
+        if (rule.minAmount === undefined || rule.minAmount < 0.01) {
+          rule.minAmount = 0.01;
+        }
+        if (rule.maxAmount === undefined || rule.maxAmount < rule.minAmount) {
+          rule.maxAmount = rule.minAmount;
+        }
+        if (rule.weight === undefined || rule.weight < 1) {
+          rule.weight = 1;
+        }
+      });
+    },
+
   }
   }
 }
 }
 </script>
 </script>

+ 75 - 2
src/views/components/his/integralOrderDetails.vue

@@ -106,6 +106,27 @@
 
 
       </el-table>
       </el-table>
     </div>
     </div>
+    
+    <!-- 操作记录 -->
+    <div class="contentx" v-if="item != null" style="padding-bottom: 70px;">
+      <div class="desct">
+        操作记录
+      </div>
+      <el-table :data="orderLogs" border style="width: 100%; margin-top: 20px;" v-loading="logsLoading">
+        <!-- <el-table-column prop="changeType" label="操作类型" align="center" width="120">
+        </el-table-column> -->
+        <el-table-column prop="changeTime" label="操作时间" align="center" width="180">
+          <template slot-scope="scope">
+            {{ parseTime(scope.row.changeTime) }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="changeMessage" label="操作备注" align="center">
+        </el-table-column>
+        <!-- <el-table-column prop="operator" label="操作员" align="center" width="120">
+        </el-table-column> -->
+        
+      </el-table>
+    </div>
     <el-dialog width="35%" title="发货" :visible.sync="sendVisible" append-to-body @close="sendCancel">
     <el-dialog width="35%" title="发货" :visible.sync="sendVisible" append-to-body @close="sendCancel">
       <el-form ref="form" :model="form" label-width="120px">
       <el-form ref="form" :model="form" label-width="120px">
         <el-form-item label="快递名称" prop="deliveryName">
         <el-form-item label="快递名称" prop="deliveryName">
@@ -179,7 +200,10 @@
     </el-dialog>
     </el-dialog>
 
 
     <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
     <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
-      <el-table style="margin-top: 20px;width: 100%" ref="orderHistoryTable" :data="traces" border>
+      <div style="margin-bottom: 10px; text-align: right;">
+        <el-button type="primary" size="small" @click="syncExpressInfo" :loading="syncLoading">同步物流信息</el-button>
+      </div>
+      <el-table style="margin-top: 20px;width: 100%" ref="orderHistoryTable" :data="traces" border v-loading="tableLoading">
         <el-table-column label="操作时间" width="160" align="center">
         <el-table-column label="操作时间" width="160" align="center">
           <template slot-scope="scope">
           <template slot-scope="scope">
             {{ scope.row.AcceptTime }}
             {{ scope.row.AcceptTime }}
@@ -345,7 +369,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getExpress,mandatoryRefunds,getCitys,finishOrder, listIntegralOrder, sendgoods, getIntegralOrder, delIntegralOrder, addIntegralOrder, updateIntegralOrder, exportIntegralOrder, getOrderUserPhone } from "@/api/his/integralOrder";
+import { getExpress,mandatoryRefunds,getCitys,finishOrder, listIntegralOrder, sendgoods, getIntegralOrder, delIntegralOrder, addIntegralOrder, updateIntegralOrder, exportIntegralOrder, getOrderUserPhone, getOrderLogs } from "@/api/his/integralOrder";
 import { getExpressList } from "@/api/his/express";
 import { getExpressList } from "@/api/his/express";
 import { listAccount } from "@/api/his/dfAccount";
 import { listAccount } from "@/api/his/dfAccount";
 export default {
 export default {
@@ -429,6 +453,11 @@ export default {
       selectedDistrict: null, // 选中的区
       selectedDistrict: null, // 选中的区
       detailAddress: '', // 详细地址
       detailAddress: '', // 详细地址
       deliveryTypeOptions:[],
       deliveryTypeOptions:[],
+      // 操作记录相关数据
+      orderLogs: [], // 订单操作记录
+      logsLoading: false, // 操作记录加载状态
+      syncLoading: false, // 同步物流信息按钮加载状态
+      tableLoading: false // 物流信息表格加载状态
     }
     }
   },
   },
   created() {
   created() {
@@ -726,13 +755,31 @@ export default {
     },
     },
     showExpress() {
     showExpress() {
       this.expressDialog.open = true;
       this.expressDialog.open = true;
+      this.loadExpressInfo();
+    },
+    // 加载物流信息
+    loadExpressInfo() {
+      this.tableLoading = true;
       getExpress(this.item.orderId).then(response => {
       getExpress(this.item.orderId).then(response => {
         this.express = response.data;
         this.express = response.data;
         if (this.express != null && this.express.Traces != null) {
         if (this.express != null && this.express.Traces != null) {
           this.traces = this.express.Traces
           this.traces = this.express.Traces
+        } else {
+          this.traces = [];
         }
         }
+        this.tableLoading = false;
+      }).catch(error => {
+        this.traces = [];
+        this.tableLoading = false;
+        console.error('获取物流信息失败:', error);
       });
       });
     },
     },
+    // 同步物流信息
+    syncExpressInfo() {
+      this.syncLoading = true;
+      this.loadExpressInfo();
+      this.syncLoading = false;
+    },
     sendGoods() {
     sendGoods() {
       // 手动验证所有必填字段
       // 手动验证所有必填字段
       if (!this.selectedRow) {
       if (!this.selectedRow) {
@@ -772,9 +819,12 @@ export default {
     },
     },
     getDetails(orderId) {
     getDetails(orderId) {
       this.item = null;
       this.item = null;
+      this.orderLogs = []; // 清空操作记录
       getIntegralOrder(orderId).then(response => {
       getIntegralOrder(orderId).then(response => {
         this.item = response.data;
         this.item = response.data;
         this.prod = [JSON.parse(this.item.itemJson)][0];
         this.prod = [JSON.parse(this.item.itemJson)][0];
+        // 获取操作记录
+        this.getOrderLogsData();
       });
       });
     },
     },
     // 代服账号选择变化
     // 代服账号选择变化
@@ -884,6 +934,29 @@ export default {
         console.error('完成订单失败:', error);
         console.error('完成订单失败:', error);
       });
       });
     },
     },
+    // 获取订单操作记录
+    getOrderLogsData() {
+      if (!this.item || !this.item.orderId) {
+        return;
+      }
+      
+      this.logsLoading = true;
+      getOrderLogs(this.item.orderId).then(response => {
+        if (response.code === 200) {
+          // 按照时间升序排列
+          this.orderLogs = response.data.sort((a, b) => {
+            return new Date(a.changeTime) - new Date(b.changeTime);
+          });
+        } else {
+          this.orderLogs = [];
+        }
+        this.logsLoading = false;
+      }).catch(error => {
+        this.orderLogs = [];
+        this.logsLoading = false;
+        console.error('获取操作记录失败:', error);
+      });
+    }
   }
   }
 }
 }
 </script>
 </script>

+ 66 - 2
src/views/course/coursePlaySourceConfig/index.vue

@@ -39,6 +39,21 @@
           size="small"
           size="small"
           @keyup.enter.native="handleQuery"
           @keyup.enter.native="handleQuery"
         />
         />
+      </el-form-item>
+            <el-form-item label="状态" prop="status">
+        <el-select
+          v-model="queryParams.status"
+          placeholder="请选择状态"
+          clearable
+          size="small"
+        >
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
       </el-form-item>
       </el-form-item>
       <el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -141,6 +156,15 @@
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-tag prop="isMall" v-for="(item, index) in isMallOptions" v-if="scope.row.isMall==item.dictValue">{{item.dictLabel}}</el-tag>
           <el-tag prop="isMall" v-for="(item, index) in isMallOptions" v-if="scope.row.isMall==item.dictValue">{{item.dictLabel}}</el-tag>
         </template>
         </template>
+      </el-table-column>
+            <el-table-column label="状态" align="center" prop="status" width="100px">
+        <template slot-scope="scope">
+          <el-tag
+            :type="scope.row.status === 0 ? 'success' : scope.row.status === 1 ? 'warning' : 'danger'"
+          >
+            {{ getStatusLabel(scope.row.status) }}
+          </el-tag>
+        </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column label="修改时间" align="center" prop="updateTime" />
       <el-table-column label="修改时间" align="center" prop="updateTime" />
@@ -241,6 +265,22 @@
               :value="item.dictValue"
               :value="item.dictValue"
             />
             />
           </el-select>
           </el-select>
+        </el-form-item>
+                <el-form-item label="状态" prop="status">
+          <el-select
+            v-model="form.status"
+            placeholder="请选择状态"
+            style="width: 220px"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in statusOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
         </el-form-item>
         </el-form-item>
         <el-form-item label="图标" prop="img">
         <el-form-item label="图标" prop="img">
           <image-upload v-model="form.img" :file-type='["png", "jpg", "jpeg"]' :limit="1"/>
           <image-upload v-model="form.img" :file-type='["png", "jpg", "jpeg"]' :limit="1"/>
@@ -308,7 +348,8 @@ export default {
         pageNum: 1,
         pageNum: 1,
         pageSize: 10,
         pageSize: 10,
         name: null,
         name: null,
-        appid: null
+        appid: null,
+        status: null
       },
       },
       showSearch: true,
       showSearch: true,
       single: true,
       single: true,
@@ -318,6 +359,20 @@ export default {
       list: [],
       list: [],
       total: 0,
       total: 0,
       typesOptions: [],
       typesOptions: [],
+            statusOptions: [
+        {
+          label: "正常",
+          value: 0
+        },
+        {
+          label: "半封禁",
+          value: 1
+        },
+        {
+          label: "封禁",
+          value: 2
+        }
+      ],
       isMallOptions:[
       isMallOptions:[
         {
         {
           dictLabel: "是",
           dictLabel: "是",
@@ -567,9 +622,18 @@ export default {
         token: 'cbnd7lJvkripVOpyTFAna6NAWCxCrvC',
         token: 'cbnd7lJvkripVOpyTFAna6NAWCxCrvC',
         aesKey: 'HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E',
         aesKey: 'HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E',
         msgDataFormat: 'JSON',
         msgDataFormat: 'JSON',
-        type: '1'
+        type: '1',
+        status: 0
       }
       }
       this.resetForm("form");
       this.resetForm("form");
+          },
+    getStatusLabel(status) {
+      const statusMap = {
+        0: '正常',
+        1: '半封禁',
+        2: '封禁'
+      };
+      return statusMap[status] || '未知';
     }
     }
   },
   },
 }
 }

+ 192 - 4
src/views/course/userCourse/index.vue

@@ -276,6 +276,86 @@
         <el-form-item label="红包金额" prop="redPacketMoney">
         <el-form-item label="红包金额" prop="redPacketMoney">
           <el-input-number v-model="openRedPage.redPacketMoney" :min="0.1" :max="200" :step="0.1"></el-input-number>
           <el-input-number v-model="openRedPage.redPacketMoney" :min="0.1" :max="200" :step="0.1"></el-input-number>
         </el-form-item>
         </el-form-item>
+        <div v-if="!!enableRandomRedPacket" style=" display: flex;
+                  flex-direction: column;">
+             <div v-for="(rule, index) in openRedPage.rules" :key="index" class="form-row">
+           <el-form-item
+            label="随机红包金额区间"
+            :prop="`rules.${index}.minAmount`"
+            :rules="[
+              { required: true, message: '请输入最小金额', trigger: 'blur' },
+              { validator: validateMinAmount, trigger: 'blur', index: index }
+            ]"
+            class="form-item-amount"
+          >
+            <el-input
+              v-model.number="rule.minAmount"
+              type="number"
+              :min="0.01"
+              :precision="2"
+              :step="0.01"
+              placeholder="最小金额"
+              size="small"
+              class="amount-input"
+              @input="handleAmountInput(rule, 'minAmount')"
+            ></el-input>
+            <span class="separator">-</span>
+            <el-input
+              v-model.number="rule.maxAmount"
+              type="number"
+              :min="rule.minAmount || 0.01"
+              :precision="2"
+              :step="0.01"
+              placeholder="最大金额"
+              size="small"
+              class="amount-input"
+              @input="handleAmountInput(rule, 'maxAmount')"
+            ></el-input>
+            <span class="suffix">元</span>
+          </el-form-item>
+              <el-form-item
+                label="随机权重"
+                :prop="`rules.${index}.weight`"
+                :rules="[
+                  { required: true, message: '请输入权重', trigger: 'blur' },
+                  { type: 'integer', message: '权重必须为整数', trigger: 'blur' },
+                ]"
+                class="form-item-weight"
+              >
+                <el-input
+                  v-model.number="rule.weight"
+                  type="number"
+                  :min="1"
+                  placeholder="权重"
+                  size="small"
+                ></el-input>
+              </el-form-item>
+              <el-tooltip class="item" effect="dark" content="权重越高,被随机到的概率越大" placement="top">
+                <i class="el-icon-question"></i>
+              </el-tooltip>
+              <div class="action-buttons">
+                <el-button
+                  icon="el-icon-plus"
+                  size="mini"
+                  type="text"
+                  @click="addRule(index)"
+                  class="add-btn"
+                >
+                  新增
+                </el-button>
+                <el-button
+                  icon="el-icon-delete"
+                  size="mini"
+                  type="text"
+                  @click="deleteRule(index)"
+                  :disabled="openRedPage.rules.length <= 1"
+                  class="delete-btn"
+                >
+                  删除
+                </el-button>
+              </div>
+            </div>
+        </div>
       </el-form>
       </el-form>
       <div slot="footer" class="dialog-footer">
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitFormRedPage">确 定</el-button>
         <el-button type="primary" @click="submitFormRedPage">确 定</el-button>
@@ -380,7 +460,7 @@ import userCourseCatalogDetails from '../../components/course/userCourseCatalogD
 import {getAllCourseCategoryList, getCatePidList, getCateListByPid} from "@/api/course/userCourseCategory";
 import {getAllCourseCategoryList, getCatePidList, getCateListByPid} from "@/api/course/userCourseCategory";
 import {allList} from "@/api/company/company";
 import {allList} from "@/api/company/company";
 import VideoUpload from '@/components/VideoUpload/index.vue'
 import VideoUpload from '@/components/VideoUpload/index.vue'
-
+import { getConfigByKey } from '@/api/system/config'
 export default {
 export default {
   name: "UserCourse",
   name: "UserCourse",
   components: {
   components: {
@@ -388,6 +468,16 @@ export default {
     Treeselect,
     Treeselect,
     Editor, ImageUpload, userCourseCatalogDetails
     Editor, ImageUpload, userCourseCatalogDetails
   },
   },
+  watch:{
+  // 深度监听 rules 数组的变化,以更新总权重
+    "openRedPage.rules": {
+      handler(val) {
+        // this.calculateTotalWeight();
+        this.validateRules();
+      },
+      deep: true,
+    },
+  },
   data() {
   data() {
     return {
     return {
       talentParam: {
       talentParam: {
@@ -438,6 +528,14 @@ export default {
         courseId:null,
         courseId:null,
         courseName:null,
         courseName:null,
         redPacketMoney:0.1,
         redPacketMoney:0.1,
+        //随机红包配置
+        rules:[
+           {
+            minAmount: 0.01,
+            maxAmount: 0.01,
+            weight: 100,
+          }
+        ]
       },
       },
       // 查询参数
       // 查询参数
       queryParams: {
       queryParams: {
@@ -552,11 +650,26 @@ export default {
             { required: true, message: '支持单位不能为空', trigger: 'blur' }
             { required: true, message: '支持单位不能为空', trigger: 'blur' }
           ],
           ],
         }
         }
-      }
+      },
+      enableRandomRedPacket:false
     };
     };
   },
   },
   created() {
   created() {
     this.getList();
     this.getList();
+    getConfigByKey('randomRedpacket:config').then(res=>{
+        console.log("res::")
+        console.log(res);
+        let configData = res.data;
+        if(!!configData && !!configData.configValue){
+           let configValue = JSON.parse(configData.configValue);
+           console.log(configValue);
+           if(!!configValue.enableRandomRedpacket){
+            this.enableRandomRedPacket = configValue.enableRandomRedpacket;
+           }
+        }
+    }).catch(res=>{
+
+    })
     getCatePidList().then(response => {
     getCatePidList().then(response => {
       this.categoryOptions = response.data;
       this.categoryOptions = response.data;
     });
     });
@@ -809,13 +922,14 @@ export default {
 
 
       const courseId = this.openRedPage.courseId;
       const courseId = this.openRedPage.courseId;
       const redPacketMoney = this.openRedPage.redPacketMoney;
       const redPacketMoney = this.openRedPage.redPacketMoney;
+      let randomRedPacketRules = JSON.stringify( this.openRedPage.rules);
+      console.log(randomRedPacketRules)
       this.$confirm('是否确认将课程id 为"' + courseId + '"的红包批量修改为:【'+redPacketMoney+'】?', "警告", {
       this.$confirm('是否确认将课程id 为"' + courseId + '"的红包批量修改为:【'+redPacketMoney+'】?', "警告", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning"
         type: "warning"
       }).then(function () {
       }).then(function () {
-
-        return updateUserCourseRedPage({courseId:courseId,redPacketMoney:redPacketMoney});
+        return updateUserCourseRedPage({courseId:courseId,redPacketMoney:redPacketMoney,randomRedPacketRules:randomRedPacketRules});
       }).then(() => {
       }).then(() => {
         this.getList();
         this.getList();
         this.msgSuccess("修改成功");
         this.msgSuccess("修改成功");
@@ -985,6 +1099,80 @@ export default {
       this.resetForm('configForm')
       this.resetForm('configForm')
       this.configDialog.dialogVisible = false;
       this.configDialog.dialogVisible = false;
     },
     },
+    // 实时过滤金额输入,只允许两位小数
+    handleAmountInput(rule, field) {
+      let value = rule[field];
+      if (value === null || value === undefined) return;
+      
+      // 转换为字符串处理
+      let str = value.toString();
+      
+      // 移除除数字和小数点外的所有字符
+      str = str.replace(/[^0-9.]/g, '');
+      
+      // 只保留一个小数点
+      const dotIndex = str.indexOf('.');
+      if (dotIndex !== -1) {
+        str = str.substring(0, dotIndex + 1) + str.substring(dotIndex + 1).replace(/\./g, '');
+      }
+      
+      // 限制小数点后最多两位
+      if (dotIndex !== -1 && str.length > dotIndex + 3) {
+        str = str.substring(0, dotIndex + 3);
+      }
+      
+      // 转换回数字并更新
+      rule[field] = parseFloat(str) || 0;
+    },
+      deleteRule(index) {
+      this.$confirm("确定要删除这个区间吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.openRedPage.rules.splice(index, 1);
+        this.$message({
+          type: "success",
+          message: "删除成功!",
+        });
+      });
+    },
+      addRule(index) {
+      // 在当前行的后面插入一个新行
+      this.openRedPage.rules.splice(index + 1, 0, {
+        minAmount: 0.01,
+        maxAmount: 0.01,
+        weight: 100,
+      });
+    },
+       // 自定义校验规则:确保最大金额大于最小金额
+    validateMinAmount(rule, value, callback) {
+      // debugger;
+      // const maxAmount = this.form29.rules[].maxAmount
+      
+      const index = rule.index;
+      const maxAmount = this.openRedPage.rules[index].maxAmount;
+
+      if (value > maxAmount) {
+        callback(new Error("最小金额不能大于最大金额"));
+      } else {
+        callback();
+      }
+    },
+      validateRules() {
+      this.openRedPage.rules.forEach((rule) => {
+        if (rule.minAmount === undefined || rule.minAmount < 0.01) {
+          rule.minAmount = 0.01;
+        }
+        if (rule.maxAmount === undefined || rule.maxAmount < rule.minAmount) {
+          rule.maxAmount = rule.minAmount;
+        }
+        if (rule.weight === undefined || rule.weight < 1) {
+          rule.weight = 1;
+        }
+      });
+    },
+
   }
   }
 };
 };
 </script>
 </script>

+ 138 - 138
src/views/his/storeOrder/order1.vue

@@ -50,7 +50,7 @@
             >
             >
               {{ code }}
               {{ code }}
             </el-tag>
             </el-tag>
-            
+
             <!-- 输入框 -->
             <!-- 输入框 -->
             <el-input
             <el-input
               ref="tagInput"
               ref="tagInput"
@@ -65,7 +65,7 @@
               @focus="inputVisible = true"
               @focus="inputVisible = true"
               clearable
               clearable
             />
             />
-            
+
             <!-- 添加按钮(当没有输入时显示) -->
             <!-- 添加按钮(当没有输入时显示) -->
             <el-button
             <el-button
               v-if="!inputVisible && queryParams.orderCodes.length > 0"
               v-if="!inputVisible && queryParams.orderCodes.length > 0"
@@ -78,11 +78,11 @@
               添加订单号
               添加订单号
             </el-button>
             </el-button>
           </div>
           </div>
-          
+
           <!-- 输入提示 -->
           <!-- 输入提示 -->
           <div class="input-tips">
           <div class="input-tips">
             <span class="tip-text">
             <span class="tip-text">
-              支持:回车、逗号、空格分隔 | 
+              支持:回车、逗号、空格分隔 |
               已添加 {{ queryParams.orderCodes.length }} 个订单号
               已添加 {{ queryParams.orderCodes.length }} 个订单号
               <span v-if="maxOrderCodes > 0"> (最多{{ maxOrderCodes }}个)</span>
               <span v-if="maxOrderCodes > 0"> (最多{{ maxOrderCodes }}个)</span>
             </span>
             </span>
@@ -220,7 +220,7 @@
                 />
                 />
               </el-select>
               </el-select>
       </el-form-item>
       </el-form-item>
-	 
+
       <el-form-item label="是否首次进线" prop="isFirst">
       <el-form-item label="是否首次进线" prop="isFirst">
         <el-select filterable v-model="queryParams.isFirst" placeholder="状态" clearable size="small">
         <el-select filterable v-model="queryParams.isFirst" placeholder="状态" clearable size="small">
                 <el-option
                 <el-option
@@ -414,7 +414,7 @@
               plain
               plain
               icon="el-icon-phone"
               icon="el-icon-phone"
               size="mini"
               size="mini"
-              
+
               @click="setErpPhone"
               @click="setErpPhone"
               v-hasPermi="['his:storeOrder:createErpOrder']"
               v-hasPermi="['his:storeOrder:createErpOrder']"
             >设置推送手机</el-button>
             >设置推送手机</el-button>
@@ -572,12 +572,12 @@
       <div v-if="currentSort.prop" class="sort-info">
       <div v-if="currentSort.prop" class="sort-info">
         <el-tag size="small" type="info" closable @close="clearSort">
         <el-tag size="small" type="info" closable @close="clearSort">
           <i class="el-icon-sort"></i>
           <i class="el-icon-sort"></i>
-          当前排序:{{ getSortLabel(currentSort.prop) }} 
+          当前排序:{{ getSortLabel(currentSort.prop) }}
           {{ currentSort.order === 'ascending' ? '升序' : '降序' }}
           {{ currentSort.order === 'ascending' ? '升序' : '降序' }}
         </el-tag>
         </el-tag>
-          <el-button 
-            type="text" 
-            size="mini" 
+          <el-button
+            type="text"
+            size="mini"
             @click="clearSort"
             @click="clearSort"
             style="margin-left: 8px; color: #909399;"
             style="margin-left: 8px; color: #909399;"
           >
           >
@@ -675,7 +675,7 @@
         <el-button @click="uploadStatus.open = false">取 消</el-button>
         <el-button @click="uploadStatus.open = false">取 消</el-button>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
-    
+
     <!-- 设置推送手机对话框 -->
     <!-- 设置推送手机对话框 -->
     <el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
     <el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
       <div style="margin-bottom: 20px;">
       <div style="margin-bottom: 20px;">
@@ -684,9 +684,9 @@
       <el-table :data="phoneList" border style="width: 100%">
       <el-table :data="phoneList" border style="width: 100%">
         <el-table-column prop="phone" label="手机号" align="center">
         <el-table-column prop="phone" label="手机号" align="center">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-input 
-              v-if="scope.row.editing" 
-              v-model="scope.row.phone" 
+            <el-input
+              v-if="scope.row.editing"
+              v-model="scope.row.phone"
               placeholder="请输入手机号"
               placeholder="请输入手机号"
               @blur="validatePhone(scope.row)"
               @blur="validatePhone(scope.row)"
               @keyup.enter.native="handleSavePhone(scope.$index)"
               @keyup.enter.native="handleSavePhone(scope.$index)"
@@ -696,27 +696,27 @@
         </el-table-column>
         </el-table-column>
         <el-table-column label="操作" align="center" width="300">
         <el-table-column label="操作" align="center" width="300">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-button 
-              v-if="scope.row.editing" 
-              type="success" 
-              size="mini" 
+            <el-button
+              v-if="scope.row.editing"
+              type="success"
+              size="mini"
               @click="handleSavePhone(scope.$index)"
               @click="handleSavePhone(scope.$index)"
             >保存</el-button>
             >保存</el-button>
-            <el-button 
-              v-if="scope.row.editing" 
-              type="info" 
-              size="mini" 
+            <el-button
+              v-if="scope.row.editing"
+              type="info"
+              size="mini"
               @click="handleCancelEdit(scope.$index)"
               @click="handleCancelEdit(scope.$index)"
             >取消</el-button>
             >取消</el-button>
-            <el-button 
-              v-if="!scope.row.editing" 
-              type="primary" 
-              size="mini" 
+            <el-button
+              v-if="!scope.row.editing"
+              type="primary"
+              size="mini"
               @click="handleEditPhone(scope.$index)"
               @click="handleEditPhone(scope.$index)"
             >修改</el-button>
             >修改</el-button>
-            <el-button 
-              type="danger" 
-              size="mini" 
+            <el-button
+              type="danger"
+              size="mini"
               @click="handleDeletePhone(scope.$index)"
               @click="handleDeletePhone(scope.$index)"
             >删除</el-button>
             >删除</el-button>
           </template>
           </template>
@@ -747,9 +747,9 @@
       <div v-loading="erpAccountDialog.loading">
       <div v-loading="erpAccountDialog.loading">
         <el-form :model="erpAccountForm" label-width="100px">
         <el-form :model="erpAccountForm" label-width="100px">
           <el-form-item label="ERP账户" required>
           <el-form-item label="ERP账户" required>
-            <el-select 
-              v-model="erpAccountForm.selectedAccount" 
-              placeholder="请选择ERP账户" 
+            <el-select
+              v-model="erpAccountForm.selectedAccount"
+              placeholder="请选择ERP账户"
               style="width: 100%"
               style="width: 100%"
               filterable
               filterable
             >
             >
@@ -765,7 +765,7 @@
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
         </el-form>
         </el-form>
-        
+
         <!-- 订单统计信息 -->
         <!-- 订单统计信息 -->
         <div class="order-summary" v-if="orderSummary">
         <div class="order-summary" v-if="orderSummary">
           <el-divider content-position="left">订单统计</el-divider>
           <el-divider content-position="left">订单统计</el-divider>
@@ -791,11 +791,11 @@
           </el-row>
           </el-row>
         </div>
         </div>
       </div>
       </div>
-      
+
       <div slot="footer" class="dialog-footer">
       <div slot="footer" class="dialog-footer">
         <el-button @click="cancelErpAccountDialog">取 消</el-button>
         <el-button @click="cancelErpAccountDialog">取 消</el-button>
-        <el-button 
-          type="primary" 
+        <el-button
+          type="primary"
           @click="confirmCreateErpOrder"
           @click="confirmCreateErpOrder"
           :disabled="!erpAccountForm.selectedAccount"
           :disabled="!erpAccountForm.selectedAccount"
           :loading="erpAccountDialog.submitting"
           :loading="erpAccountDialog.submitting"
@@ -811,12 +811,12 @@
           <el-button type="default" size="small" @click="unselectAllFields">全不选</el-button>
           <el-button type="default" size="small" @click="unselectAllFields">全不选</el-button>
           <el-button type="success" size="small" @click="selectDefaultFields">选择常用</el-button>
           <el-button type="success" size="small" @click="selectDefaultFields">选择常用</el-button>
         </div>
         </div>
-        
+
         <div class="field-selection-container">
         <div class="field-selection-container">
           <el-row :gutter="20">
           <el-row :gutter="20">
             <el-col :span="8" v-for="field in exportFieldOptions" :key="field.key">
             <el-col :span="8" v-for="field in exportFieldOptions" :key="field.key">
-              <el-checkbox 
-                v-model="field.checked" 
+              <el-checkbox
+                v-model="field.checked"
                 :label="field.label"
                 :label="field.label"
                 style="margin-bottom: 12px; width: 100%;"
                 style="margin-bottom: 12px; width: 100%;"
               >
               >
@@ -825,7 +825,7 @@
             </el-col>
             </el-col>
           </el-row>
           </el-row>
         </div>
         </div>
-        
+
         <div class="field-count-info" style="margin-top: 20px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
         <div class="field-count-info" style="margin-top: 20px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
           <i class="el-icon-info"></i>
           <i class="el-icon-info"></i>
           <span v-if="getSelectedFieldsCount() > 0">
           <span v-if="getSelectedFieldsCount() > 0">
@@ -837,11 +837,11 @@
           </span>
           </span>
         </div>
         </div>
       </div>
       </div>
-      
+
       <div slot="footer" class="dialog-footer">
       <div slot="footer" class="dialog-footer">
         <el-button @click="cancelExportFieldDialog">取 消</el-button>
         <el-button @click="cancelExportFieldDialog">取 消</el-button>
-        <el-button 
-          type="primary" 
+        <el-button
+          type="primary"
           @click="confirmExportFields"
           @click="confirmExportFields"
         >确认导出</el-button>
         >确认导出</el-button>
       </div>
       </div>
@@ -880,11 +880,11 @@ export default {
         prop: null,
         prop: null,
         order: null
         order: null
       },
       },
-      
+
       // 排序字段映射
       // 排序字段映射
       sortFieldMap: {
       sortFieldMap: {
         'companyUserName': '员工',
         'companyUserName': '员工',
-        'packageName': '套餐名称', 
+        'packageName': '套餐名称',
         'payPrice': '应收金额',
         'payPrice': '应收金额',
         'payMoney': '实收金额',
         'payMoney': '实收金额',
         'createTime': '下单时间'
         'createTime': '下单时间'
@@ -898,7 +898,7 @@ export default {
       },
       },
       // 输入框是否可见
       // 输入框是否可见
       inputVisible: false,
       inputVisible: false,
-      
+
       // 无效订单号对话框
       // 无效订单号对话框
       showInvalidDialog: false,
       showInvalidDialog: false,
       // 当前输入值
       // 当前输入值
@@ -937,7 +937,7 @@ export default {
               title:"订单详情",
               title:"订单详情",
               open:false,
               open:false,
             },
             },
-	  sourceOptions:[],		
+	  sourceOptions:[],
       importExpress: {
       importExpress: {
               // 是否显示弹出层
               // 是否显示弹出层
               open: false,
               open: false,
@@ -1226,13 +1226,13 @@ export default {
     // 新增排序处理方法
     // 新增排序处理方法
     handleSortChange({ column, prop, order }) {
     handleSortChange({ column, prop, order }) {
       console.log('排序变化:', { column, prop, order });
       console.log('排序变化:', { column, prop, order });
-      
+
       // 更新当前排序状态
       // 更新当前排序状态
       this.currentSort = {
       this.currentSort = {
         prop: prop,
         prop: prop,
         order: order
         order: order
       };
       };
-      
+
       // 更新查询参数
       // 更新查询参数
       if (order) {
       if (order) {
         this.queryParams.sortField = prop;
         this.queryParams.sortField = prop;
@@ -1241,11 +1241,11 @@ export default {
         this.queryParams.sortField = null;
         this.queryParams.sortField = null;
         this.queryParams.sortOrder = null;
         this.queryParams.sortOrder = null;
       }
       }
-      
+
       // 重新查询数据
       // 重新查询数据
       this.queryParams.pageNum = 1; // 重置到第一页
       this.queryParams.pageNum = 1; // 重置到第一页
       this.getList();
       this.getList();
-      
+
       // 显示排序提示
       // 显示排序提示
       if (order) {
       if (order) {
         const fieldLabel = this.getSortLabel(prop);
         const fieldLabel = this.getSortLabel(prop);
@@ -1253,12 +1253,12 @@ export default {
         this.$message.success(`已按${fieldLabel}${orderLabel}排序`);
         this.$message.success(`已按${fieldLabel}${orderLabel}排序`);
       }
       }
     },
     },
-    
+
     // 获取排序字段的中文标签
     // 获取排序字段的中文标签
     getSortLabel(prop) {
     getSortLabel(prop) {
       return this.sortFieldMap[prop] || prop;
       return this.sortFieldMap[prop] || prop;
     },
     },
-    
+
     // 清除排序
     // 清除排序
     clearSort() {
     clearSort() {
       this.currentSort = {
       this.currentSort = {
@@ -1281,38 +1281,38 @@ export default {
     // 修改查询列表方法,添加排序参数
     // 修改查询列表方法,添加排序参数
     getList() {
     getList() {
       this.loading = true;
       this.loading = true;
-      
+
       // 处理多选参数
       // 处理多选参数
       if(this.payTypeArr.length>0){
       if(this.payTypeArr.length>0){
         this.queryParams.payType=this.payTypeArr.toString();
         this.queryParams.payType=this.payTypeArr.toString();
       } else {
       } else {
         this.queryParams.payType=null
         this.queryParams.payType=null
       }
       }
-      
+
       if(this.scheduleIdArr.length>0){
       if(this.scheduleIdArr.length>0){
         this.queryParams.scheduleId=this.scheduleIdArr.toString();
         this.queryParams.scheduleId=this.scheduleIdArr.toString();
       } else {
       } else {
         this.queryParams.scheduleId=null
         this.queryParams.scheduleId=null
       }
       }
-      
+
       if(this.buyTypeArr.length>0){
       if(this.buyTypeArr.length>0){
         this.queryParams.orderBuyType=this.buyTypeArr.toString();
         this.queryParams.orderBuyType=this.buyTypeArr.toString();
       } else {
       } else {
         this.queryParams.orderbuyType=null
         this.queryParams.orderbuyType=null
       }
       }
-      
+
       if(this.channelArr.length>0){
       if(this.channelArr.length>0){
         this.queryParams.orderChannel=this.channelArr.toString();
         this.queryParams.orderChannel=this.channelArr.toString();
       } else {
       } else {
         this.queryParams.orderChannel=null
         this.queryParams.orderChannel=null
       }
       }
-      
+
       if(this.qwSubjectArr.length>0){
       if(this.qwSubjectArr.length>0){
         this.queryParams.qwSubject=this.qwSubjectArr.toString();
         this.queryParams.qwSubject=this.qwSubjectArr.toString();
       } else {
       } else {
         this.queryParams.qwSubject=null
         this.queryParams.qwSubject=null
       }
       }
-      
+
       // 处理公司参数
       // 处理公司参数
       if(this.companyIds && this.companyIds.length>1){
       if(this.companyIds && this.companyIds.length>1){
         this.queryParams.companyIds = this.companyIds
         this.queryParams.companyIds = this.companyIds
@@ -1322,16 +1322,16 @@ export default {
         this.queryParams.companyId = this.companyId
         this.queryParams.companyId = this.companyId
         this.queryParams.companyIds = null;
         this.queryParams.companyIds = null;
       }
       }
-      
+
       // 处理订单号数组
       // 处理订单号数组
       if (this.queryParams.orderCodes && this.queryParams.orderCodes.length > 0) {
       if (this.queryParams.orderCodes && this.queryParams.orderCodes.length > 0) {
         this.queryParams.orderCodeList = this.queryParams.orderCodes.join(',');
         this.queryParams.orderCodeList = this.queryParams.orderCodes.join(',');
       } else {
       } else {
         this.queryParams.orderCodeList = null;
         this.queryParams.orderCodeList = null;
       }
       }
-      
+
       console.log('查询参数:', this.queryParams);
       console.log('查询参数:', this.queryParams);
-      
+
       listOrder(this.queryParams).then(response => {
       listOrder(this.queryParams).then(response => {
         this.orderList = response.rows;
         this.orderList = response.rows;
         this.total = response.total;
         this.total = response.total;
@@ -1346,15 +1346,15 @@ export default {
           this.payRemainTotal = "0"
           this.payRemainTotal = "0"
           this.productInfo = response.productInfo;
           this.productInfo = response.productInfo;
         }
         }
-        
+
         this.loading = false;
         this.loading = false;
-        
+
         if(response.msg == 'jnmy'){
         if(response.msg == 'jnmy'){
           this.SFDFopen = true;
           this.SFDFopen = true;
         } else{
         } else{
           this.SFDFopen = false;
           this.SFDFopen = false;
         }
         }
-        
+
         // 如果有排序,显示排序结果提示
         // 如果有排序,显示排序结果提示
         if (this.currentSort.prop) {
         if (this.currentSort.prop) {
           const fieldLabel = this.getSortLabel(this.currentSort.prop);
           const fieldLabel = this.getSortLabel(this.currentSort.prop);
@@ -1370,72 +1370,72 @@ export default {
     // 处理键盘按下事件
     // 处理键盘按下事件
     handleKeyDown(event) {
     handleKeyDown(event) {
       const { key, target } = event
       const { key, target } = event
-      
+
       // 处理退格键删除标签
       // 处理退格键删除标签
       if (key === 'Backspace' && !target.value && this.queryParams.orderCodes.length > 0) {
       if (key === 'Backspace' && !target.value && this.queryParams.orderCodes.length > 0) {
         event.preventDefault()
         event.preventDefault()
         this.removeOrderCode(this.queryParams.orderCodes.length - 1)
         this.removeOrderCode(this.queryParams.orderCodes.length - 1)
       }
       }
-      
+
       // 处理分隔符
       // 处理分隔符
       if ([',', ',', ' ', 'Enter'].includes(key)) {
       if ([',', ',', ' ', 'Enter'].includes(key)) {
         event.preventDefault()
         event.preventDefault()
         this.handleInputConfirm()
         this.handleInputConfirm()
       }
       }
     },
     },
-    
+
     // 处理键盘抬起事件(实时分割输入)
     // 处理键盘抬起事件(实时分割输入)
     handleKeyUp(event) {
     handleKeyUp(event) {
       const value = event.target.value
       const value = event.target.value
-      
+
       // 检查是否包含分隔符
       // 检查是否包含分隔符
       if (/[,,\s]/.test(value)) {
       if (/[,,\s]/.test(value)) {
         this.handleInputConfirm()
         this.handleInputConfirm()
       }
       }
     },
     },
-    
+
     // 确认输入
     // 确认输入
     handleInputConfirm() {
     handleInputConfirm() {
       const inputValue = this.currentInput.trim()
       const inputValue = this.currentInput.trim()
-      
+
       if (inputValue) {
       if (inputValue) {
         // 分割多个订单号
         // 分割多个订单号
         const codes = inputValue.split(/[,,\s]+/).filter(code => code.trim())
         const codes = inputValue.split(/[,,\s]+/).filter(code => code.trim())
-        
+
         codes.forEach(code => {
         codes.forEach(code => {
           this.addOrderCode(code.trim())
           this.addOrderCode(code.trim())
         })
         })
       }
       }
-      
+
       this.currentInput = ''
       this.currentInput = ''
     },
     },
-    
+
     // 添加订单号
     // 添加订单号
     addOrderCode(code) {
     addOrderCode(code) {
       if (!code) return
       if (!code) return
-      
+
       // 检查数量限制
       // 检查数量限制
       if (this.maxOrderCodes > 0 && this.queryParams.orderCodes.length >= this.maxOrderCodes) {
       if (this.maxOrderCodes > 0 && this.queryParams.orderCodes.length >= this.maxOrderCodes) {
         this.$message.warning(`最多只能添加 ${this.maxOrderCodes} 个订单号`)
         this.$message.warning(`最多只能添加 ${this.maxOrderCodes} 个订单号`)
         return
         return
       }
       }
-      
+
       // 检查重复
       // 检查重复
       if (this.queryParams.orderCodes.includes(code)) {
       if (this.queryParams.orderCodes.includes(code)) {
         this.$message.warning(`订单号 "${code}" 已存在`)
         this.$message.warning(`订单号 "${code}" 已存在`)
         return
         return
       }
       }
-      
+
       // 添加到列表
       // 添加到列表
       this.queryParams.orderCodes.push(code)
       this.queryParams.orderCodes.push(code)
-      
+
     },
     },
-    
+
     // 删除订单号
     // 删除订单号
     removeOrderCode(index) {
     removeOrderCode(index) {
       this.queryParams.orderCodes.splice(index, 1)
       this.queryParams.orderCodes.splice(index, 1)
     },
     },
-    
+
     // 清空所有标签
     // 清空所有标签
     clearAllTags() {
     clearAllTags() {
       this.$confirm('确认清空所有订单号吗?', '提示', {
       this.$confirm('确认清空所有订单号吗?', '提示', {
@@ -1476,7 +1476,7 @@ export default {
       this.erpSettingType = 'push'
       this.erpSettingType = 'push'
       this.calculateOrderSummary();
       this.calculateOrderSummary();
     },
     },
-    
+
     //获取ERP账户列表
     //获取ERP账户列表
     async getErpAccountList() {
     async getErpAccountList() {
       try {
       try {
@@ -1494,7 +1494,7 @@ export default {
           this.$message.error(response.msg || '获取ERP账户列表失败');
           this.$message.error(response.msg || '获取ERP账户列表失败');
           this.erpAccountList = [];
           this.erpAccountList = [];
         }
         }
-        
+
       } catch (error) {
       } catch (error) {
         console.error('获取ERP账户列表失败:', error);
         console.error('获取ERP账户列表失败:', error);
         this.$message.error('获取ERP账户列表失败');
         this.$message.error('获取ERP账户列表失败');
@@ -1503,13 +1503,13 @@ export default {
         this.erpAccountDialog.loading = false;
         this.erpAccountDialog.loading = false;
       }
       }
     },
     },
-    
+
     // 新增:计算订单统计信息
     // 新增:计算订单统计信息
     calculateOrderSummary() {
     calculateOrderSummary() {
       let selectedCount = 0;
       let selectedCount = 0;
       let totalAmount = 0;
       let totalAmount = 0;
       let queryCount = this.total || 0;
       let queryCount = this.total || 0;
-      
+
       if (this.ids.length > 0) {
       if (this.ids.length > 0) {
         // 如果有选中的订单,统计选中的订单
         // 如果有选中的订单,统计选中的订单
         selectedCount = this.ids.length;
         selectedCount = this.ids.length;
@@ -1525,14 +1525,14 @@ export default {
           totalAmount += parseFloat(order.payMoney || 0);
           totalAmount += parseFloat(order.payMoney || 0);
         });
         });
       }
       }
-      
+
       this.orderSummary = {
       this.orderSummary = {
         selectedCount,
         selectedCount,
         totalAmount: totalAmount.toFixed(2),
         totalAmount: totalAmount.toFixed(2),
         queryCount
         queryCount
       };
       };
     },
     },
-    
+
     //确认创建ERP订单
     //确认创建ERP订单
     confirmCreateErpOrder() {
     confirmCreateErpOrder() {
       if (!this.erpAccountForm.selectedAccount) {
       if (!this.erpAccountForm.selectedAccount) {
@@ -1542,8 +1542,8 @@ export default {
       console.log("-----------------",this.erpSettingType)
       console.log("-----------------",this.erpSettingType)
       if(this.erpSettingType == 'set'){
       if(this.erpSettingType == 'set'){
         this.$confirm(
         this.$confirm(
-          `确认将订单设置ERP账户为"${this.erpAccountForm.selectedAccount}"吗?`, 
-          '确认', 
+          `确认将订单设置ERP账户为"${this.erpAccountForm.selectedAccount}"吗?`,
+          '确认',
           {
           {
             confirmButtonText: '确定',
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             cancelButtonText: '取消',
@@ -1554,8 +1554,8 @@ export default {
         });
         });
       } else if(this.erpSettingType == 'push'){
       } else if(this.erpSettingType == 'push'){
         this.$confirm(
         this.$confirm(
-          `确认将订单推送到ERP账户"${this.erpAccountForm.selectedAccount}"吗?`, 
-          '确认推送', 
+          `确认将订单推送到ERP账户"${this.erpAccountForm.selectedAccount}"吗?`,
+          '确认推送',
           {
           {
             confirmButtonText: '确定推送',
             confirmButtonText: '确定推送',
             cancelButtonText: '取消',
             cancelButtonText: '取消',
@@ -1569,12 +1569,12 @@ export default {
 
 
     async executSetErpOrder() {
     async executSetErpOrder() {
       this.erpAccountDialog.submitting = true;
       this.erpAccountDialog.submitting = true;
-      
+
       try {
       try {
         let param = {
         let param = {
           loginAccount: this.erpAccountForm.selectedAccount
           loginAccount: this.erpAccountForm.selectedAccount
         };
         };
-        
+
         if (this.ids.length > 0) {
         if (this.ids.length > 0) {
           // 如果有选中的订单,只推送选中的
           // 如果有选中的订单,只推送选中的
           param.orderIds = this.ids;
           param.orderIds = this.ids;
@@ -1605,11 +1605,11 @@ export default {
           } else {
           } else {
             this.queryParams.qwSubject = null;
             this.queryParams.qwSubject = null;
           }
           }
-          
+
           // 合并查询参数
           // 合并查询参数
           param = { ...param, ...this.queryParams };
           param = { ...param, ...this.queryParams };
         }
         }
-        
+
         const response = await batchSetErpOrder(param);
         const response = await batchSetErpOrder(param);
         if (response.code === 200) {
         if (response.code === 200) {
           this.$message.success('订单ERP账号设置成功');
           this.$message.success('订单ERP账号设置成功');
@@ -1626,16 +1626,16 @@ export default {
         this.erpAccountDialog.submitting = false;
         this.erpAccountDialog.submitting = false;
       }
       }
     },
     },
-    
+
     //执行创建ERP订单
     //执行创建ERP订单
     async executeCreateErpOrder() {
     async executeCreateErpOrder() {
       this.erpAccountDialog.submitting = true;
       this.erpAccountDialog.submitting = true;
-      
+
       try {
       try {
         let param = {
         let param = {
           loginAccount: this.erpAccountForm.selectedAccount
           loginAccount: this.erpAccountForm.selectedAccount
         };
         };
-        
+
         if (this.ids.length > 0) {
         if (this.ids.length > 0) {
           // 如果有选中的订单,只推送选中的
           // 如果有选中的订单,只推送选中的
           param.orderIds = this.ids;
           param.orderIds = this.ids;
@@ -1666,11 +1666,11 @@ export default {
           } else {
           } else {
             this.queryParams.qwSubject = null;
             this.queryParams.qwSubject = null;
           }
           }
-          
+
           // 合并查询参数
           // 合并查询参数
           param = { ...param, ...this.queryParams };
           param = { ...param, ...this.queryParams };
         }
         }
-        
+
         const response = await batchCreateErpOrder(param);
         const response = await batchCreateErpOrder(param);
         if (response.code === 200) {
         if (response.code === 200) {
           this.$message.success('ERP订单创建成功');
           this.$message.success('ERP订单创建成功');
@@ -1687,7 +1687,7 @@ export default {
         this.erpAccountDialog.submitting = false;
         this.erpAccountDialog.submitting = false;
       }
       }
     },
     },
-    
+
     // 新增:取消ERP账户选择对话框
     // 新增:取消ERP账户选择对话框
     cancelErpAccountDialog() {
     cancelErpAccountDialog() {
       this.erpAccountDialog.open = false;
       this.erpAccountDialog.open = false;
@@ -1737,7 +1737,7 @@ export default {
         param = this.queryParams;
         param = this.queryParams;
         param.erpPhone=this.erpPhoneValue;
         param.erpPhone=this.erpPhoneValue;
       }
       }
-      
+
       editErpPhone(param).then(response=>{
       editErpPhone(param).then(response=>{
         this.msgSuccess("修改成功");
         this.msgSuccess("修改成功");
         this.setPhoneOpen = false;
         this.setPhoneOpen = false;
@@ -1764,7 +1764,7 @@ export default {
             originalPhone: phone.trim()
             originalPhone: phone.trim()
           }));
           }));
         }
         }
-        
+
         // 保存原始数据用于取消操作
         // 保存原始数据用于取消操作
         this.originalPhoneList = this.phoneList;
         this.originalPhoneList = this.phoneList;
       });
       });
@@ -1795,7 +1795,7 @@ export default {
         return;
         return;
       }
       }
       // 检查是否重复
       // 检查是否重复
-      const duplicateIndex = this.phoneList.findIndex((item, idx) => 
+      const duplicateIndex = this.phoneList.findIndex((item, idx) =>
         idx !== index && item.phone === phone
         idx !== index && item.phone === phone
       );
       );
       if (duplicateIndex !== -1) {
       if (duplicateIndex !== -1) {
@@ -1846,17 +1846,17 @@ export default {
         this.$message.error('请先保存正在编辑的手机号');
         this.$message.error('请先保存正在编辑的手机号');
         return;
         return;
       }
       }
-      
+
       // 检查是否有空的手机号
       // 检查是否有空的手机号
       const emptyPhone = this.phoneList.find(item => !item.phone.trim());
       const emptyPhone = this.phoneList.find(item => !item.phone.trim());
       if (emptyPhone) {
       if (emptyPhone) {
         this.$message.error('存在空的手机号,请删除或填写完整');
         this.$message.error('存在空的手机号,请删除或填写完整');
         return;
         return;
       }
       }
-      
+
       // 构造手机号列表
       // 构造手机号列表
       const phoneList = this.phoneList.map(item => item.phone);
       const phoneList = this.phoneList.map(item => item.phone);
-      
+
       // 调用保存接口
       // 调用保存接口
       saveErpPhone(phoneList).then(response => {
       saveErpPhone(phoneList).then(response => {
         if (response.code === 200) {
         if (response.code === 200) {
@@ -1876,7 +1876,7 @@ export default {
       this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
       this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
       this.erpPhone.open = false;
       this.erpPhone.open = false;
     },
     },
-    
+
     handleImportExpress() {
     handleImportExpress() {
           this.importExpress.title = "导入";
           this.importExpress.title = "导入";
           this.importExpress.open = true;
           this.importExpress.open = true;
@@ -1911,7 +1911,7 @@ export default {
           this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
           this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
           this.getList();
           this.getList();
         },
         },
-        
+
         // 提交上传文件
         // 提交上传文件
         submitFileFormExpress() {
         submitFileFormExpress() {
           this.$refs.importExpress.submit();
           this.$refs.importExpress.submit();
@@ -2108,7 +2108,7 @@ export default {
       };
       };
       this.queryParams.sortField = null;
       this.queryParams.sortField = null;
       this.queryParams.sortOrder = null;
       this.queryParams.sortOrder = null;
-      
+
       // 清除订单号标签
       // 清除订单号标签
       this.queryParams.orderCodes = [];
       this.queryParams.orderCodes = [];
       this.currentInput = '';
       this.currentInput = '';
@@ -2120,7 +2120,7 @@ export default {
           this.$refs.orderTable.clearSort();
           this.$refs.orderTable.clearSort();
         }
         }
       });
       });
-      
+
       this.handleQuery();
       this.handleQuery();
     },
     },
     // 多选框选中数据
     // 多选框选中数据
@@ -2223,7 +2223,7 @@ export default {
         }).then(response => {
         }).then(response => {
 			console.log(response)
 			console.log(response)
 			if(response.code==200){
 			if(response.code==200){
-			
+
 			that.msgSuccess(response.msg);
 			that.msgSuccess(response.msg);
 			that.taskId=response.data;
 			that.taskId=response.data;
 			that.time=setInterval(function(){
 			that.time=setInterval(function(){
@@ -2245,7 +2245,7 @@ export default {
       // 打开字段选择对话框
       // 打开字段选择对话框
       this.exportFieldDialog.open = true;
       this.exportFieldDialog.open = true;
     },
     },
-    
+
     // 导出字段选择相关方法
     // 导出字段选择相关方法
     // 全选字段
     // 全选字段
     selectAllFields() {
     selectAllFields() {
@@ -2253,22 +2253,22 @@ export default {
         field.checked = true;
         field.checked = true;
       });
       });
     },
     },
-    
+
     // 全不选字段
     // 全不选字段
     unselectAllFields() {
     unselectAllFields() {
       this.exportFieldOptions.forEach(field => {
       this.exportFieldOptions.forEach(field => {
         field.checked = false;
         field.checked = false;
       });
       });
     },
     },
-    
+
     // 选择常用字段
     // 选择常用字段
     selectDefaultFields() {
     selectDefaultFields() {
       // 先全不选
       // 先全不选
       this.unselectAllFields();
       this.unselectAllFields();
       // 然后选择常用字段
       // 然后选择常用字段
-      const defaultFields = ['orderCode', 'prescribeCode', 'companyName', 'companyUserNickName', 
-                           'storeName', 'miniProgramName', 'userName', 'userPhone', 'userAddress', 'totalPrice', 
-                           'totalNum', 'payPrice', 'payMoney', 'createTime', 'payTime', 
+      const defaultFields = ['orderCode', 'prescribeCode', 'companyName', 'companyUserNickName',
+                           'storeName', 'miniProgramName', 'userName', 'userPhone', 'userAddress', 'totalPrice',
+                           'totalNum', 'payPrice', 'payMoney', 'createTime', 'payTime',
                            'payType', 'status', 'packageName', 'patientName'];
                            'payType', 'status', 'packageName', 'patientName'];
       this.exportFieldOptions.forEach(field => {
       this.exportFieldOptions.forEach(field => {
         if (defaultFields.includes(field.key)) {
         if (defaultFields.includes(field.key)) {
@@ -2276,22 +2276,22 @@ export default {
         }
         }
       });
       });
     },
     },
-    
+
     // 获取已选择字段数量
     // 获取已选择字段数量
     getSelectedFieldsCount() {
     getSelectedFieldsCount() {
       return this.exportFieldOptions.filter(field => field.checked).length;
       return this.exportFieldOptions.filter(field => field.checked).length;
     },
     },
-    
+
     // 取消导出字段选择
     // 取消导出字段选择
     cancelExportFieldDialog() {
     cancelExportFieldDialog() {
       this.exportFieldDialog.open = false;
       this.exportFieldDialog.open = false;
     },
     },
-    
+
     // 确认导出字段
     // 确认导出字段
     confirmExportFields() {
     confirmExportFields() {
       // 获取已选择的字段
       // 获取已选择的字段
       const selectedFieldsArray = this.exportFieldOptions.filter(field => field.checked);
       const selectedFieldsArray = this.exportFieldOptions.filter(field => field.checked);
-      
+
       let selectedFields = '';
       let selectedFields = '';
       if (selectedFieldsArray.length === 0) {
       if (selectedFieldsArray.length === 0) {
         // 如果没有选择任何字段,则导出全部字段(不传filter参数)
         // 如果没有选择任何字段,则导出全部字段(不传filter参数)
@@ -2300,51 +2300,51 @@ export default {
         // 如果选择了字段,则只导出选中的字段
         // 如果选择了字段,则只导出选中的字段
         selectedFields = selectedFieldsArray.map(field => field.key).join(',');
         selectedFields = selectedFieldsArray.map(field => field.key).join(',');
       }
       }
-      
+
       // 关闭弹窗
       // 关闭弹窗
       this.exportFieldDialog.open = false;
       this.exportFieldDialog.open = false;
-      
+
       // 执行导出操作
       // 执行导出操作
       this.doExportOrder(selectedFields);
       this.doExportOrder(selectedFields);
     },
     },
-    
+
     // 执行导出操作
     // 执行导出操作
     doExportOrder(selectedFields) {
     doExportOrder(selectedFields) {
       var that = this;
       var that = this;
-      
+
       // 处理查询参数
       // 处理查询参数
       if(this.payTypeArr.length>0){
       if(this.payTypeArr.length>0){
         this.queryParams.payType=this.payTypeArr.toString();
         this.queryParams.payType=this.payTypeArr.toString();
       } else {
       } else {
         this.queryParams.payType=null
         this.queryParams.payType=null
       }
       }
-      
+
       if(this.scheduleIdArr.length>0){
       if(this.scheduleIdArr.length>0){
         this.queryParams.scheduleId=this.scheduleIdArr.toString();
         this.queryParams.scheduleId=this.scheduleIdArr.toString();
       } else {
       } else {
         this.queryParams.scheduleId=null
         this.queryParams.scheduleId=null
       }
       }
-      
+
       if(this.buyTypeArr.length>0){
       if(this.buyTypeArr.length>0){
         this.queryParams.orderBuyType=this.buyTypeArr.toString();
         this.queryParams.orderBuyType=this.buyTypeArr.toString();
       } else {
       } else {
         this.queryParams.orderbuyType=null
         this.queryParams.orderbuyType=null
       }
       }
-      
+
       if(this.channelArr.length>0){
       if(this.channelArr.length>0){
         this.queryParams.orderChannel=this.channelArr.toString();
         this.queryParams.orderChannel=this.channelArr.toString();
       } else {
       } else {
         this.queryParams.orderChannel=null
         this.queryParams.orderChannel=null
       }
       }
-      
+
       if(this.qwSubjectArr.length>0){
       if(this.qwSubjectArr.length>0){
         this.queryParams.qwSubject=this.qwSubjectArr.toString();
         this.queryParams.qwSubject=this.qwSubjectArr.toString();
       } else {
       } else {
         this.queryParams.qwSubject=null
         this.queryParams.qwSubject=null
       }
       }
-      
+
       const queryParams = this.queryParams;
       const queryParams = this.queryParams;
-      
+
       // 根据是否选择字段显示不同的确认消息
       // 根据是否选择字段显示不同的确认消息
       let confirmMessage = '';
       let confirmMessage = '';
       if (selectedFields === null) {
       if (selectedFields === null) {
@@ -2353,21 +2353,21 @@ export default {
         const fieldCount = selectedFields.split(',').length;
         const fieldCount = selectedFields.split(',').length;
         confirmMessage = `确认导出选中的 ${fieldCount} 个字段的订单数据?`;
         confirmMessage = `确认导出选中的 ${fieldCount} 个字段的订单数据?`;
       }
       }
-      
+
       this.$confirm(confirmMessage, "确认导出", {
       this.$confirm(confirmMessage, "确认导出", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning"
         type: "warning"
       }).then(() => {
       }).then(() => {
         this.exportLoading = true;
         this.exportLoading = true;
-        
+
         // 构建请求参数
         // 构建请求参数
         const requestParams = {...queryParams};
         const requestParams = {...queryParams};
         // 只有当selectedFields不为null时才添加filter参数
         // 只有当selectedFields不为null时才添加filter参数
         if (selectedFields !== null) {
         if (selectedFields !== null) {
           requestParams.filter = selectedFields;
           requestParams.filter = selectedFields;
         }
         }
-        
+
         return exportOrder2(requestParams);
         return exportOrder2(requestParams);
       }).then(response => {
       }).then(response => {
         console.log(response)
         console.log(response)
@@ -2414,7 +2414,7 @@ export default {
           this.getTreeselect();
           this.getTreeselect();
         }
         }
       }
       }
-      
+
     },
     },
     // companyChange(val){
     // companyChange(val){
     //   console.log(val);
     //   console.log(val);
@@ -2578,15 +2578,15 @@ export default {
     min-width: auto;
     min-width: auto;
     width: 100%;
     width: 100%;
   }
   }
-  
+
   .tags-wrapper {
   .tags-wrapper {
     min-height: 40px;
     min-height: 40px;
   }
   }
-  
+
   .quick-actions {
   .quick-actions {
     flex-direction: column;
     flex-direction: column;
     align-items: flex-start;
     align-items: flex-start;
     gap: 8px;
     gap: 8px;
   }
   }
 }
 }
-</style>
+</style>

+ 3 - 1
src/views/hisStore/menu/index.vue

@@ -207,7 +207,9 @@ export default {
         {"dictLabel": "养生有道",
         {"dictLabel": "养生有道",
           "dictValue": "2"},
           "dictValue": "2"},
         {"dictLabel": "个人中心",
         {"dictLabel": "个人中心",
-          "dictValue": "3"}
+          "dictValue": "3"},
+        {"dictLabel": "主菜单-热销榜",
+          "dictValue": "4"}
       ],
       ],
       statusOptions:[],
       statusOptions:[],
       imageArr:[],
       imageArr:[],

+ 11 - 0
src/views/hisStore/storeOrder/healthStoreList.vue

@@ -463,6 +463,12 @@
             <el-tooltip content="按应收金额排序" placement="top"/>
             <el-tooltip content="按应收金额排序" placement="top"/>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
+
+      <el-table-column label="成本价格" align="center" prop="cost" v-if="showFinanceTableField"/>
+      <el-table-column label="结算价格" align="center" prop="fprice"  v-if="showFinanceTableField"/>
+      <el-table-column label="额外运费" align="center" prop="payPostage" v-if="showFinanceTableField"/>
+      <el-table-column label="商品编码" align="center" prop="barCode"  v-if="showFinanceTableField"/>
+      <el-table-column label="商品分类" align="center" prop="cateName" v-if="showFinanceTableField"/>
       <el-table-column align="center" label="下单时间" prop="createTime"/>
       <el-table-column align="center" label="下单时间" prop="createTime"/>
       <!-- <el-table-column label="支付状态" align="center" prop="paid" /> -->
       <!-- <el-table-column label="支付状态" align="center" prop="paid" /> -->
       <el-table-column align="center" label="支付时间" prop="payTime" width="180">
       <el-table-column align="center" label="支付时间" prop="payTime" width="180">
@@ -976,6 +982,7 @@ import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { getConfigByKey } from '@/api/system/config'
 import { getConfigByKey } from '@/api/system/config'
 import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
 import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
+import {checkPermi} from "@/utils/permission";
 
 
 export default {
 export default {
   components: { productOrder, productSelect, addUser, addUserAddress, Treeselect },
   components: { productOrder, productSelect, addUser, addUserAddress, Treeselect },
@@ -1238,6 +1245,7 @@ export default {
       ruleForm:{
       ruleForm:{
         miniAppId: null,
         miniAppId: null,
       },
       },
+      showFinanceTableField: false,
     }
     }
   },
   },
   created() {
   created() {
@@ -1266,6 +1274,9 @@ export default {
     this.getDicts('store_delivery_pay_status').then((response) => {
     this.getDicts('store_delivery_pay_status').then((response) => {
       this.deliveryPayStatusOptions = response.data
       this.deliveryPayStatusOptions = response.data
     })
     })
+    if (checkPermi(['his:storeAfterSales:finance'])) {
+      this.showFinanceTableField = true;
+    }
 
 
     this.getList()
     this.getList()
     this.getErpAccountList();
     this.getErpAccountList();

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

@@ -480,6 +480,12 @@
               <span v-if="scope.row.totalPrice!=null">{{scope.row.totalPrice.toFixed(2)}}</span>
               <span v-if="scope.row.totalPrice!=null">{{scope.row.totalPrice.toFixed(2)}}</span>
           </template>
           </template>
       </el-table-column>
       </el-table-column>
+
+      <el-table-column label="成本价格" align="center" prop="cost" v-if="showFinanceTableField"/>
+      <el-table-column label="结算价格" align="center" prop="fprice"  v-if="showFinanceTableField"/>
+      <el-table-column label="额外运费" align="center" prop="payPostage" v-if="showFinanceTableField"/>
+      <el-table-column label="商品编码" align="center" prop="barCode"  v-if="showFinanceTableField"/>
+      <el-table-column label="商品分类" align="center" prop="cateName" v-if="showFinanceTableField"/>
        <!-- <el-table-column label="应付金额" align="center" prop="payPrice" >
        <!-- <el-table-column label="应付金额" align="center" prop="payPrice" >
           <template slot-scope="scope">
           <template slot-scope="scope">
               <span v-if="scope.row.payPrice!=null">{{scope.row.payPrice.toFixed(2)}}</span>
               <span v-if="scope.row.payPrice!=null">{{scope.row.payPrice.toFixed(2)}}</span>
@@ -1023,6 +1029,7 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { getConfigByKey } from '@/api/system/config'
 import { getConfigByKey } from '@/api/system/config'
 import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
 import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
+import {checkPermi} from "@/utils/permission";
 
 
 export default {
 export default {
   components: { productOrder,productSelect,addUser,addUserAddress,Treeselect },
   components: { productOrder,productSelect,addUser,addUserAddress,Treeselect },
@@ -1290,6 +1297,7 @@ export default {
       ruleForm:{
       ruleForm:{
         miniAppId: null,
         miniAppId: null,
       },
       },
+      showFinanceTableField: false,
     };
     };
   },
   },
   created() {
   created() {
@@ -1330,6 +1338,9 @@ export default {
     getTcmScheduleList().then(response => {
     getTcmScheduleList().then(response => {
       this.scheduleOptions = response.data;
       this.scheduleOptions = response.data;
     });
     });
+    if (checkPermi(['his:storeAfterSales:finance'])) {
+      this.showFinanceTableField = true;
+    }
     this.getList();
     this.getList();
     this.getItemsNum();
     this.getItemsNum();
     this.getErpAccountList();
     this.getErpAccountList();

+ 7 - 7
src/views/hisStore/storeProduct/index.vue

@@ -553,13 +553,13 @@
           </el-form-item>
           </el-form-item>
         </div>
         </div>
         </div>
         </div>
-<!--        <el-row>-->
-<!--          <el-col :span="24">-->
-<!--            <el-form-item label="商品简介" prop="productInfo">-->
-<!--              <el-input v-model="form.productInfo" type="textarea" :rows="2" placeholder="请输入商品简介" />-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
-<!--        </el-row>-->
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="商品简介" prop="productInfo">
+              <el-input v-model="form.productInfo" type="textarea" :rows="2" placeholder="请输入商品简介" />
+            </el-form-item>
+          </el-col>
+        </el-row>
         <el-form-item label="商品图片" prop="image">
         <el-form-item label="商品图片" prop="image">
           <Material v-model="imageArr" type="image" :num="1" :width="150" :height="150" />
           <Material v-model="imageArr" type="image" :num="1" :width="150" :height="150" />
         </el-form-item>
         </el-form-item>

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

@@ -20,6 +20,7 @@
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:audit1']" v-show="afterSales.salesStatus==0&&afterSales.status===0" @click="handleAudit1">平台审核</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:audit1']" v-show="afterSales.salesStatus==0&&afterSales.status===0" @click="handleAudit1">平台审核</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:audit2']" v-show="afterSales.salesStatus==0&&afterSales.status===2" @click="handleAudit2">仓库审核</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:audit2']" v-show="afterSales.salesStatus==0&&afterSales.status===2" @click="handleAudit2">仓库审核</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:refund']" @click="handleRefund"  v-show="afterSales.salesStatus==0&&afterSales.status===3">财务审核</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:refund']" @click="handleRefund"  v-show="afterSales.salesStatus==0&&afterSales.status===3">财务审核</el-button>
+            <el-button size="mini"  v-hasPermi="['store:storeAfterSales:refund']" @click="handleImmediatelyRefund"  v-show="afterSales.salesStatus==0">立即退款</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:cancel']" @click="cancel"  v-show="afterSales.salesStatus==0">撤销</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:cancel']" @click="cancel"  v-show="afterSales.salesStatus==0">撤销</el-button>
             <el-button size="mini"  @click="showOrder">查看订单</el-button>
             <el-button size="mini"  @click="showOrder">查看订单</el-button>
           </div>
           </div>
@@ -208,7 +209,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import {getLiveAfterSales,cancel,refund,audit,updateLiveAfterSales,audit1,audit2 } from "@/api/live/liveAfterSales";
+import {getLiveAfterSales,cancel,refund,audit,updateLiveAfterSales,audit1,audit2,handleImmediatelyRefund } from "@/api/live/liveAfterSales";
 
 
 import productOrder from "./productOrder";
 import productOrder from "./productOrder";
 export default {
 export default {
@@ -327,6 +328,27 @@ export default {
       this.form.salesId=this.afterSales.id;
       this.form.salesId=this.afterSales.id;
       this.form.refundAmount=this.afterSales.refundAmount;
       this.form.refundAmount=this.afterSales.refundAmount;
     },
     },
+    handleImmediatelyRefund(){
+      let _this = this;
+       this.$confirm('确认立即退款吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+       
+        let param ={orderId:_this.order.orderId}
+        console.log(param)
+         debugger;
+        handleImmediatelyRefund(param).then(res=>{
+          _this.msgSuccess("操作成功");
+          _this.getLiveAfterSales(_this.afterSales.id);
+        }).catch(res=>{
+          console.log(res);
+        });
+      }).then(() => {
+        // this.getLiveAfterSales(id);
+      }).catch(function() {});
+    },
     handleAudit1(){
     handleAudit1(){
       var id=this.afterSales.id;
       var id=this.afterSales.id;
       this.$confirm('确定审请通过?', "警告", {
       this.$confirm('确定审请通过?', "警告", {

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

@@ -183,7 +183,7 @@
             size="mini"
             size="mini"
             type="text"
             type="text"
             @click="handleShow(scope.row)"
             @click="handleShow(scope.row)"
-            v-hasPermi="['store:storeAfterSales:query']"
+            v-hasPermi="['live:liveAfterSales:query']"
           >查看</el-button>
           >查看</el-button>
 
 
         </template>
         </template>

+ 3 - 0
src/views/live/liveOrder/index.vue

@@ -229,6 +229,9 @@
       <el-table-column label="销售价格" align="center" prop="totalPrice" />
       <el-table-column label="销售价格" align="center" prop="totalPrice" />
       <el-table-column label="成本价格" align="center" prop="costPrice" v-if="showFinanceTableField"/>
       <el-table-column label="成本价格" align="center" prop="costPrice" v-if="showFinanceTableField"/>
       <el-table-column label="结算价格" align="center" prop="fprice"  v-if="showFinanceTableField"/>
       <el-table-column label="结算价格" align="center" prop="fprice"  v-if="showFinanceTableField"/>
+      <el-table-column label="额外运费" align="center" prop="payDelivery" v-if="showFinanceTableField"/>
+      <el-table-column label="商品编码" align="center" prop="barCode"  v-if="showFinanceTableField"/>
+      <el-table-column label="商品分类" align="center" prop="cateName" v-if="showFinanceTableField"/>
       <el-table-column label="成交价" align="center" prop="payMoney"/>
       <el-table-column label="成交价" align="center" prop="payMoney"/>
       <el-table-column label="收货地址" align="center" prop="userAddress" width="200" />
       <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="supplierName" width="120" />

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

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

+ 342 - 2
src/views/system/config/config.vue

@@ -730,6 +730,16 @@
       <el-tab-pane label="短信配置" name="his.sms">
       <el-tab-pane label="短信配置" name="his.sms">
 
 
         <el-form ref="form14" :model="form14" label-width="150px">
         <el-form ref="form14" :model="form14" label-width="150px">
+          <el-form-item label="是否开启APP短信验证" label-width="160px">
+            <el-switch
+              v-model="form14.isSmsVerification"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+              active-value="1"
+              inactive-value="0"
+            >
+            </el-switch>
+          </el-form-item>
           <el-form-item label="短信服务商" prop="type">
           <el-form-item label="短信服务商" prop="type">
             <el-radio-group v-model="form14.type">
             <el-radio-group v-model="form14.type">
               <el-radio label="rf">重庆润芳</el-radio>
               <el-radio label="rf">重庆润芳</el-radio>
@@ -2245,6 +2255,107 @@
         </el-form>
         </el-form>
       </el-tab-pane>
       </el-tab-pane>
 
 
+      <el-tab-pane label="拼手气红包配置" name="randomRedpacket:config">
+        <el-form ref="form29" :model="form29" label-width="150px">
+          <el-form-item label="是否开启拼手气红包" prop="enableRandomRedpacket">
+          
+            <el-switch
+              v-model="form29.enableRandomRedpacket"
+              active-color="#13ce66"
+              inactive-color="#ff4949">
+            </el-switch>
+          </el-form-item>
+        <div v-if="!!form29.enableRandomRedpacket" style=" display: flex;
+                  flex-direction: column;
+                  margin-bottom: 50px;">
+                   
+             <div v-for="(rule, index) in form29.rules" :key="index" class="form-row">
+              
+           <el-form-item
+            label="金额区间"
+            :prop="`rules.${index}.minAmount`"
+            :rules="[
+              { required: true, message: '请输入最小金额', trigger: 'blur' },
+              { validator: validateMinAmount, trigger: 'blur', index: index }
+            ]"
+            class="form-item-amount"
+          >
+            <el-input
+              v-model.number="rule.minAmount"
+              type="number"
+              :min="0.01"
+              :precision="2"
+              :step="0.01"
+              placeholder="最小金额"
+              size="small"
+              class="amount-input"
+              @input="handleAmountInput(rule, 'minAmount')"
+            ></el-input>
+            <span class="separator">-</span>
+            <el-input
+              v-model.number="rule.maxAmount"
+              type="number"
+              :min="rule.minAmount || 0.01"
+              :precision="2"
+              :step="0.01"
+              placeholder="最大金额"
+              size="small"
+              class="amount-input"
+              @input="handleAmountInput(rule, 'maxAmount')"
+            ></el-input>
+            <span class="suffix">元</span>
+          </el-form-item>
+
+              <el-form-item
+                label="随机权重"
+                :prop="`rules.${index}.weight`"
+                :rules="[
+                  { required: true, message: '请输入权重', trigger: 'blur' },
+                  { type: 'integer', message: '权重必须为整数', trigger: 'blur' },
+                ]"
+                class="form-item-weight"
+              >
+                <el-input
+                  v-model.number="rule.weight"
+                  type="number"
+                  :min="1"
+                  placeholder="权重"
+                  size="small"
+                ></el-input>
+              </el-form-item>
+              <el-tooltip class="item" effect="dark" content="权重越高,被随机到的概率越大" placement="top">
+                <i class="el-icon-question"></i>
+              </el-tooltip>
+              <div class="action-buttons">
+                <el-button
+                  icon="el-icon-plus"
+                  size="mini"
+                  type="text"
+                  @click="addRule(index)"
+                  class="add-btn"
+                >
+                  新增
+                </el-button>
+                <el-button
+                  icon="el-icon-delete"
+                  size="mini"
+                  type="text"
+                  @click="deleteRule(index)"
+                  :disabled="form29.rules.length <= 1"
+                  class="delete-btn"
+                >
+                  删除
+                </el-button>
+              </div>
+            </div>
+        </div>
+
+          <div class="footer" style="margin-top:20px">
+            <el-button type="primary" @click="submitForm29">提 交</el-button>
+          </div>
+        </el-form>
+      </el-tab-pane>
+
     </el-tabs>
     </el-tabs>
 
 
 
 
@@ -2423,6 +2534,18 @@ export default {
       },
       },
       form27: {},
       form27: {},
       form28: {},
       form28: {},
+      form29:{
+        //是否开启拼手气红包
+        enableRandomRedpacket:false,
+         rules: [
+          {
+            minAmount: 0.01,
+            maxAmount: 0.01,
+            weight: 100,
+          },
+        ],
+
+      },
       storeProductScrmColumns:[],
       storeProductScrmColumns:[],
       storeScrmColumns: [],
       storeScrmColumns: [],
       photoArr: [],
       photoArr: [],
@@ -2509,7 +2632,15 @@ export default {
     },
     },
     appImages: function(val) {
     appImages: function(val) {
       this.form25.images = val.join(',')
       this.form25.images = val.join(',')
-    }
+    },
+     // 深度监听 rules 数组的变化,以更新总权重
+    "form29.rules": {
+      handler(val) {
+        this.calculateTotalWeight();
+        this.validateRules();
+      },
+      deep: true,
+    },
   },
   },
   methods: {
   methods: {
 
 
@@ -2661,8 +2792,13 @@ export default {
     },
     },
     getConfigByKey(key) {
     getConfigByKey(key) {
       getConfigByKey(key).then(response => {
       getConfigByKey(key).then(response => {
+        if(!!response.data){
         this.configId = response.data.configId
         this.configId = response.data.configId
         this.configKey = response.data.configKey
         this.configKey = response.data.configKey
+        }else{
+            this.configId = null;
+            this.configKey = key;
+          }
         if (key == 'sys.oss.cloudStorage') {
         if (key == 'sys.oss.cloudStorage') {
           this.form1 = JSON.parse(response.data.configValue)
           this.form1 = JSON.parse(response.data.configValue)
         }
         }
@@ -2797,6 +2933,13 @@ export default {
           this.configKey = response.data.configKey
           this.configKey = response.data.configKey
           this.form28 = {...this.form28, ...JSON.parse(response.data.configValue)}
           this.form28 = {...this.form28, ...JSON.parse(response.data.configValue)}
         }
         }
+        if (key == 'randomRedpacket:config') {
+          if(!!response.data){
+          this.configId = response.data.configId
+          this.configKey = response.data.configKey
+          this.form29 = {...this.form29, ...JSON.parse(response.data.configValue)}
+          }
+        }
       })
       })
     },
     },
     /** 提交按钮 */
     /** 提交按钮 */
@@ -2927,6 +3070,9 @@ export default {
       })
       })
     },
     },
     submitForm14() {
     submitForm14() {
+      if (!this.form14.isSmsVerification) {
+        this.form14.isSmsVerification = 0;
+      }
       var param = { configId: this.configId, configValue: JSON.stringify(this.form14) }
       var param = { configId: this.configId, configValue: JSON.stringify(this.form14) }
       updateConfigByKey(param).then(response => {
       updateConfigByKey(param).then(response => {
         if (response.code === 200) {
         if (response.code === 200) {
@@ -3149,7 +3295,104 @@ export default {
     },
     },
     removeDisabledTime(index) {
     removeDisabledTime(index) {
       this.form18.disabledTimeList.splice(index, 1)
       this.form18.disabledTimeList.splice(index, 1)
-    }
+    },
+    submitForm29(){
+      console.log("开始校验")
+       this.$refs['form29'].validate(valid => {
+        if (valid) {
+          var param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form29) }
+          console.log(param)
+          param.configName = "拼手气红包配置";
+          updateConfigByKey(param).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess('修改成功')
+            }
+          })
+        }
+      })
+    },
+     calculateTotalWeight() {
+      this.totalWeight = this.form29.rules.reduce((sum, rule) => {
+        return sum + (rule.weight || 0);
+      }, 0);
+    },
+
+    validateRules() {
+      this.form29.rules.forEach((rule) => {
+        if (rule.minAmount === undefined || rule.minAmount < 0.01) {
+          rule.minAmount = 0.01;
+        }
+        if (rule.maxAmount === undefined || rule.maxAmount < rule.minAmount) {
+          rule.maxAmount = rule.minAmount;
+        }
+        if (rule.weight === undefined || rule.weight < 1) {
+          rule.weight = 1;
+        }
+      });
+    },
+
+    // 自定义校验规则:确保最大金额大于最小金额
+    validateMinAmount(rule, value, callback) {
+      // debugger;
+      // const maxAmount = this.form29.rules[].maxAmount
+      
+      const index = rule.index;
+      const maxAmount = this.form29.rules[index].maxAmount;
+
+      if (value > maxAmount) {
+        callback(new Error("最小金额不能大于最大金额"));
+      } else {
+        callback();
+      }
+    },
+
+    addRule(index) {
+      // 在当前行的后面插入一个新行
+      this.form29.rules.splice(index + 1, 0, {
+        minAmount: 0.01,
+        maxAmount: 0.01,
+        weight: 100,
+      });
+    },
+
+    deleteRule(index) {
+      this.$confirm("确定要删除这个区间吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.form29.rules.splice(index, 1);
+        this.$message({
+          type: "success",
+          message: "删除成功!",
+        });
+      });
+    },
+     // 实时过滤金额输入,只允许两位小数
+    handleAmountInput(rule, field) {
+      let value = rule[field];
+      if (value === null || value === undefined) return;
+      
+      // 转换为字符串处理
+      let str = value.toString();
+      
+      // 移除除数字和小数点外的所有字符
+      str = str.replace(/[^0-9.]/g, '');
+      
+      // 只保留一个小数点
+      const dotIndex = str.indexOf('.');
+      if (dotIndex !== -1) {
+        str = str.substring(0, dotIndex + 1) + str.substring(dotIndex + 1).replace(/\./g, '');
+      }
+      
+      // 限制小数点后最多两位
+      if (dotIndex !== -1 && str.length > dotIndex + 3) {
+        str = str.substring(0, dotIndex + 3);
+      }
+      
+      // 转换回数字并更新
+      rule[field] = parseFloat(str) || 0;
+    },
   }
   }
 }
 }
 </script>
 </script>
@@ -3161,4 +3404,101 @@ export default {
   align-items: flex-end;
   align-items: flex-end;
   justify-content: flex-end;
   justify-content: flex-end;
 }
 }
+
+
+
+
+.red-packet-config {
+  padding: 20px;
+}
+
+.card-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.red-packet-form {
+  margin-top: 20px;
+}
+
+/* 每一行的样式 */
+.form-row {
+  display: flex;
+  /* align-items: center;
+  padding: 10px;
+  border-bottom: 1px solid #ebeef5; */
+   display: flex;
+  /* 关键改动:添加以下两行 */
+  align-items: center;    /* 垂直居中对齐 */
+  justify-content: flex-start; /* 水平方向从左到右排列(默认值,可显式写出) */
+  
+  padding: 10px;
+  border-bottom: 1px solid #ebeef5;
+}
+
+/* 最后一行去掉下边框 */
+.form-row:last-child {
+  border-bottom: none;
+}
+
+.form-item-amount {
+  flex: 1;
+  margin-right: 20px;
+}
+
+.form-item-weight {
+  width: 220px;
+  margin-right: 20px;
+}
+
+.action-buttons {
+  display: flex;
+  align-items: center;
+}
+
+.amount-input {
+  width: 100px !important;
+  text-align: center;
+}
+
+/* 金额输入框之间的连接符 */
+.separator {
+  margin: 0 10px;
+  color: #999;
+}
+
+.suffix {
+  margin-left: 10px;
+  color: #999;
+}
+
+.add-btn {
+  /* color: #48bb78 !important; */
+}
+
+.delete-btn {
+  color: #f56c6c !important;
+}
+
+.rules-info {
+  margin-top: 20px;
+  padding: 15px;
+  background-color: #f9f9f9;
+  border-radius: 4px;
+  font-size: 14px;
+  color: #666;
+}
+
+.info-number {
+  color: #1890ff;
+  font-weight: bold;
+  margin: 0 4px;
+}
+
+.action-bar {
+  margin-top: 20px;
+  display: flex;
+  justify-content: flex-end;
+}
 </style>
 </style>