ALIEZ il y a 1 semaine
Parent
commit
83962b2394

+ 1 - 0
src/api/modules/finance/customer.ts

@@ -8,6 +8,7 @@ export interface CustomerItem {
   name?: string
   phone?: string
   identity?: string
+  referralCode?: string
   /** 1:初探 2:研习 3:学成 4:深耕 5:传誉 */
   levelLabel?: number
   totalSpendingAmount?: number | string

+ 5 - 1
src/api/modules/settings/rewardAmount.ts

@@ -17,7 +17,11 @@ export function addRewardAmount(data: { email: string; amount: number | string }
   return request.post<unknown>('/reward/amount/add', data)
 }
 
-export function updateRewardAmount(data: { email: string; amount: number | string }) {
+export function updateRewardAmount(data: {
+  id: number
+  email: string
+  amount: number | string
+}) {
   return request.post<unknown>('/reward/amount/update', data)
 }
 

+ 2 - 1
src/views/finance/CustomerListView.vue

@@ -150,6 +150,7 @@ const columns = ref<DataTableColumns<CustomerItem>>([
   { title: '姓名', key: 'name', width: 120, ellipsis: { tooltip: true } },
   { title: '手机号', key: 'phone', width: 140, ellipsis: { tooltip: true } },
   { title: '身份证号', key: 'identity', width: 220, ellipsis: { tooltip: true } },
+  { title: '推荐码', key: 'referralCode', width: 120, ellipsis: { tooltip: true } },
   {
     title: '标签等级',
     key: 'levelLabel',
@@ -267,7 +268,7 @@ onActivated(() => {
             :single-line="false"
             :row-key="(row: CustomerItem) => `${row.id ?? ''}-${row.cId ?? ''}-${row.email ?? ''}-${row.phone ?? ''}`"
             class="data-table-fill"
-            :scroll-x="1340"
+            :scroll-x="1460"
           />
         </div>
 

+ 9 - 10
src/views/settings/RewardAmountView.vue

@@ -139,7 +139,14 @@ async function submit() {
       amount: form.value.amount,
     }
     if (editingRow.value) {
-      await rewardAmountApi.updateRewardAmount(payload)
+      if (!editingRow.value.id) {
+        message.warning('缺少记录 ID,无法更新')
+        return
+      }
+      await rewardAmountApi.updateRewardAmount({
+        id: editingRow.value.id,
+        ...payload,
+      })
       message.success('已更新')
     } else {
       await rewardAmountApi.addRewardAmount(payload)
@@ -214,7 +221,7 @@ onActivated(() => {
 
 <template>
   <div class="page page--table">
-    <AdminSearchPanel :field-count="2" @search="onSearch" @reset="resetSearch">
+    <AdminSearchPanel :field-count="1" @search="onSearch" @reset="resetSearch">
       <NFormItemGi :span="1" label="邮箱">
         <NInput
           v-model:value="search.email"
@@ -223,14 +230,6 @@ onActivated(() => {
           @keyup.enter="onSearch"
         />
       </NFormItemGi>
-      <NFormItemGi :span="1" label="金额">
-        <NInput
-          v-model:value="search.amount"
-          clearable
-          placeholder="金额"
-          @keyup.enter="onSearch"
-        />
-      </NFormItemGi>
     </AdminSearchPanel>
 
     <NCard :bordered="false" class="table-card table-card--fill">