ソースを参照

优化订单列表交互

Huanyi 2 日 前
コミット
ae95f31222
2 ファイル変更50 行追加4 行削除
  1. 3 0
      src/api/erp/order/types.ts
  2. 47 4
      src/views/order/index.vue

+ 3 - 0
src/api/erp/order/types.ts

@@ -8,6 +8,7 @@ export interface ErpOrderQuery extends PageQuery {
   placer?: number | string;
   isConfirmed?: number | string;
   docCode?: string;
+  urgentFlag?: number;
 }
 
 export interface ErpOrderVo {
@@ -18,6 +19,8 @@ export interface ErpOrderVo {
   isConfirmed: number;
   urgentFlag?: number;
   docCode?: string;
+  clientId?: string;
+  clientName?: string;
   createTime: string;
   totalCount: number;
   details?: ErpOrderDetailVo[];

+ 47 - 4
src/views/order/index.vue

@@ -30,9 +30,16 @@
       </template>
 
       <div class="status-tabs">
-        <div v-for="(tab, index) in statusTabs" :key="index" class="tab-item"
-          :class="{ active: currentTab === tab.value }" @click="handleTabClick(tab.value)">
-          {{ tab.label }}
+        <div class="status-tabs-left">
+          <div v-for="(tab, index) in statusTabs" :key="index" class="tab-item"
+            :class="{ active: currentTab === tab.value }" @click="handleTabClick(tab.value)">
+            {{ tab.label }}
+          </div>
+        </div>
+        <div class="status-tabs-right">
+          <span class="urgent-switch-label">加急订单</span>
+          <el-switch v-model="urgentOnly" inline-prompt active-text="仅加急" inactive-text="全部"
+            @change="handleUrgentSwitch" />
         </div>
       </div>
 
@@ -43,6 +50,11 @@
             <span>{{ scope.row.docCode || '-' }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="下单客户" align="center" prop="clientName">
+          <template #default="scope">
+            <span>{{ scope.row.clientName || '-' }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="下单人" align="center" prop="placerName" />
         <el-table-column label="下单时间" align="center" prop="placeTime" width="180">
           <template #default="scope">
@@ -111,6 +123,10 @@
               <span class="info-label">下单人</span>
               <span class="info-value">{{ detailOrder.placerName }}</span>
             </div>
+            <div class="info-item">
+              <span class="info-label">下单客户</span>
+              <span class="info-value">{{ detailOrder.clientName || '-' }}</span>
+            </div>
             <div class="info-item">
               <span class="info-label">订单状态</span>
               <span class="info-value">
@@ -215,6 +231,7 @@ const total = ref(0);
 const detailOpen = ref(false);
 const detailOrder = ref(null);
 const currentTab = ref(undefined);
+const urgentOnly = ref(false);
 
 const statusTabs = [
   { label: '全部', value: undefined },
@@ -247,6 +264,7 @@ function getList() {
   loading.value = true;
   queryParams.value.status = currentTab.value;
   queryParams.value.isConfirmed = undefined;
+  queryParams.value.urgentFlag = urgentOnly.value ? 1 : undefined;
   listOrder(queryParams.value).then(response => {
     orderList.value = response.rows;
     total.value = response.total;
@@ -268,10 +286,16 @@ function handleTabClick(value) {
   handleQuery();
 }
 
+/** 加急订单开关切换 */
+function handleUrgentSwitch() {
+  handleQuery();
+}
+
 /** 重置按钮操作 */
 function resetQuery() {
   queryFormRef.value?.resetFields();
   currentTab.value = undefined;
+  urgentOnly.value = false;
   handleQuery();
 }
 
@@ -333,12 +357,31 @@ getList();
 /* ========== 状态筛选标签栏 ========== */
 .status-tabs {
   display: flex;
-  gap: 2px;
+  align-items: center;
+  justify-content: space-between;
   margin-bottom: 16px;
   border-bottom: 1px solid #ebeef5;
   padding-bottom: 0;
 }
 
+.status-tabs-left {
+  display: flex;
+  gap: 2px;
+}
+
+.status-tabs-right {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  padding-bottom: 2px;
+}
+
+.urgent-switch-label {
+  font-size: 13px;
+  color: #909399;
+  white-space: nowrap;
+}
+
 .tab-item {
   position: relative;
   padding: 10px 20px;