Huanyi hai 1 semana
pai
achega
159f49e3a4

+ 1 - 0
src/api/order/order/types.ts

@@ -20,5 +20,6 @@ export interface CreateOrderDTO {
     service: number | string;
     remark?: string;
     tenantId?: string;
+    orderCommission?: number;
     subOrders: CreateSubOrderDTO[];
 }

+ 6 - 5
src/views/order/management/components/DispatchDialog.vue

@@ -136,7 +136,7 @@
             <!-- Bottom: Fee & Submit -->
             <div class="dispatch-footer">
                 <div class="fee-input">
-                    <span class="label">服务费用:</span>
+                    <span class="label">订单佣金:</span>
                     <el-input-number v-model="dispatchFee" :min="0" :precision="2" :step="10" placeholder="请输入"
                         style="width: 140px;" />
                     <span class="unit">元</span>
@@ -262,8 +262,8 @@ watch(() => props.visible, (val) => {
         currentRider.value = null
         dispatchSearchQuery.value = ''
         selectedRiderId.value = null
-        // fulfillmentCommission 单位为分,转成元显示
-        dispatchFee.value = props.order?.fulfillmentCommission ? Number((props.order.fulfillmentCommission / 100).toFixed(2)) : 0
+        // orderCommission / fulfillmentCommission 单位为分,转成元显示
+        dispatchFee.value = (props.order?.orderCommission || props.order?.fulfillmentCommission) ? Number(((props.order.orderCommission || props.order.fulfillmentCommission) / 100).toFixed(2)) : 0
         if (props.order?.riderId) {
             currentRider.value = {
                 id: props.order.riderId,
@@ -286,8 +286,9 @@ watch(() => props.visible, (val) => {
                 petId.value = res.data.usrPet?.id || res.data.usrPet
                 
                 // 接到详情后,把真实的金额放进去(后端金额单位为分)
-                if (res.data.fulfillmentCommission !== undefined && res.data.fulfillmentCommission !== null) {
-                    dispatchFee.value = Number((res.data.fulfillmentCommission / 100).toFixed(2))
+                const commRaw = res.data.orderCommission ?? res.data.fulfillmentCommission;
+                if (commRaw !== undefined && commRaw !== null) {
+                    dispatchFee.value = Number((commRaw / 100).toFixed(2))
                 }
 
                 // 如果已经有履约者且不是在列表中找到的,从详情中补全性别

+ 2 - 2
src/views/order/management/components/OrderDetailDrawer.vue

@@ -141,8 +141,8 @@
                                         ({{ Number(order.platformId) === 1 ? '门店下单' : '平台代下单' }})</el-descriptions-item>
                                     <el-descriptions-item label="宠主信息">{{ order.userName }} / {{ order.contactPhone
                                         }}</el-descriptions-item>
-                                    <el-descriptions-item label="服务费用" label-class-name="money-label">
-                                        <span style="color:#f56c6c; font-weight:bold;">¥ {{ order.fulfillerFee }}</span>
+                                    <el-descriptions-item label="订单佣金" label-class-name="money-label">
+                                        <span style="color:#f56c6c; font-weight:bold;">¥ {{ order.orderCommission ? (order.orderCommission / 100).toFixed(2) : '0.00' }}</span>
                                     </el-descriptions-item>
 
                                     <el-descriptions-item label="预约时间">{{ getServiceTimeRange(order.serviceTime)

+ 13 - 3
src/views/order/management/index.vue

@@ -111,11 +111,17 @@
           </template>
         </el-table-column>
 
+        <el-table-column label="订单佣金" width="100">
+          <template #default="{ row }">
+            <span v-if="row.orderCommission !== null && row.orderCommission !== undefined" style="color: #f56c6c; font-weight: bold">¥{{ row.orderCommission / 100.0 }}</span>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+
         <el-table-column label="履约信息" width="140">
           <template #default="{ row }">
             <div v-if="row.fulfillerName" class="fulfiller-info">
               <span class="fulfiller-name">{{ row.fulfillerName }}</span>
-              <span class="fulfiller-fee" v-if="row.fulfillmentCommission !== null && row.fulfillmentCommission !== undefined">¥{{ row.fulfillmentCommission / 100.0 }}</span>
             </div>
             <span v-else class="text-gray">暂未指派</span>
           </template>
@@ -339,12 +345,14 @@ const getServiceMode = (serviceId) => {
 };
 
 const getServiceModeTag = (row) => {
+  if (getServiceMode(row.service) !== 1 && getServiceMode(row.service) !== '1') return '';
   const t = row?.type;
   if (t === 0 || t === '0' || t === 1 || t === '1') return '往返';
   return '';
 };
 
 const getServiceOrderTypeTag = (row) => {
+  if (getServiceMode(row.service) !== 1 && getServiceMode(row.service) !== '1') return null;
   const t = row?.type;
   if (t === 0 || t === '0') return { label: '接', type: 'primary' };
   if (t === 1 || t === '1') return { label: '送', type: 'success' };
@@ -467,8 +475,9 @@ const handleDetail = async (row) => {
           info.mode === 1 || info.mode === '1'
             ? info.toAddress || currentOrder.value?.address
             : info.address || info.toAddress || currentOrder.value?.address,
-        fulfillmentCommission: info.fulfillmentCommission !== undefined && info.fulfillmentCommission !== null ? Number(info.fulfillmentCommission) / 100 : currentOrder.value?.fulfillmentCommission,
-        fulfillerFee: info.fulfillmentCommission !== undefined && info.fulfillmentCommission !== null ? Number(info.fulfillmentCommission) / 100 : currentOrder.value?.fulfillerFee,
+        fulfillmentCommission: info.fulfillmentCommission ?? currentOrder.value?.fulfillmentCommission,
+        orderCommission: info.orderCommission ?? currentOrder.value?.orderCommission,
+        fulfillerFee: info.fulfillmentCommission ?? currentOrder.value?.fulfillerFee,
         merchantName: info.storeName || currentOrder.value?.merchantName,
         platformId: info.platformId ?? currentOrder.value?.platformId,
         groupBuyPackage: info.groupPurchasePackageName || currentOrder.value?.groupBuyPackage,
@@ -545,6 +554,7 @@ const openDispatchDialog = (row) => {
     dropAddr,
     service: row.service,
     fulfillmentCommission: row.fulfillmentCommission,
+    orderCommission: row.orderCommission,
     riderId: row.riderId || row.fulfiller || null,
     riderGender: row.fulfillerGender
   };

+ 15 - 3
src/views/order/purchase/index.vue

@@ -129,9 +129,18 @@
 
           <div class="card-body">
             <!-- 服务套餐信息 -->
-            <el-form-item label="团购套餐">
-              <el-input v-model="form.groupBuyPackage" placeholder="请输入团购套餐名称 (选填)" clearable />
-            </el-form-item>
+            <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="团购套餐">
+                  <el-input v-model="form.groupBuyPackage" placeholder="请输入团购套餐名称 (选填)" clearable />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="订单佣金">
+                  <el-input-number v-model="form.orderCommission" :min="0" :precision="2" :step="1" placeholder="请输入佣金 (元)" style="width: 100%" />
+                </el-form-item>
+              </el-col>
+            </el-row>
 
             <div class="divider"></div>
 
@@ -254,6 +263,7 @@ const form = reactive({
   type: '',
   mode: undefined,
   groupBuyPackage: '',
+  orderCommission: 0,
 
   // Sub Forms Data
   transport: {
@@ -571,6 +581,7 @@ const resetForm = () => {
   form.type = '';
   form.mode = undefined;
   form.groupBuyPackage = '';
+  form.orderCommission = 0;
 
   form.transport = {
     pkgId: '',
@@ -722,6 +733,7 @@ const handleSubmit = async () => {
       pet: form.petId,
       groupPurchasePackageName: form.groupBuyPackage || '',
       service: form.serviceId,
+      orderCommission: Math.round(Number(form.orderCommission || 0) * 100),
       remark: '', // 表单目前暂无备注字段
       tenantId: storeObj.tenantId || '',
       subOrders: subOrders

+ 2 - 2
vite.config.ts

@@ -24,8 +24,8 @@ export default defineConfig(({ mode, command }) => {
       // open: true,
       proxy: {
         [env.VITE_APP_BASE_API]: {
-          // target: 'http://127.0.0.1:8080',
-          target: 'http://www.hoomeng.pet/api',
+          target: 'http://127.0.0.1:8080',
+          // target: 'http://www.hoomeng.pet/api',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')