Explorar el Código

订单字段修改完成

Huanyi hace 2 semanas
padre
commit
25066afc72

+ 1 - 1
src/api/order/index.ts

@@ -31,7 +31,7 @@ export interface SubOrderVO {
   fulfiller: number;
   fulfillerName: string;
   fulfillerStatus: string;
-  price: number;
+  fulfillmentCommission: number;
 }
 
 export interface SubOrderListResult {

+ 11 - 11
src/api/order/subOrder/index.ts

@@ -15,7 +15,7 @@ export const listSubOrder = (query?: SubOrderQuery): AxiosPromise<{ total: numbe
     });
 };
 
-export const dispatchSubOrder = (data: { orderId: string | number; fulfiller: string | number; price: number; }) => {
+export const dispatchSubOrder = (data: { orderId: string | number; fulfiller: string | number; fulfillmentCommission: number; }) => {
     return request({
         url: '/order/subOrder/dispatch',
         method: 'put',
@@ -88,20 +88,20 @@ export const listSubOrderOnCustomer = (customerId: string | number): AxiosPromis
  * 根据宠物ID查询子订单列表
  */
 export const listSubOrderOnPet = (petId: string | number): AxiosPromise<SubOrderPetVO[]> => {
-  return request({
-    url: '/order/subOrder/listOnPet',
-    method: 'get',
-    params: { petId }
-  });
+    return request({
+        url: '/order/subOrder/listOnPet',
+        method: 'get',
+        params: { petId }
+    });
 };
 
 /**
  * 根据门店查询服务订单记录
  */
 export const listSubOrderOnStore = (params: { storeId: string | number; pageNum: number; pageSize: number; }): AxiosPromise<{ total: number, rows: SubOrderStoreVO[] }> => {
-  return request({
-    url: '/order/subOrder/listOnStore',
-    method: 'get',
-    params
-  });
+    return request({
+        url: '/order/subOrder/listOnStore',
+        method: 'get',
+        params
+    });
 };

+ 3 - 3
src/api/order/subOrder/types.ts

@@ -38,7 +38,7 @@ export interface SubOrderVO {
     fulfiller: number;
     fulfillerName: string;
     fulfillerStatus?: string | 'resting' | 'busy' | 'disabled';
-    price: number;
+    fulfillmentCommission: number;
     transportType?: string;
     splitType?: string;
     detail?: any;
@@ -65,7 +65,7 @@ export interface SubOrderPetVO {
   id: number;
   code: string;
   service: number;
-  price: number;
+  fulfillmentCommission: number;
   serviceTime: string;
   status: number;
 }
@@ -75,7 +75,7 @@ export interface SubOrderStoreVO {
   code: string;
   service: number;
   customer: string;
-  price: number;
+  fulfillmentCommission: number;
   createTime: string;
   status: number;
 }

+ 4 - 4
src/views/order/management/components/DispatchDialog.vue

@@ -262,8 +262,8 @@ watch(() => props.visible, (val) => {
         currentRider.value = null
         dispatchSearchQuery.value = ''
         selectedRiderId.value = null
-        // price 单位为分,转成元显示
-        dispatchFee.value = props.order?.price ? Number((props.order.price / 100).toFixed(2)) : 0
+        // fulfillmentCommission 单位为分,转成元显示
+        dispatchFee.value = props.order?.fulfillmentCommission ? Number((props.order.fulfillmentCommission / 100).toFixed(2)) : 0
         if (props.order?.riderId) {
             currentRider.value = {
                 id: props.order.riderId,
@@ -286,8 +286,8 @@ watch(() => props.visible, (val) => {
                 petId.value = res.data.usrPet?.id || res.data.usrPet
                 
                 // 接到详情后,把真实的金额放进去(后端金额单位为分)
-                if (res.data.price !== undefined && res.data.price !== null) {
-                    dispatchFee.value = Number((res.data.price / 100).toFixed(2))
+                if (res.data.fulfillmentCommission !== undefined && res.data.fulfillmentCommission !== null) {
+                    dispatchFee.value = Number((res.data.fulfillmentCommission / 100).toFixed(2))
                 }
 
                 // 如果已经有履约者且不是在列表中找到的,从详情中补全性别

+ 7 - 7
src/views/order/management/index.vue

@@ -109,7 +109,7 @@
           <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.price !== null && row.price !== undefined">¥{{ row.price / 100.0 }}</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>
@@ -461,8 +461,8 @@ const handleDetail = async (row) => {
           info.mode === 1 || info.mode === '1'
             ? info.toAddress || currentOrder.value?.address
             : info.address || info.toAddress || currentOrder.value?.address,
-        price: info.price !== undefined && info.price !== null ? Number(info.price) / 100 : currentOrder.value?.price,
-        fulfillerFee: info.price !== undefined && info.price !== null ? Number(info.price) / 100 : currentOrder.value?.fulfillerFee,
+        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,
         merchantName: info.storeName || currentOrder.value?.merchantName,
         platformId: info.platformId ?? currentOrder.value?.platformId,
         groupBuyPackage: info.groupPurchasePackageName || currentOrder.value?.groupBuyPackage,
@@ -538,7 +538,7 @@ const openDispatchDialog = (row) => {
     pickAddr,
     dropAddr,
     service: row.service,
-    price: row.price,
+    fulfillmentCommission: row.fulfillmentCommission,
     riderId: row.riderId || row.fulfiller || null,
     riderGender: row.fulfillerGender
   };
@@ -548,18 +548,18 @@ const openDispatchDialog = (row) => {
 
 const handleDispatchSubmit = (payload) => {
   if (!currentDispatchOrder.value) return;
-  const priceFen = Math.round(Number(payload.fee || 0) * 100);
+  const fulfillmentCommissionFen = Math.round(Number(payload.fee || 0) * 100);
   dispatchSubOrder({
     orderId: currentDispatchOrder.value.id,
     fulfiller: payload.riderId,
-    price: priceFen
+    fulfillmentCommission: fulfillmentCommissionFen
   }).then(() => {
     ElMessage.success('派单成功');
     const row = tableData.value.find((r) => r.id === currentDispatchOrder.value.id);
     if (row) {
       row.status = 1;
       row.fulfillerName = payload.riderName || 'Unknown';
-      row.price = payload.fee;
+      row.fulfillmentCommission = payload.fee;
     }
     handleSearch();
   });

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

@@ -232,11 +232,11 @@ const serviceList = [
 ];
 
 const allPackages = [
-  { id: 10, type: 'transport', name: '包月接送套餐', price: 0 },
-  { id: 11, type: 'feeding', name: '基础喂猫套餐', price: 0 },
-  { id: 12, type: 'feeding', name: '深度陪玩套餐', price: 0 },
-  { id: 13, type: 'washing', name: '精致洗护+美容', price: 0 },
-  { id: 14, type: 'washing', name: '除菌药浴套餐', price: 0 }
+  { id: 10, type: 'transport', name: '包月接送套餐', fulfillmentCommission: 0 },
+  { id: 11, type: 'feeding', name: '基础喂猫套餐', fulfillmentCommission: 0 },
+  { id: 12, type: 'feeding', name: '深度陪玩套餐', fulfillmentCommission: 0 },
+  { id: 13, type: 'washing', name: '精致洗护+美容', fulfillmentCommission: 0 },
+  { id: 14, type: 'washing', name: '除菌药浴套餐', fulfillmentCommission: 0 }
 ];
 
 const currentPets = ref([]);
@@ -258,7 +258,7 @@ const form = reactive({
   // Sub Forms Data
   transport: {
     pkgId: '',
-    price: 0,
+    fulfillmentCommission: 0,
     pickPrice: 35,
     dropPrice: 35,
     subType: 'round',
@@ -279,7 +279,7 @@ const form = reactive({
   },
   feeding: {
     pkgId: '',
-    price: 68,
+    fulfillmentCommission: 68,
     appointments: [{ startTime: '', endTime: '' }],
     region: [],
     addressDetail: '',
@@ -293,7 +293,7 @@ const form = reactive({
   },
   washing: {
     pkgId: '',
-    price: 88,
+    fulfillmentCommission: 88,
     appointments: [{ startTime: '', endTime: '' }],
     region: [],
     addressDetail: '',
@@ -406,7 +406,7 @@ const currentPackages = computed(() => {
 
 const handlePkgSelect = (id) => {
   activeData.value.pkgId = id;
-  // Price calculation should remain same (base price), just payable changes
+  // Price calculation should remain same (base fulfillmentCommission), just payable changes
   calcPrice(form.type);
 };
 
@@ -427,9 +427,9 @@ const calcPrice = (type) => {
       data.dropPrice = base;
     }
   } else if (type === 'feeding') {
-    data.price = base * data.count;
+    data.fulfillmentCommission = base * data.count;
   } else if (type === 'washing') {
-    data.price = base;
+    data.fulfillmentCommission = base;
   }
 };
 
@@ -574,7 +574,7 @@ const resetForm = () => {
 
   form.transport = {
     pkgId: '',
-    price: 0,
+    fulfillmentCommission: 0,
     pickPrice: 35,
     dropPrice: 35,
     subType: 'round',
@@ -595,7 +595,7 @@ const resetForm = () => {
   };
   form.feeding = {
     pkgId: '',
-    price: 68,
+    fulfillmentCommission: 68,
     appointments: [{ startTime: '', endTime: '' }],
     region: [],
     addressDetail: '',
@@ -609,7 +609,7 @@ const resetForm = () => {
   };
   form.washing = {
     pkgId: '',
-    price: 88,
+    fulfillmentCommission: 88,
     appointments: [{ startTime: '', endTime: '' }],
     region: [],
     addressDetail: '',
@@ -979,7 +979,7 @@ onMounted(() => {
   overflow: hidden;
 }
 
-.type-price {
+.type-fulfillmentCommission {
   font-size: 14px;
   color: #f56c6c;
   font-weight: bold;