瀏覽代碼

直播优化

yuhongqi 1 月之前
父節點
當前提交
2cf6f4979e

+ 17 - 16
src/views/company/components/companyProfit.vue

@@ -1,10 +1,9 @@
 <template>
   <div class="order-content">
       <div class="order-status" v-if="profit!=null" >
-          <el-steps  :active="profit.profitStatus==4?profit.profitStatus:profit.profitStatus-1" align-center>
+          <el-steps  :active="getStepActive(profit.profitStatus)" align-center>
             <el-step title="待商务审核"></el-step>
             <el-step title="待财务审核"></el-step>
-            <el-step title="待支付"></el-step>
             <el-step title="已完成"></el-step>
           </el-steps>
       </div>
@@ -23,9 +22,6 @@
         <div class="operate-button-container" >
           <el-button size="mini" @click="handleAudit(2)" v-if="profit.profitStatus==2"  v-hasPermi="['company:companyProfit:audit2']" >财务审核</el-button>
         </div>
-        <div class="operate-button-container" >
-          <el-button size="mini" @click="handleAudit(3)" v-if="profit.profitStatus==3"  v-hasPermi="['company:companyProfit:audit3']" >付款</el-button>
-        </div>
 
       </div>
       <div style="margin-top: 20px"  v-if="profit!=null">
@@ -110,7 +106,7 @@
              <el-radio  :label="0">驳回</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="凭证" prop="profitStatus" v-if="profit.profitStatus==3">
+        <el-form-item label="凭证" prop="imgUrl" v-if="type==2 && form.status==1">
             <el-upload
               v-model="form.imgUrl"
               class="avatar-uploader"
@@ -135,7 +131,7 @@
 </template>
 
 <script>
-import { audit1,audit2,audit3, getCompanyProfit, delCompanyProfit, addCompanyProfit, updateCompanyProfit, exportCompanyProfit } from "@/api/company/companyProfit";
+import { audit1,audit2, getCompanyProfit, delCompanyProfit, addCompanyProfit, updateCompanyProfit, exportCompanyProfit } from "@/api/company/companyProfit";
 
 export default {
   name: "profit",
@@ -167,6 +163,18 @@ export default {
     });
   },
   methods: {
+    // 获取步骤条激活索引
+    getStepActive(profitStatus) {
+      // 状态映射:1=待商务审核(步骤0), 2=待财务审核(步骤1), 4=已完成(步骤2)
+      if (profitStatus == 1) {
+        return 0; // 待商务审核
+      } else if (profitStatus == 2) {
+        return 1; // 待财务审核
+      } else if (profitStatus == 4) {
+        return 3; // 已完成
+      }
+      return 0; // 默认返回第一个步骤
+    },
     handleSuccess(res, file) {
         if(res.code==200){
           this.form.imgUrl=res.url;
@@ -187,6 +195,8 @@ export default {
       this.type=auditType;
       this.open = true;
       this.form.remark = null;
+      this.form.imgUrl = null;
+      this.form.status = 1;
       this.title = "审核提现";
     },
     /** 提交按钮 */
@@ -214,15 +224,6 @@ export default {
               }
             });
           }
-          if(this.type==3){
-            audit3(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("审核成功");
-                this.open = false;
-                this.getData(this.companyName,this.profitId);
-              }
-            });
-          }
 
         }
       });

+ 43 - 7
src/views/live/liveAfteraSales/index.vue

@@ -144,6 +144,7 @@
           v-model="dateRange"
           type="daterange"
           value-format="yyyy-MM-dd"
+          @change="handlePayTimeChange"
           start-placeholder="开始日期"
           end-placeholder="结束日期">
         </el-date-picker>
