|
|
@@ -7,48 +7,46 @@
|
|
|
<span class="title">异常上报管理</span>
|
|
|
</div>
|
|
|
<div class="right-panel" style="display: flex; align-items: center; gap: 10px">
|
|
|
- <el-input v-model="searchKey" placeholder="订单号/履约者姓名" prefix-icon="Search" clearable style="width: 220px" />
|
|
|
- <el-select v-model="searchType" placeholder="异常类型" clearable style="width: 140px">
|
|
|
- <el-option label="无法联系用户" value="contact_fail" />
|
|
|
- <el-option label="地址错误" value="addr_error" />
|
|
|
- <el-option label="宠物攻击性强" value="pet_aggressive" />
|
|
|
- <el-option label="天气原因" value="weather_delay" />
|
|
|
- <el-option label="突发意外" value="accident" />
|
|
|
+ <el-input v-model="queryParams.content" placeholder="订单号/履约者姓名" prefix-icon="Search" clearable @keyup.enter="handleQuery" style="width: 220px" />
|
|
|
+ <el-select v-model="queryParams.type" placeholder="异常类型" clearable @change="handleQuery" style="width: 140px">
|
|
|
+ <el-option v-for="dict in flf_anamaly_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
</el-select>
|
|
|
- <el-select v-model="searchStatus" placeholder="审核状态" clearable style="width: 120px">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="审核状态" clearable @change="handleQuery" style="width: 120px">
|
|
|
<el-option label="待审核" :value="0" />
|
|
|
<el-option label="已通过" :value="1" />
|
|
|
<el-option label="已驳回" :value="2" />
|
|
|
</el-select>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
<el-button type="primary" icon="Plus" @click="handleAdd">新增上报</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
- <el-table :data="filteredTableData" style="width: 100%" v-loading="loading">
|
|
|
- <el-table-column prop="orderNo" label="关联订单号" width="180">
|
|
|
+ <el-table :data="tableData" style="width: 100%" v-loading="loading">
|
|
|
+ <el-table-column prop="orderId" label="关联订单号" width="180">
|
|
|
<template #default="scope">
|
|
|
- <el-link type="primary" :underline="false">{{ scope.row.orderNo }}</el-link>
|
|
|
+ <el-link type="primary" :underline="false">{{ scope.row.orderNo || scope.row.orderId }}</el-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="type" label="异常类型" width="120">
|
|
|
<template #default="scope">
|
|
|
- <el-tag :type="getExceptionTag(scope.row.type)">{{ getExceptionLabel(scope.row.type) }}</el-tag>
|
|
|
+ <dict-tag :options="flf_anamaly_type" :value="scope.row.type" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="fulfillerName" label="履约者" width="150">
|
|
|
+ <el-table-column prop="fulfiller" label="履约者" width="150">
|
|
|
<template #default="scope">
|
|
|
- <div>{{ scope.row.fulfillerName }}</div>
|
|
|
- <div style="font-size: 12px; color: #999">{{ scope.row.fulfillerPhone }}</div>
|
|
|
+ <div>{{ scope.row.fulfillerName || scope.row.fulfiller }}</div>
|
|
|
+ <div style="font-size: 12px; color: #999" v-if="scope.row.fulfillerPhone">{{ scope.row.fulfillerPhone }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="content" label="上报内容" show-overflow-tooltip />
|
|
|
- <el-table-column prop="images" label="上报图片" width="120">
|
|
|
+ <el-table-column prop="photosUrls" label="上报图片" width="120">
|
|
|
<template #default="scope">
|
|
|
- <div v-if="scope.row.images && scope.row.images.length">
|
|
|
+ <div v-if="scope.row.photosUrls && scope.row.photosUrls.length">
|
|
|
<el-image
|
|
|
- :src="scope.row.images[0]"
|
|
|
- :preview-src-list="scope.row.images"
|
|
|
+ :src="scope.row.photosUrls[0]"
|
|
|
+ :preview-src-list="scope.row.photosUrls"
|
|
|
fit="cover"
|
|
|
style="width: 40px; height: 40px; border-radius: 4px"
|
|
|
preview-teleported
|
|
|
@@ -59,7 +57,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-image>
|
|
|
- <span v-if="scope.row.images.length > 1" style="font-size: 12px; color: #999; margin-left: 5px">+{{ scope.row.images.length }}</span>
|
|
|
+ <span v-if="scope.row.photosUrls.length > 1" style="font-size: 12px; color: #999; margin-left: 5px">+{{ scope.row.photosUrls.length }}</span>
|
|
|
</div>
|
|
|
<span v-else style="color: #ccc">无图</span>
|
|
|
</template>
|
|
|
@@ -89,13 +87,13 @@
|
|
|
|
|
|
<div class="pagination-container">
|
|
|
<el-pagination
|
|
|
- v-model:current-page="currentPage"
|
|
|
- v-model:page-size="pageSize"
|
|
|
+ v-model:current-page="queryParams.pageNum"
|
|
|
+ v-model:page-size="queryParams.pageSize"
|
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
:total="total"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
+ @size-change="getList"
|
|
|
+ @current-change="getList"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -105,12 +103,12 @@
|
|
|
<div class="drawer-content">
|
|
|
<!-- 1. Basic Info -->
|
|
|
<el-descriptions title="基础信息" :column="2" border>
|
|
|
- <el-descriptions-item label="订单号">{{ currentItem.orderNo }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订单号">{{ currentItem.orderNo || currentItem.orderId }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="提交时间">{{ currentItem.createTime }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="履约者">{{ currentItem.fulfillerName }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="联系电话">{{ currentItem.fulfillerPhone }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="履约者">{{ currentItem.fulfillerName || currentItem.fulfiller }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="联系电话">{{ currentItem.fulfillerPhone || '-' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="异常类型">
|
|
|
- <el-tag :type="getExceptionTag(currentItem.type)">{{ getExceptionLabel(currentItem.type) }}</el-tag>
|
|
|
+ <dict-tag :options="flf_anamaly_type" :value="currentItem.type" />
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="当前状态">
|
|
|
<el-tag v-if="currentItem.status === 0" type="warning">待审核</el-tag>
|
|
|
@@ -123,12 +121,12 @@
|
|
|
<div class="section-block">
|
|
|
<div class="section-title">上报内容</div>
|
|
|
<div class="text-content">{{ currentItem.content }}</div>
|
|
|
- <div class="image-list" v-if="currentItem.images && currentItem.images.length">
|
|
|
+ <div class="image-list" v-if="currentItem.photosUrls && currentItem.photosUrls.length">
|
|
|
<el-image
|
|
|
- v-for="(img, idx) in currentItem.images"
|
|
|
+ v-for="(img, idx) in currentItem.photosUrls"
|
|
|
:key="idx"
|
|
|
:src="img"
|
|
|
- :preview-src-list="currentItem.images"
|
|
|
+ :preview-src-list="currentItem.photosUrls"
|
|
|
:initial-index="idx"
|
|
|
fit="cover"
|
|
|
class="detail-img"
|
|
|
@@ -163,12 +161,12 @@
|
|
|
<el-timeline-item :timestamp="currentItem.createTime" placement="top" type="primary">
|
|
|
<el-card shadow="never" class="log-card">
|
|
|
<h4>提交上报</h4>
|
|
|
- <p>履约者 {{ currentItem.fulfillerName }} 提交了异常上报</p>
|
|
|
+ <p>履约者 {{ currentItem.fulfillerName || currentItem.fulfiller }} 提交了异常上报</p>
|
|
|
</el-card>
|
|
|
</el-timeline-item>
|
|
|
<el-timeline-item
|
|
|
v-if="currentItem.status !== 0"
|
|
|
- :timestamp="currentItem.auditTime || '2026-02-05 18:00:00'"
|
|
|
+ :timestamp="currentItem.auditTime || '未知时间'"
|
|
|
placement="top"
|
|
|
:type="currentItem.status === 1 ? 'success' : 'danger'"
|
|
|
>
|
|
|
@@ -187,36 +185,31 @@
|
|
|
<el-dialog v-model="dialogVisible" :title="isEdit ? '编辑异常' : '新增异常'" width="600px">
|
|
|
<el-form :model="form" label-width="100px">
|
|
|
<el-form-item label="关联订单" required>
|
|
|
- <el-input v-model="form.orderNo" placeholder="请输入订单号" />
|
|
|
+ <el-input v-model="form.orderCode" placeholder="请输入订单号" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="履约者" required>
|
|
|
- <el-select v-model="form.fulfillerId" filterable placeholder="请输入姓名/电话检索" style="width: 100%" @change="handleFulfillerSelect">
|
|
|
- <el-option v-for="item in fulfillerOptions" :key="item.id" :label="item.name + ' - ' + item.phone" :value="item.id" />
|
|
|
- </el-select>
|
|
|
+ <PageSelect
|
|
|
+ v-model="form.fulfiller"
|
|
|
+ :options="fulfillerOptions"
|
|
|
+ :total="fulfillerTotal"
|
|
|
+ :pageSize="fulfillerQueryParams.pageSize"
|
|
|
+ placeholder="请输入姓名/电话检索"
|
|
|
+ :filter-method="handleFulfillerSearch"
|
|
|
+ @page-change="handleFulfillerPageChange"
|
|
|
+ @change="handleFulfillerSelect"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="异常类型" required>
|
|
|
<el-select v-model="form.type" placeholder="请选择类型" style="width: 100%">
|
|
|
- <el-option label="无法联系用户" value="contact_fail" />
|
|
|
- <el-option label="地址错误/不存在" value="addr_error" />
|
|
|
- <el-option label="宠物攻击性强" value="pet_aggressive" />
|
|
|
- <el-option label="恶劣天气延迟" value="weather_delay" />
|
|
|
- <el-option label="突发意外" value="accident" />
|
|
|
+ <el-option v-for="dict in flf_anamaly_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="上报内容" required>
|
|
|
<el-input v-model="form.content" type="textarea" :rows="3" placeholder="请详细描述异常情况..." />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="现场图片">
|
|
|
- <el-upload
|
|
|
- action="#"
|
|
|
- list-type="picture-card"
|
|
|
- :auto-upload="false"
|
|
|
- v-model:file-list="fileList"
|
|
|
- :on-change="handleFileChange"
|
|
|
- :on-remove="handleFileRemove"
|
|
|
- >
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
- </el-upload>
|
|
|
+ <ImageUpload v-model="form.photos" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -229,158 +222,149 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script setup>
|
|
|
-import { ref, reactive, computed } from 'vue';
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, reactive, onMounted, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
+import { getAnamalyList, addAnamaly } from '@/api/fulfiller/anamaly';
|
|
|
+import type { AnamalyQuery, AnamalyVO, AnamalyForm } from '@/api/fulfiller/anamaly/types';
|
|
|
+import { listByNameAndPhoneNumber } from '@/api/fulfiller/fulfiller';
|
|
|
+import type { FulfillerSearchQuery } from '@/api/fulfiller/fulfiller/types';
|
|
|
+import PageSelect from '@/components/PageSelect/index.vue';
|
|
|
+import ImageUpload from '@/components/ImageUpload/index.vue';
|
|
|
+
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+const { flf_anamaly_type } = toRefs<any>(proxy?.useDict('flf_anamaly_type'));
|
|
|
|
|
|
const loading = ref(false);
|
|
|
-const searchKey = ref('');
|
|
|
-const searchType = ref('');
|
|
|
-const searchStatus = ref('');
|
|
|
-const currentPage = ref(1);
|
|
|
-const pageSize = ref(10);
|
|
|
-const total = ref(42);
|
|
|
+
|
|
|
+const queryParams = reactive<AnamalyQuery>({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ content: '',
|
|
|
+ type: '',
|
|
|
+ status: undefined
|
|
|
+});
|
|
|
+
|
|
|
+const total = ref(0);
|
|
|
+const tableData = ref<AnamalyVO[]>([]);
|
|
|
+
|
|
|
+const getList = async () => {
|
|
|
+ loading.value = true;
|
|
|
+ try {
|
|
|
+ const res = await getAnamalyList(queryParams);
|
|
|
+ tableData.value = res.rows;
|
|
|
+ total.value = res.total;
|
|
|
+ } finally {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleQuery = () => {
|
|
|
+ queryParams.pageNum = 1;
|
|
|
+ getList();
|
|
|
+};
|
|
|
+
|
|
|
+const resetQuery = () => {
|
|
|
+ queryParams.content = '';
|
|
|
+ queryParams.type = '';
|
|
|
+ queryParams.status = undefined;
|
|
|
+ handleQuery();
|
|
|
+};
|
|
|
|
|
|
// Dialog State (For Add/Edit)
|
|
|
const dialogVisible = ref(false);
|
|
|
const isEdit = ref(false);
|
|
|
-const fileList = ref([]);
|
|
|
-
|
|
|
-// Mock Fulfiller Search Options
|
|
|
-const fulfillerOptions = ref([
|
|
|
- { id: 101, name: '李建国', phone: '13812341234' },
|
|
|
- { id: 102, name: '王大力', phone: '13987654321' },
|
|
|
- { id: 103, name: '张小妹', phone: '13766668888' },
|
|
|
- { id: 104, name: '刘跑跑', phone: '13611112222' }
|
|
|
-]);
|
|
|
-
|
|
|
-const handleFulfillerSelect = (id) => {
|
|
|
- const target = fulfillerOptions.value.find((item) => item.id === id);
|
|
|
- if (target) {
|
|
|
- form.fulfillerName = target.name;
|
|
|
- form.fulfillerPhone = target.phone;
|
|
|
- }
|
|
|
+const fulfillerOptions = ref<any[]>([]);
|
|
|
+const fulfillerTotal = ref(0);
|
|
|
+const fulfillerQueryParams = reactive<FulfillerSearchQuery>({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ content: ''
|
|
|
+});
|
|
|
+
|
|
|
+const getFulfillerList = async () => {
|
|
|
+ const res = await listByNameAndPhoneNumber(fulfillerQueryParams);
|
|
|
+ fulfillerTotal.value = res.total;
|
|
|
+ fulfillerOptions.value = res.rows.map((item: any) => ({
|
|
|
+ label: `${item.name} - ${item.phoneNumber}`,
|
|
|
+ value: item.id,
|
|
|
+ name: item.name,
|
|
|
+ phone: item.phoneNumber
|
|
|
+ }));
|
|
|
+};
|
|
|
+
|
|
|
+const handleFulfillerSearch = (query: string) => {
|
|
|
+ fulfillerQueryParams.content = query;
|
|
|
+ fulfillerQueryParams.pageNum = 1;
|
|
|
+ getFulfillerList();
|
|
|
+};
|
|
|
+
|
|
|
+const handleFulfillerPageChange = (page: number) => {
|
|
|
+ fulfillerQueryParams.pageNum = page;
|
|
|
+ getFulfillerList();
|
|
|
+};
|
|
|
+
|
|
|
+const handleFulfillerSelect = (id: any) => {
|
|
|
+ // 备用选择回调
|
|
|
};
|
|
|
|
|
|
// Drawer State (For Audit/View)
|
|
|
const drawerVisible = ref(false);
|
|
|
const drawerMode = ref('view'); // 'audit' or 'view'
|
|
|
-const currentItem = ref({});
|
|
|
+const currentItem = ref<Partial<AnamalyVO>>({});
|
|
|
const auditForm = reactive({ result: 1, remark: '' });
|
|
|
|
|
|
-const form = reactive({
|
|
|
- id: '',
|
|
|
- orderNo: '',
|
|
|
- fulfillerId: '',
|
|
|
- fulfillerName: '',
|
|
|
- fulfillerPhone: '',
|
|
|
+const form = reactive<AnamalyForm>({
|
|
|
+ id: undefined,
|
|
|
+ orderCode: undefined,
|
|
|
+ fulfiller: undefined,
|
|
|
type: '',
|
|
|
content: '',
|
|
|
- images: [],
|
|
|
- status: 0,
|
|
|
- auditRemark: ''
|
|
|
-});
|
|
|
-
|
|
|
-// Mock Data
|
|
|
-const tableData = ref([
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- orderNo: 'ORD202402048805',
|
|
|
- fulfillerName: '李建国',
|
|
|
- fulfillerPhone: '13812341234',
|
|
|
- type: 'contact_fail',
|
|
|
- content: '到达指定地点后,多次拨打宠主电话无人接听,敲门无响应超过15分钟。',
|
|
|
- images: [
|
|
|
- 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
|
|
|
- 'https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png'
|
|
|
- ],
|
|
|
- status: 0,
|
|
|
- createTime: '2026-02-04 14:30:00',
|
|
|
- auditRemark: '',
|
|
|
- auditTime: ''
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- orderNo: 'ORD202402048802',
|
|
|
- fulfillerName: '王大力',
|
|
|
- fulfillerPhone: '13987654321',
|
|
|
- type: 'pet_aggressive',
|
|
|
- content: '进门时金毛表现出强烈护食行为,试图攻击,无法进行喂食操作。',
|
|
|
- images: [],
|
|
|
- status: 1,
|
|
|
- auditRemark: '已确认,取消本次订单,按此单结算跑腿费。',
|
|
|
- createTime: '2026-02-04 10:15:00',
|
|
|
- auditTime: '2026-02-04 11:00:00'
|
|
|
- }
|
|
|
-]);
|
|
|
-
|
|
|
-const filteredTableData = computed(() => {
|
|
|
- return tableData.value.filter((item) => {
|
|
|
- const matchKey = !searchKey.value || item.orderNo.includes(searchKey.value) || item.fulfillerName.includes(searchKey.value);
|
|
|
- const matchType = !searchType.value || item.type === searchType.value;
|
|
|
- const matchStatus = searchStatus.value === '' || item.status === searchStatus.value;
|
|
|
- return matchKey && matchType && matchStatus;
|
|
|
- });
|
|
|
+ photos: '',
|
|
|
+ status: 0
|
|
|
});
|
|
|
|
|
|
-// Helpers
|
|
|
-const getExceptionLabel = (type) => {
|
|
|
- const map = {
|
|
|
- 'contact_fail': '无法联系用户',
|
|
|
- 'addr_error': '地址错误',
|
|
|
- 'pet_aggressive': '宠物攻击性强',
|
|
|
- 'weather_delay': '恶劣天气延迟',
|
|
|
- 'accident': '突发意外'
|
|
|
- };
|
|
|
- return map[type] || '其他';
|
|
|
-};
|
|
|
-
|
|
|
-const getExceptionTag = (type) => {
|
|
|
- const map = {
|
|
|
- 'contact_fail': 'warning',
|
|
|
- 'addr_error': 'info',
|
|
|
- 'pet_aggressive': 'danger',
|
|
|
- 'weather_delay': 'primary',
|
|
|
- 'accident': 'danger'
|
|
|
- };
|
|
|
- return map[type] || 'info';
|
|
|
-};
|
|
|
-
|
|
|
// Actions
|
|
|
const handleAdd = () => {
|
|
|
isEdit.value = false;
|
|
|
- fileList.value = [];
|
|
|
Object.assign(form, {
|
|
|
- id: '',
|
|
|
- orderNo: '',
|
|
|
- fulfillerId: '',
|
|
|
- fulfillerName: '',
|
|
|
- fulfillerPhone: '',
|
|
|
+ id: undefined,
|
|
|
+ orderCode: undefined,
|
|
|
+ fulfiller: undefined,
|
|
|
type: '',
|
|
|
content: '',
|
|
|
- images: [],
|
|
|
- status: 0,
|
|
|
- auditRemark: ''
|
|
|
+ photos: '',
|
|
|
+ status: 0
|
|
|
});
|
|
|
+ getFulfillerList();
|
|
|
dialogVisible.value = true;
|
|
|
};
|
|
|
|
|
|
-const handleEdit = (row) => {
|
|
|
+const handleEdit = (row: AnamalyVO) => {
|
|
|
isEdit.value = true;
|
|
|
- Object.assign(form, JSON.parse(JSON.stringify(row)));
|
|
|
- fileList.value = (row.images || []).map((url, i) => ({ name: `img${i}`, url: url }));
|
|
|
+ Object.assign(form, {
|
|
|
+ id: row.id,
|
|
|
+ orderCode: row.orderNo || String(row.orderId),
|
|
|
+ fulfiller: row.fulfiller,
|
|
|
+ type: row.type,
|
|
|
+ content: row.content,
|
|
|
+ photos: row.photos,
|
|
|
+ status: row.status
|
|
|
+ });
|
|
|
+ getFulfillerList();
|
|
|
dialogVisible.value = true;
|
|
|
};
|
|
|
|
|
|
-const handleDelete = (row) => {
|
|
|
+const handleDelete = (row: AnamalyVO) => {
|
|
|
ElMessageBox.confirm('确定删除该条记录吗?', '警告', { type: 'warning' }).then(() => {
|
|
|
- tableData.value = tableData.value.filter((item) => item.id !== row.id);
|
|
|
- ElMessage.success('删除成功');
|
|
|
+ // 假设未来需要对接删除接口: await deleteAnamaly(row.id);
|
|
|
+ // tableData.value = tableData.value.filter((item) => item.id !== row.id);
|
|
|
+ ElMessage.success('请完善删除接口');
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// Open Drawer for Audit or View
|
|
|
-const handleOpenDrawer = (row, mode) => {
|
|
|
+const handleOpenDrawer = (row: AnamalyVO, mode: string) => {
|
|
|
drawerMode.value = mode;
|
|
|
currentItem.value = JSON.parse(JSON.stringify(row));
|
|
|
// Reset audit form
|
|
|
@@ -392,43 +376,31 @@ const handleOpenDrawer = (row, mode) => {
|
|
|
};
|
|
|
|
|
|
const submitAudit = () => {
|
|
|
- const target = tableData.value.find((i) => i.id === currentItem.value.id);
|
|
|
- if (target) {
|
|
|
- target.status = auditForm.result;
|
|
|
- target.auditRemark = auditForm.remark;
|
|
|
- target.auditTime = new Date().toLocaleString();
|
|
|
- ElMessage.success('审核已提交');
|
|
|
- drawerVisible.value = false;
|
|
|
- }
|
|
|
+ // 假设未来对接审核接口: await auditAnamaly(currentItem.value.id, auditForm.result, auditForm.remark);
|
|
|
+ ElMessage.success('请完善审核接口');
|
|
|
+ drawerVisible.value = false;
|
|
|
};
|
|
|
|
|
|
-const saveData = () => {
|
|
|
- if (!form.orderNo || !form.type) return ElMessage.warning('请填写必填项');
|
|
|
+const saveData = async () => {
|
|
|
+ if (!form.orderCode || !form.type) return ElMessage.warning('请填写必填项');
|
|
|
|
|
|
- form.images = fileList.value.map((f) => f.url || 'https://placeholder.com/img');
|
|
|
-
|
|
|
- if (isEdit.value) {
|
|
|
- const idx = tableData.value.findIndex((i) => i.id === form.id);
|
|
|
- if (idx !== -1) Object.assign(tableData.value[idx], form);
|
|
|
- } else {
|
|
|
- tableData.value.unshift({
|
|
|
- id: Date.now(),
|
|
|
- ...form,
|
|
|
- createTime: new Date().toLocaleString()
|
|
|
- });
|
|
|
+ try {
|
|
|
+ if (!isEdit.value) {
|
|
|
+ await addAnamaly(form);
|
|
|
+ ElMessage.success('新增上报成功');
|
|
|
+ } else {
|
|
|
+ ElMessage.success('请完善编辑接口');
|
|
|
+ }
|
|
|
+ dialogVisible.value = false;
|
|
|
+ getList();
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error);
|
|
|
}
|
|
|
- ElMessage.success('保存成功');
|
|
|
- dialogVisible.value = false;
|
|
|
};
|
|
|
|
|
|
-const handleFileChange = (uploadFile, uploadFiles) => {
|
|
|
- fileList.value = uploadFiles;
|
|
|
-};
|
|
|
-const handleFileRemove = (uploadFile, uploadFiles) => {
|
|
|
- fileList.value = uploadFiles;
|
|
|
-};
|
|
|
-const handleSizeChange = (val) => {};
|
|
|
-const handleCurrentChange = (val) => {};
|
|
|
+onMounted(() => {
|
|
|
+ getList();
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|