From aab5e957dfeaa71bb56771f101d7b26c88e2e83a Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期四, 14 十一月 2024 09:28:23 +0800
Subject: [PATCH] add: -商户列表需要增加下单次数统计(已退款、已取消、待付款的不统计在内)

---
 pages/order/list/index.vue |   87 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 78 insertions(+), 9 deletions(-)

diff --git a/pages/order/list/index.vue b/pages/order/list/index.vue
index 00af407..3f74328 100644
--- a/pages/order/list/index.vue
+++ b/pages/order/list/index.vue
@@ -27,7 +27,6 @@
 import { dateRangeOptions } from '@/utils/options'
 import CustomDateRange from '@/components/custom-date-range.vue'
 import PrintList from '@/components/order/print-list'
-import GoodsTableItemList from '@/components/order/goods-table-item-list.vue'
 export default {
   components: {
     PrintList,
@@ -38,10 +37,14 @@
       orderList: [],
       tableConfig: {
         url: 'flower/api/order/list',
+        editUrl: 'flower/api/order/page/update',
         hasNew: false,
-        hasEdit: false,
+        hasEdit: true,
         hasDelete: false,
         persistSelection: true,
+        hasExport: true,
+        exportUrl: 'flower/api/order/list/export',
+        exportText: '导出订单',
         onResetView: (row) => {
           this.$router.push(`${this.$route.path}/${row.id}`)
         },
@@ -60,6 +63,11 @@
             }
           }
         },
+        beforeOpen: (row, isNew) => {
+          if (!isNew) {
+            row.districtStr = this.getDistrict(row)
+          }
+        },
         columns: [
           { label: '', type: 'selection', minWidth: 60, fixed: 'left' },
           { label: '订单号', prop: 'orderNo', minWidth: 150, fixed: 'left' },
@@ -74,16 +82,22 @@
               }${row.customerAddress || ''}`,
             minWidth: 250,
           },
-          {
-            label: '商品信息',
-            formatter: (row) => <GoodsTableItemList items={row.items} />,
-            minWidth: 250,
-          },
           { label: '订单金额(元)', prop: 'totalAmount', minWidth: 150 },
           { label: '底价(元)', prop: 'supplierAmount', minWidth: 150 },
+          { label: '销售扎数', prop: 'saleNum', minWidth: 150 },
           { label: '订单状态', prop: 'statusBackendStr', minWidth: 120 },
           { label: '下单时间', prop: 'createTime', minWidth: 180 },
+          { label: '支付时间', prop: 'paymentTime', minWidth: 180 },
           { label: '合伙人', prop: 'partnerName', minWidth: 120 },
+          { label: '库位', prop: 'warehouseLocationCode', minWidth: 120 },
+          { label: '特殊需求', prop: 'specialNeedsStr', minWidth: 120 },
+          {
+            label: '备注',
+            formatter: (row) => (
+              <simple-text value={row.remarks} type="primary"></simple-text>
+            ),
+            minWidth: 200,
+          },
         ],
         searchFormAttrs: {
           labelWidth: 'auto',
@@ -111,7 +125,7 @@
                   },
                   // code: 'ORDER_STATUS_BACKEND',
                 },
-                default: '',
+                default: this.$route.query.statusBackend || '',
                 span: 24,
                 searchImmediately: true,
                 on: {
@@ -152,6 +166,54 @@
                 id: 'customer',
                 type: 'input',
                 el: { placeholder: '收货人姓名/手机号' },
+              },
+              { label: '收货地址:', id: 'address', type: 'input' },
+              { label: '库位:', id: 'warehouseLocationCode', type: 'input' },
+            ],
+          },
+        ],
+        form: [
+          {
+            type: 'row',
+            span: 12,
+            items: [
+              {
+                label: '地区:',
+                id: 'customerProvince',
+                component: 'el-bus-select-area',
+                span: 24,
+                commonFormat: true,
+                commonFormatProps: [
+                  'customerProvince',
+                  'customerCity',
+                  'customerRegion',
+                ],
+                str: true,
+                strKey: 'districtStr',
+                rules: { required: true, message: '请选择地区' },
+              },
+              {
+                label: '详细地址:',
+                id: 'customerAddress',
+                type: 'input',
+                span: 24,
+                rules: {
+                  required: true,
+                  message: '请输入详细地址且最大不超过50个汉字',
+                  trigger: 'blur',
+                  max: 50,
+                },
+              },
+              {
+                label: '联系方式:',
+                id: 'customerTel',
+                type: 'input',
+                rules: {
+                  required: true,
+                  pattern: this.$elBusUtil.REG.MOBILEPHONE,
+                  message: '请输入合法的手机号',
+                  trigger: 'blur',
+                },
               },
             ],
           },
@@ -198,7 +260,7 @@
                         for (const tr of trs) {
                           const tds = tr.querySelectorAll('td')
                           if (tds && tds.length > 0) {
-                            tds[0].colSpan = 7
+                            tds[0].colSpan = 8
                             tds[0].style.textAlign = 'center'
                           }
                         }
@@ -300,6 +362,13 @@
       this.$refs.crud.search()
     },
   },
+  methods: {
+    getDistrict(row) {
+      return `${row.customerProvince || ''}${row.customerCity || ''}${
+        row.customerRegion || ''
+      }`
+    },
+  },
 }
 </script>
 

--
Gitblit v1.9.3