@@ -291,7 +292,8 @@ export default {
         deliverySn: null,
         deliveryName: null,
         status: null,
-        Status: null,
+        salesStatus: null,            // 售后状态
+        orderStatus: null,            // 订单状态
         isDel: null,
         userId: null,
         consignee: null,
@@ -303,7 +305,7 @@ export default {
         companyUserNickName: null,    // 新增员工姓名
         deliveryStatus: null,         // 物流状态,确认是否接口支持
         createTimeBegin: null,        // 创建时间起
-        createTimeEnd: null,          // 创
+        createTimeEnd: null,          // 创建时间止
         userPhone: null
       },
       // 表单参数
@@ -339,13 +341,24 @@ export default {
     this.getDicts("store_order_delivery_status").then((response) => {
       this.deliveryStatusOptions = response.data;
     });
-    this.getDicts("store_order_status").then((response) => {
+    this.getDicts("sys_live_order_status").then((response) => {
       this.orderStatusOptions = response.data;
     });
 
     this.getList();
   },
   methods: {
+    // 支付时间范围选择变化处理
+    handlePayTimeChange(value) {
+      if (value && value.length === 2) {
+        // 提取日期部分(yyyy-MM-dd),mapper会在SQL中拼接时间部分
+        this.queryParams.beginTime = value[0].substring(0, 10);
+        this.queryParams.endTime = value[1].substring(0, 10);
+      } else {
+        this.queryParams.beginTime = null;
+        this.queryParams.endTime = null;
+      }
+    },
     handleShow(row){
       this.title="售后订单"
       this.open=true;
@@ -356,11 +369,12 @@ export default {
     /** 查询售后记录列表 */
     getList() {
       this.loading = true;
+      // 处理日期范围
+      // const params = this.addDateRange(this.queryParams, this.dateRange);
       listLiveAfterSales(this.queryParams).then(response => {
         this.liveAfterSalesList = response.rows;
         this.total = response.total;
         this.loading = false;
-        delete this.queryParams[this.searchType];
       });
     },
     // 取消按钮
@@ -407,16 +421,33 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      // 处理物流单号搜索
       if(this.searchKey!=='' && this.searchType=='deliverySn'){
-       this.queryParams[this.searchType]=this.searchKey
+        this.queryParams.deliverySn = this.searchKey;
+      } else if(this.searchType=='deliverySn') {
+        this.queryParams.deliverySn = null;
+      }
+      // 处理物流状态搜索
+      if(this.searchType=='deliveryStatus' && this.queryParams.deliveryStatus) {
+        // deliveryStatus已经在queryParams中,不需要额外处理
       }
       this.queryParams.pageNum = 1;
       this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.searchKey= '';
-      this.queryParams[this.searchType]=null;
+      this.searchKey = '';
+      this.searchType = '';
+      this.dateRange = [];
+      // 重置搜索相关的参数
+      if(this.queryParams.deliverySn) {
+        this.queryParams.deliverySn = null;
+      }
+      if(this.queryParams.deliveryStatus) {
+        this.queryParams.deliveryStatus = null;
+      }
+      this.queryParams.beginTime = null;
+      this.queryParams.endTime = null;
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -478,7 +509,12 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
+      // 处理日期范围和搜索条件
       const queryParams = this.queryParams;
+      // 确保导出时包含所有搜索条件
+      if(this.searchKey!=='' && this.searchType=='deliverySn'){
+        queryParams.deliverySn = this.searchKey;
+      }
       this.$confirm('是否确认导出所有售后记录数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",

+ 20 - 27
src/views/live/liveConsole/index.vue

@@ -1063,41 +1063,34 @@ export default {
       })
     },
     loadMsgList() {
-      // 直播间消息
+      // 直播间消息 - 只加载最近的30条
       listLiveMsg({
         liveId:this.liveId,
-        pageNum: this.msgParams.pageNum,
-        pageSize: this.msgParams.pageSize
+        pageNum: 1,
+        pageSize: 30
       }).then(response => {
-          let {code, rows,total} = response;
+          let {code, rows} = response;
           if (code === 200) {
-            let totalPage = (total % this.msgParams.pageSize == 0) ? Math.floor(total / this.msgParams.pageSize) : Math.floor(total / this.msgParams.pageSize + 1);
-            rows.forEach(row => {
-              if (!this.msgList.some(m => m.msgId === row.msgId)) {
-
-                let user = this.userList.find(u => u.userId === row.userId)
-                if (user) {
-                  row.msgStatus = user.msgStatus
-                } else {
-                  row.msgStatus = 0
-                }
-
-                this.msgList.push(row)
+            // 清空现有消息列表,只保留最新的30条
+            this.msgList = [];
 
-                // 移动到底部
-                this.$nextTick(() => {
-                  setTimeout(() => {
-                    this.$refs.manageRightRef.wrap.scrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
-                  }, 200)
-                })
+            rows.forEach(row => {
+              let user = this.userList.find(u => u.userId === row.userId)
+              if (user) {
+                row.msgStatus = user.msgStatus
+              } else {
+                row.msgStatus = 0
               }
+
+              this.msgList.push(row)
             })
 
-            // 没加载完继续加载
-            if (this.msgParams.pageNum < totalPage) {
-              this.msgParams.pageNum = parseInt(this.msgParams.pageNum) + 1;
-              this.loadMsgList()
-            }
+            // 移动到底部
+            this.$nextTick(() => {
+              setTimeout(() => {
+                this.$refs.manageRightRef.wrap.scrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
+              }, 200)
+            })
 
             // 同步更新消息列表中相同用户的状态
             this.userList.forEach(u => {

+ 19 - 41
src/views/live/liveOrder/index.vue

@@ -168,28 +168,15 @@
     <el-form-item label="支付时间">
       <el-date-picker
         v-model="payTimeRange"
-        type="datetimerange"
+        type="daterange"
         size="small"
         clearable
-        value-format="yyyy-MM-dd HH:mm:ss"
+        value-format="yyyy-MM-dd"
         range-separator="至"
         start-placeholder="开始时间"
         end-placeholder="结束时间"
         @change="handlePayTimeChange"
       />
-    </el-form-item>
-    <el-form-item label="完成时间">
-      <el-date-picker
-        v-model="finishTimeRange"
-        type="datetimerange"
-        size="small"
-        clearable
-        value-format="yyyy-MM-dd HH:mm:ss"
-        range-separator="至"
-        start-placeholder="开始时间"
-        end-placeholder="结束时间"
-        @change="handleFinishTimeChange"
-      />
     </el-form-item>
       </div>
     </el-form>
@@ -321,8 +308,6 @@ export default {
 
       // 支付时间范围选择器绑定的值
       payTimeRange: [],
-      // 完成时间范围选择器绑定的值
-      finishTimeRange: [],
       // 发货时间范围选择器绑定的值
       deliverySendTimeRange: [],
 
@@ -346,8 +331,6 @@ export default {
         // 移除单个时间字段,改为范围字段
         payStartTime: null,
         payEndTime: null,
-        finishTimeStart: null,
-        finishTimeEnd: null,
         status: null,
         companyUserName: null,
       },
@@ -370,7 +353,8 @@ export default {
     });
     this.queryParams.liveId = this.$route.query.liveId
     this.getList();
-    this.getDicts("sys_live_order_status").then(response => {
+    // this.getDicts("sys_live_order_status").then(response => {
+    this.getDicts("sys_order_status").then(response => {
       this.orderStatusOptions = response.data;
     });
     this.getDicts("sys_order_status").then(response => {
@@ -389,31 +373,22 @@ export default {
     // 支付时间范围选择变化处理
     handlePayTimeChange(value) {
       if (value && value.length === 2) {
-        this.queryParams.payStartTime = value[0] + ' 00:00:00';
-        this.queryParams.payEndTime = value[1] + ' 23:59:59';
+        // 提取日期部分(yyyy-MM-dd),mapper会在SQL中拼接时间部分
+        this.queryParams.payStartTime = value[0].substring(0, 10);
+        this.queryParams.payEndTime = value[1].substring(0, 10);
       } else {
         this.queryParams.payStartTime = null;
         this.queryParams.payEndTime = null;
       }
     },
-
-    // 完成时间范围选择变化处理
-    handleFinishTimeChange(value) {
-      if (value && value.length === 2) {
-        this.queryParams.finishTimeStart = value[0] + ' 00:00:00';
-        this.queryParams.finishTimeEnd = value[1] + ' 23:59:59';
-      } else {
-        this.queryParams.finishTimeStart = null;
-        this.queryParams.finishTimeEnd = null;
-      }
-    },
     // 发货时间范围选择变化处理
     handleDeliveryTimeChange(value) {
       if (value && value.length === 2) {
-        this.queryParams.deliverySendTimeStart = value[0] + ' 00:00:00';
-        this.queryParams.deliverySendTimeEnd = value[1] + ' 23:59:59';
+        // 提取日期部分(yyyy-MM-dd),mapper会在SQL中拼接时间部分
+        this.queryParams.deliverySendTimeStart = value[0].substring(0, 10);
+        this.queryParams.deliverySendTimeEnd = value[1].substring(0, 10);
       } else {
-        this.queryParams.eliverySendTimeStart = null;
+        this.queryParams.deliverySendTimeStart = null;
         this.queryParams.deliverySendTimeEnd = null;
       }
     },
@@ -444,7 +419,6 @@ export default {
         this.liveOrderList = response.rows;
         this.total = response.total;
         this.loading = false;
-        delete this.queryParams[this.searchType];
       });
     },
 
@@ -460,8 +434,12 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      // 处理物流信息搜索
       if(this.searchKey!=='' && this.searchType!==''){
-       this.queryParams[this.searchType]=this.searchKey
+        this.queryParams[this.searchType] = this.searchKey;
+      } else if(this.searchType!=='') {
+        // 如果搜索框为空,清空对应的查询参数
+        this.queryParams[this.searchType] = null;
       }
       this.queryParams.pageNum = 1;
       this.getList();
@@ -472,14 +450,14 @@ export default {
       this.resetForm("queryForm");
       // 同时清空范围选择器的值
       this.payTimeRange = [];
-      this.finishTimeRange = [];
+      this.deliverySendTimeRange = [];
       this.searchKey= '';
       this.queryParams[this.searchType]=null;
       // 清空时间范围参数
       this.queryParams.payStartTime = null;
       this.queryParams.payEndTime = null;
-      this.queryParams.finishTimeStart = null;
-      this.queryParams.finishTimeEnd = null;
+      this.queryParams.deliverySendTimeStart = null;
+      this.queryParams.deliverySendTimeEnd = null;
       this.handleQuery();
     },