|
@@ -7,17 +7,11 @@
|
|
|
<div class="right-panel">
|
|
<div class="right-panel">
|
|
|
<el-radio-group v-model="filters.service" size="default" @change="handleSearch">
|
|
<el-radio-group v-model="filters.service" size="default" @change="handleSearch">
|
|
|
<el-radio-button label="">全部类型</el-radio-button>
|
|
<el-radio-button label="">全部类型</el-radio-button>
|
|
|
- <el-radio-button v-for="item in serviceOptions" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>
|
|
|
|
|
|
|
+ <el-radio-button v-for="item in serviceOptions" :key="item.id" :label="item.id">{{ item.name
|
|
|
|
|
+ }}</el-radio-button>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
- <el-input
|
|
|
|
|
- v-model="filters.content"
|
|
|
|
|
- placeholder="订单号/商户/宠主/手机号"
|
|
|
|
|
- class="search-input"
|
|
|
|
|
- prefix-icon="Search"
|
|
|
|
|
- clearable
|
|
|
|
|
- @clear="handleSearch"
|
|
|
|
|
- @keyup.enter="handleSearch"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-input v-model="filters.content" placeholder="订单号/商户/宠主/手机号" class="search-input" prefix-icon="Search"
|
|
|
|
|
+ clearable @clear="handleSearch" @keyup.enter="handleSearch" />
|
|
|
<el-button type="primary" icon="Search" @click="handleSearch">查询</el-button>
|
|
<el-button type="primary" icon="Search" @click="handleSearch">查询</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -33,17 +27,20 @@
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <el-table :data="tableData" style="width: 100%" v-loading="loading" :header-cell-style="{ background: '#f5f7fa' }">
|
|
|
|
|
|
|
+ <el-table :data="tableData" style="width: 100%" v-loading="loading"
|
|
|
|
|
+ :header-cell-style="{ background: '#f5f7fa' }">
|
|
|
<el-table-column prop="code" label="订单号" width="170" fixed="left" />
|
|
<el-table-column prop="code" label="订单号" width="170" fixed="left" />
|
|
|
|
|
|
|
|
<el-table-column label="服务类型" width="190">
|
|
<el-table-column label="服务类型" width="190">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<div class="service-type-cell">
|
|
<div class="service-type-cell">
|
|
|
<el-tag>{{ getServiceName(row.service) }}</el-tag>
|
|
<el-tag>{{ getServiceName(row.service) }}</el-tag>
|
|
|
- <el-tag v-if="getServiceModeTag(row)" class="sub-tag" type="warning" effect="plain">{{ getServiceModeTag(row) }}</el-tag>
|
|
|
|
|
- <el-tag v-if="getServiceOrderTypeTag(row)" class="sub-tag" :type="getServiceOrderTypeTag(row).type" effect="dark">{{
|
|
|
|
|
- getServiceOrderTypeTag(row).label
|
|
|
|
|
- }}</el-tag>
|
|
|
|
|
|
|
+ <el-tag v-if="getServiceModeTag(row)" class="sub-tag" type="warning" effect="plain">{{
|
|
|
|
|
+ getServiceModeTag(row) }}</el-tag>
|
|
|
|
|
+ <el-tag v-if="getServiceOrderTypeTag(row)" class="sub-tag" :type="getServiceOrderTypeTag(row).type"
|
|
|
|
|
+ effect="dark">{{
|
|
|
|
|
+ getServiceOrderTypeTag(row).label
|
|
|
|
|
+ }}</el-tag>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -109,7 +106,7 @@
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<div v-if="row.fulfillerName" class="fulfiller-info">
|
|
<div v-if="row.fulfillerName" class="fulfiller-info">
|
|
|
<span class="fulfiller-name">{{ row.fulfillerName }}</span>
|
|
<span class="fulfiller-name">{{ row.fulfillerName }}</span>
|
|
|
- <span class="fulfiller-fee" v-if="row.price !== null && row.price !== undefined">¥{{ row.price }}</span>
|
|
|
|
|
|
|
+ <span class="fulfiller-fee" v-if="row.price !== null && row.price !== undefined">¥{{ row.price / 100.0 }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<span v-else class="text-gray">暂未指派</span>
|
|
<span v-else class="text-gray">暂未指派</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -119,11 +116,15 @@
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<div class="op-cell">
|
|
<div class="op-cell">
|
|
|
<el-button link type="primary" size="small" @click="handleDetail(row)">详情</el-button>
|
|
<el-button link type="primary" size="small" @click="handleDetail(row)">详情</el-button>
|
|
|
- <el-button v-if="row.status === 0" link type="success" size="small" @click="openDispatchDialog(row)">派单</el-button>
|
|
|
|
|
- <el-button v-if="[1, 2].includes(row.status)" link type="warning" size="small" @click="openDispatchDialog(row)">重新派单</el-button>
|
|
|
|
|
- <el-button v-if="[0, 1].includes(row.status)" link type="danger" size="small" @click="handleCancel(row)">取消</el-button>
|
|
|
|
|
-
|
|
|
|
|
- <el-dropdown v-if="[2, 3, 4].includes(row.status)" trigger="click" @command="(cmd) => handleCommand(cmd, row)">
|
|
|
|
|
|
|
+ <el-button v-if="row.status === 0" link type="success" size="small"
|
|
|
|
|
+ @click="openDispatchDialog(row)">派单</el-button>
|
|
|
|
|
+ <el-button v-if="[1, 2].includes(row.status)" link type="warning" size="small"
|
|
|
|
|
+ @click="openDispatchDialog(row)">重新派单</el-button>
|
|
|
|
|
+ <el-button v-if="[0, 1].includes(row.status)" link type="danger" size="small"
|
|
|
|
|
+ @click="handleCancel(row)">取消</el-button>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dropdown v-if="[2, 3, 4].includes(row.status)" trigger="click"
|
|
|
|
|
+ @command="(cmd) => handleCommand(cmd, row)">
|
|
|
<span class="el-dropdown-link">
|
|
<span class="el-dropdown-link">
|
|
|
更多<el-icon class="el-icon--right">
|
|
更多<el-icon class="el-icon--right">
|
|
|
<ArrowDown />
|
|
<ArrowDown />
|
|
@@ -144,29 +145,18 @@
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
<div class="pagination-container">
|
|
<div class="pagination-container">
|
|
|
- <el-pagination
|
|
|
|
|
- v-model:current-page="pagination.current"
|
|
|
|
|
- v-model:page-size="pagination.size"
|
|
|
|
|
- :page-sizes="[10, 20, 50, 100]"
|
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
- :total="pagination.total"
|
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-pagination v-model:current-page="pagination.current" v-model:page-size="pagination.size"
|
|
|
|
|
+ :page-sizes="[10, 20, 50, 100]" layout="total, sizes, prev, pager, next, jumper" :total="pagination.total"
|
|
|
|
|
+ @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
<!-- 组件 -->
|
|
<!-- 组件 -->
|
|
|
- <OrderDetailDrawer
|
|
|
|
|
- v-model:visible="detailVisible"
|
|
|
|
|
- :order="currentOrder"
|
|
|
|
|
- @dispatch="openDispatchDialog"
|
|
|
|
|
- @cancel="handleCancel"
|
|
|
|
|
- @command="handleCommand"
|
|
|
|
|
- @care-summary="openCareSummary"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <OrderDetailDrawer v-model:visible="detailVisible" :order="currentOrder" @dispatch="openDispatchDialog"
|
|
|
|
|
+ @cancel="handleCancel" @command="handleCommand" @care-summary="openCareSummary" />
|
|
|
|
|
|
|
|
- <DispatchDialog v-model:visible="dispatchDialogVisible" :order="currentDispatchOrder" @submit="handleDispatchSubmit" />
|
|
|
|
|
|
|
+ <DispatchDialog v-model:visible="dispatchDialogVisible" :order="currentDispatchOrder"
|
|
|
|
|
+ @submit="handleDispatchSubmit" />
|
|
|
|
|
|
|
|
<CareSummaryDrawer v-model:visible="careSummaryVisible" :order="careSummaryOrder" @submit="saveCareSummary" />
|
|
<CareSummaryDrawer v-model:visible="careSummaryVisible" :order="careSummaryOrder" @submit="saveCareSummary" />
|
|
|
|
|
|
|
@@ -189,8 +179,10 @@ import { listSubOrder } from '@/api/order/subOrder/index';
|
|
|
import { dispatchSubOrder } from '@/api/order/subOrder/index';
|
|
import { dispatchSubOrder } from '@/api/order/subOrder/index';
|
|
|
import { getSubOrderInfo } from '@/api/order/subOrder/index';
|
|
import { getSubOrderInfo } from '@/api/order/subOrder/index';
|
|
|
import { cancelSubOrder } from '@/api/order/subOrder/index';
|
|
import { cancelSubOrder } from '@/api/order/subOrder/index';
|
|
|
|
|
+import { remarkSubOrder } from '@/api/order/subOrder/index';
|
|
|
import { listOnStore as listAreaStationOnStore } from '@/api/system/areaStation';
|
|
import { listOnStore as listAreaStationOnStore } from '@/api/system/areaStation';
|
|
|
import { getStore } from '@/api/system/store';
|
|
import { getStore } from '@/api/system/store';
|
|
|
|
|
+import { reward } from '@/api/fulfiller/pool';
|
|
|
|
|
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
|
|
|
|
@@ -471,7 +463,7 @@ const handleDetail = async (row) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
- } catch {}
|
|
|
|
|
|
|
+ } catch { }
|
|
|
detailVisible.value = true;
|
|
detailVisible.value = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -570,22 +562,69 @@ const saveCareSummary = (text) => {
|
|
|
|
|
|
|
|
// 奖惩
|
|
// 奖惩
|
|
|
const openRewardDialog = (row) => {
|
|
const openRewardDialog = (row) => {
|
|
|
- currentOperateRow.value = row;
|
|
|
|
|
|
|
+ const typeName = getServiceName(row?.service);
|
|
|
|
|
+ const isTransport = row?.mode === 1 || row?.mode === '1';
|
|
|
|
|
+ const typeCode = isTransport ? 'transport' : typeName?.includes('喂') || typeName?.includes('遛') ? 'feeding' : 'washing';
|
|
|
|
|
+
|
|
|
|
|
+ const t = row?.subOrderType ?? row?.type;
|
|
|
|
|
+ const transportType =
|
|
|
|
|
+ typeof t === 'number' ? (t === 0 ? 'pick' : t === 1 ? 'drop' : t === 2 ? 'round' : undefined) :
|
|
|
|
|
+ (t === 'pick' || t === 'drop' || t === 'round' ? t : undefined);
|
|
|
|
|
+
|
|
|
|
|
+ currentOperateRow.value = {
|
|
|
|
|
+ ...row,
|
|
|
|
|
+ orderNo: row?.code || row?.orderNo,
|
|
|
|
|
+ type: typeCode,
|
|
|
|
|
+ transportType,
|
|
|
|
|
+ splitType: row?.splitType
|
|
|
|
|
+ };
|
|
|
rewardDialogVisible.value = true;
|
|
rewardDialogVisible.value = true;
|
|
|
};
|
|
};
|
|
|
-const handleRewardSubmit = (form) => {
|
|
|
|
|
- ElMessage.success(`操作成功:${form.type === 'reward' ? '奖励' : '惩罚'}已执行`);
|
|
|
|
|
|
|
+const handleRewardSubmit = async (form) => {
|
|
|
|
|
+ if (!currentOperateRow.value?.fulfiller) {
|
|
|
|
|
+ ElMessage.warning('当前订单未指派履约者,无法执行奖惩操作');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ await reward({
|
|
|
|
|
+ fulfillerId: currentOperateRow.value.fulfiller,
|
|
|
|
|
+ type: form.type,
|
|
|
|
|
+ target: form.item,
|
|
|
|
|
+ amount: form.value,
|
|
|
|
|
+ reason: form.reason
|
|
|
|
|
+ });
|
|
|
|
|
+ ElMessage.success(`操作成功:${form.type === 'reward' ? '奖励' : '惩罚'}已执行`);
|
|
|
|
|
+ handleSearch();
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ // Error handled by interceptor
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 备注
|
|
// 备注
|
|
|
const openRemarkDialog = (row) => {
|
|
const openRemarkDialog = (row) => {
|
|
|
- currentOperateRow.value = row;
|
|
|
|
|
|
|
+ currentOperateRow.value = {
|
|
|
|
|
+ ...row,
|
|
|
|
|
+ orderNo: row?.code || row?.orderNo
|
|
|
|
|
+ };
|
|
|
remarkDialogVisible.value = true;
|
|
remarkDialogVisible.value = true;
|
|
|
};
|
|
};
|
|
|
-const handleRemarkSubmit = (text) => {
|
|
|
|
|
- if (currentOperateRow.value) {
|
|
|
|
|
- currentOperateRow.value.remark = text;
|
|
|
|
|
- ElMessage.success('备注已更新');
|
|
|
|
|
|
|
+const handleRemarkSubmit = async (text) => {
|
|
|
|
|
+ if (!currentOperateRow.value?.id) {
|
|
|
|
|
+ ElMessage.warning('订单信息不存在');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ await remarkSubOrder({
|
|
|
|
|
+ orderId: currentOperateRow.value.id,
|
|
|
|
|
+ remark: text
|
|
|
|
|
+ });
|
|
|
|
|
+ if (currentOperateRow.value) {
|
|
|
|
|
+ currentOperateRow.value.remark = text;
|
|
|
|
|
+ }
|
|
|
|
|
+ ElMessage.success('备注已保存');
|
|
|
|
|
+ handleSearch();
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ // Error handled by interceptor
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|