Jelajahi Sumber

前端增加手写信息采集图片提醒

cgp 5 hari lalu
induk
melakukan
7f6d083fa9
1 mengubah file dengan 54 tambahan dan 12 penghapusan
  1. 54 12
      src/views/qw/companyCustomer/index.vue

+ 54 - 12
src/views/qw/companyCustomer/index.vue

@@ -176,6 +176,7 @@
       v-loading="loading"
       :data="customerList"
       @selection-change="handleSelectionChange"
+      @sort-change="handleSortChange"
     >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="客户姓名" align="center" prop="customerName" />
@@ -198,6 +199,7 @@
         align="center"
         prop="createTime"
         width="180"
+        sortable="custom"
       >
         <template slot-scope="scope">{{
             parseTime(scope.row.createTime)
@@ -208,6 +210,7 @@
         align="center"
         prop="filingTime"
         width="180"
+        sortable="custom"
       >
         <template slot-scope="scope">{{
             parseTime(scope.row.filingTime)
@@ -1066,7 +1069,7 @@
               icon="el-icon-qrcode"
               v-if=" scope.row.paid === 0"
               @click="handleGetQrCode(scope.row)"
-            >获取二维码</el-button
+            >获取支付二维码</el-button
             >
           </template>
         </el-table-column>
@@ -1273,6 +1276,8 @@ export default {
         purchased: false,
         minBuyCount: null,
         maxBuyCount: null,
+        sortField: null,   //排序字段 (create_time / filing_time)
+        sortOrder: null,   //排序方向 (asc / desc)
       },
       form: {},
       rules: {
@@ -1616,11 +1621,24 @@ export default {
       this.createOrder.open = false;
       this.createOrderReset();
       // 弹出提示确认框
-      // this.$confirm('请上传手写信息采集,否则无法发货!', '提示', {
-      //   confirmButtonText: '确定',
-      //   cancelButtonText: '取消',
-      //   type: 'warning'
-      // }).then(() => {
+      this.$confirm(`<div style="text-align: center; padding: 10px 0;">
+     <i class="el-icon-warning-outline" style="font-size: 48px; color: #E6A23C;"></i>
+     <p style="font-size: 16px; margin: 15px 0 10px; font-weight: 500;">
+       请上传此订单的手写信息采集,否则无法发货!
+     </p>
+     <p style="color: #F56C6C; font-size: 14px;">
+       点击“确定”跳转上传页面
+     </p>
+   </div>`,
+        '温馨提示',
+        {
+          confirmButtonText: '确定,去上传',
+          cancelButtonText: '暂不处理',
+          type: 'warning',
+          dangerouslyUseHTMLString: true,
+          center: true,
+          distinguishCancelAndClose: true
+        }).then(() => {
         // 确保订单列表弹窗打开并刷新
         if (this.currentCustomerId) {
           this.orderQueryParams.companyCustomerId = this.currentCustomerId;
@@ -1631,11 +1649,11 @@ export default {
           this.orderListDialogVisible = true; // 仍打开弹窗,但可能无法正确筛选
         }
         // 打开手写信息采集新增弹窗
-        // this.openHandwriteDialog(order, orderParams);
-      // }).catch(() => {
-      //   this.getList();
-      //   this.$message.info("已取消上传手写信息采集");
-      // });
+        this.openHandwriteDialog(order, orderParams);
+      }).catch(() => {
+        this.getList();
+        this.$message.info("已取消上传手写信息采集");
+      });
     },
 
     // 打开手写信息采集弹窗并预填信息
@@ -1889,13 +1907,18 @@ export default {
         params.endCreateTime = this.createTimeRange[1];
       }
       if (!params.purchased) delete params.purchased;
+      // 传递排序参数(如果存在)
+      if (params.sortField && params.sortOrder) {
+        // 直接保留,后端会接收
+      }
       Object.keys(params).forEach((key) => {
         if (
           params[key] === null ||
           params[key] === undefined ||
           params[key] === ""
-        )
+        ) {
           delete params[key];
+        }
       });
       listCustomer(params)
         .then((response) => {
@@ -1916,6 +1939,9 @@ export default {
       this.queryParams.purchased = false;
       this.queryParams.minBuyCount = null;
       this.queryParams.maxBuyCount = null;
+      // 清空排序
+      this.queryParams.sortField = null;
+      this.queryParams.sortOrder = null;
       this.handleQuery();
     },
     handleClaim(row) {
@@ -2298,6 +2324,22 @@ export default {
       link.click();
       document.body.removeChild(link);
     },
+    handleSortChange({ prop, order }) {
+      // prop: 'createTime' 或 'filingTime'
+      // order: 'ascending' 或 'descending',无排序时为 null
+      if (!order) {
+        // 清除排序
+        this.queryParams.sortField = null;
+        this.queryParams.sortOrder = null;
+      } else {
+        // 映射前端字段名到数据库字段名
+        this.queryParams.sortField = prop === 'createTime' ? 'create_time' : 'filing_time';
+        this.queryParams.sortOrder = order === 'ascending' ? 'asc' : 'desc';
+      }
+      // 重置到第一页
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
   },
 };
 </script>