From 014cf0cd36c31b2afa896e6c8efcabfccbe6b289 Mon Sep 17 00:00:00 2001
From: mayf <m13160102112@163.com>
Date: 星期二, 24 九月 2024 23:50:18 +0800
Subject: [PATCH] 售后弹窗修改

---
 components/simple-text.vue             |    6 ++
 pages/order/after-sale/index.vue       |  107 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 pages/order/after-sale/_action/_id.vue |    1 
 3 files changed, 110 insertions(+), 4 deletions(-)

diff --git a/components/simple-text.vue b/components/simple-text.vue
index 0e90fd2..5366caa 100644
--- a/components/simple-text.vue
+++ b/components/simple-text.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="simple-text" :class="{ 'is-primary': type === 'primary' }">
-    {{ value }}
+    {{ text || value }}
   </div>
 </template>
 
@@ -15,6 +15,10 @@
       type: String,
       default: '',
     },
+    text: {
+      type: [String, Number],
+      default: null,
+    },
   },
 }
 </script>
diff --git a/pages/order/after-sale/_action/_id.vue b/pages/order/after-sale/_action/_id.vue
index f478df7..231afdc 100644
--- a/pages/order/after-sale/_action/_id.vue
+++ b/pages/order/after-sale/_action/_id.vue
@@ -126,6 +126,7 @@
             { label: '规格:', id: 'flowerUnit' },
             { label: '原价(元):', id: 'price' },
             { label: '券后单价(元):', id: 'realPrice' },
+            { label: '券后总金额(元):', id: 'realTotal' },
             { label: '供应商价格(元):', id: 'supplierPrice' },
             { label: '合伙人加价(元):', id: 'markupPartner' },
             { label: '申请数量:', id: 'num' },
diff --git a/pages/order/after-sale/index.vue b/pages/order/after-sale/index.vue
index fa90fc6..5947a23 100644
--- a/pages/order/after-sale/index.vue
+++ b/pages/order/after-sale/index.vue
@@ -11,6 +11,15 @@
 
 <script>
 import AfterSaleTable from '@/components/order/after-sale-table'
+const feeKeys = [
+  'feeSupplier',
+  'feePlatform',
+  'feePartner',
+  'feePlatformPack',
+  'feePlatformCheck',
+  'feePlatformTransport',
+  'feePackingTransport',
+]
 export default {
   components: {
     AfterSaleTable,
@@ -122,9 +131,45 @@
               { label: '合伙人加价(元):', id: 'markupPartner', type: 'input' },
               { label: '原价(元):', id: 'price', type: 'input' },
               { label: '券后单价(元):', id: 'realPrice', type: 'input' },
+              { label: '券后总金额(元):', id: 'realTotal', type: 'input' },
               { label: '供应商价格(元):', id: 'supplierPrice', type: 'input' },
               { label: '商品数量:', id: 'flowerNum', type: 'input' },
               { label: '申请售后数量:', id: 'num', type: 'input' },
+            ],
+          },
+          {
+            type: 'row',
+            items: [
+              {
+                label: '质检总扣款(元):',
+                id: 'checkTotalAmount',
+                type: 'input',
+                span: 24,
+                customClass: 'to-red to-bold',
+              },
+              {
+                label: '降级数量:',
+                id: 'reduceNum',
+                type: 'input',
+              },
+              {
+                label: '降级总金额(元):',
+                id: 'reduceAmount',
+                type: 'input',
+              },
+              {
+                label: '缺货数量:',
+                id: 'lackNum',
+                type: 'input',
+                span: 24,
+              },
+              {
+                label: '已退总金额(元):',
+                id: 'refundTotalAmount',
+                type: 'input',
+                span: 24,
+                customClass: 'to-red to-bold',
+              },
             ],
           },
         ],
@@ -182,6 +227,29 @@
                     id: 'feePlatformTransport',
                     type: 'input-number',
                     el: { min: 0, precision: 2, controls: false },
+                  },
+                  {
+                    label: '打包运费(元)(散户):',
+                    id: 'feePackingTransport',
+                    type: 'input-number',
+                    el: { min: 0, precision: 2, controls: false },
+                  },
+                  {
+                    label: '实际总扣款(元):',
+                    id: 'tempTotal',
+                    component: 'simple-text',
+                    readonly: true,
+                    forceDisabled: true,
+                    el: (row) => ({
+                      text: feeKeys
+                        .reduce((total, current) => {
+                          total += row[current] ?? 0
+                          return total
+                        }, 0)
+                        .toFixed(2),
+                    }),
+                    span: 24,
+                    customClass: 'to-bold-label',
                   },
                   {
                     label: '申请理由:',
@@ -253,11 +321,44 @@
     onDetail(item) {
       this.$router.push(`${this.$route.path}/view/${item.id}`)
     },
-    onHandle(item) {
-      this.$refs.crud.$refs.extraDialog[0].show(item)
+    async onHandle(item) {
+      const { code, data } = await this.$elBusHttp.request(
+        'flower/api/sales/list/view',
+        { params: { id: item.id } }
+      )
+      if (code === 0) {
+        feeKeys.forEach((key) => {
+          data[key] = data[key] ?? undefined
+        })
+        this.$refs.crud.$refs.extraDialog[0].show(data)
+      }
     },
   },
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+::v-deep {
+  .el-form-item {
+    &.to-bold {
+      .el-form-item__label,
+      .simple-text,
+      .el-bus-form-item__normal {
+        font-weight: bold;
+      }
+    }
+    &.to-red {
+      .el-form-item__label,
+      .simple-text,
+      .el-bus-form-item__normal {
+        color: $danger-color;
+      }
+    }
+    &.to-bold-label {
+      .el-form-item__label {
+        font-weight: bold;
+      }
+    }
+  }
+}
+</style>

--
Gitblit v1.9.3