gongchunyi
7 小时以前 a5e0e0de30cfa041d473dbd2d5111abb7689c9d7
fix: 售后移除维修记录
已修改2个文件
103 ■■■■■ 文件已修改
src/api/customerService/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/afterSalesHandling/index.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/customerService/index.js
@@ -66,15 +66,6 @@
  })
}
// 售后处理-维修记录列表
export function afterSalesServiceRepairListPage(query) {
  return request({
    url: '/afterSalesService/repair/listPage',
    method: 'get',
    params: query,
  })
}
// 临期售后管理-分页查询
export function expiryAfterSalesListPage(query) {
  return request({
src/views/customerService/afterSalesHandling/index.vue
@@ -55,41 +55,10 @@
            :upload-method="handleFileUpload"
            :delete-method="handleFileDelete"
        />
        <el-dialog
            v-model="repairDialogVisible"
            title="维修记录"
            width="700px"
            destroy-on-close
            @close="repairRecordList = []"
        >
            <el-table
                :data="repairRecordList"
                border
                v-loading="repairRecordLoading"
                max-height="400"
            >
                <el-table-column type="index" label="序号" width="55" align="center" />
                <el-table-column label="维修日期" prop="maintenanceTime" min-width="120" show-overflow-tooltip>
                    <template #default="{ row }">
                        {{ row.maintenanceTime || row.repairTime || '-' }}
                    </template>
                </el-table-column>
                <el-table-column label="维修人" prop="maintenanceName" min-width="100" show-overflow-tooltip>
                    <template #default="{ row }">
                        {{ row.maintenanceName || row.repairName || '-' }}
                    </template>
                </el-table-column>
                <el-table-column label="维修结果" prop="maintenanceResult" min-width="180" show-overflow-tooltip />
            </el-table>
            <template #footer>
                <el-button @click="repairDialogVisible = false">关闭</el-button>
            </template>
        </el-dialog>
    </div>
</template>
<script setup>
import {Search} from "@element-plus/icons-vue";
import { onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
import FormDia from "@/views/customerService/afterSalesHandling/components/formDia.vue";
import FileListDialog from "@/components/Dialog/FileListDialog.vue";
@@ -97,12 +66,9 @@
import request from "@/utils/request";
import { getToken } from "@/utils/auth";
import {
    afterSalesServiceDelete,
    afterSalesServiceListPage,
    afterSalesServiceFileListPage,
    afterSalesServiceFileAdd,
    afterSalesServiceFileDel,
    afterSalesServiceRepairListPage,
} from "@/api/customerService/index.js";
import useUserStore from "@/store/modules/user.js";
const { proxy } = getCurrentInstance();
@@ -210,14 +176,6 @@
                    openFilesFormDia(row);
                },
            },
            // TODO 为写报告添加的
            {
                name: "维修记录",
                type: "text",
                clickFun: (row) => {
                    openRepairDialog(row);
                },
            },
        ],
    },
]);
@@ -238,30 +196,7 @@
const fileListRef = ref(null)
const fileListDialogVisible = ref(false)
const currentFileRow = ref(null)
const repairDialogVisible = ref(false)
const repairRecordList = ref([])
const repairRecordLoading = ref(false)
// 打开维修记录弹框
const openRepairDialog = async (row) => {
    repairDialogVisible.value = true
    repairRecordLoading.value = true
    repairRecordList.value = []
    try {
        const res = await afterSalesServiceRepairListPage({
            afterSalesServiceId: row.id,
            current: 1,
            size: 100,
        })
        if (res.code === 200 && res.data?.records) {
            repairRecordList.value = res.data.records
        }
    } catch (error) {
        proxy.$modal.msgError("获取维修记录失败")
    } finally {
        repairRecordLoading.value = false
    }
}
// 打开附件弹框
const openFilesFormDia = async (row) => {
@@ -428,35 +363,6 @@
    nextTick(() => {
        formDia.value?.openDialog(type, row)
    })
};
const handleDelete = () => {
    let ids = [];
    if (selectedRows.value.length > 0) {
        ids = selectedRows.value.map((item) => item.id);
    } else {
        proxy.$modal.msgWarning("请选择数据");
        return;
    }
    ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "删除提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
    })
        .then(() => {
            tableLoading.value = true;
            afterSalesServiceDelete(ids)
                .then((res) => {
                    proxy.$modal.msgSuccess("删除成功");
                    getList();
                })
                .finally(() => {
                    tableLoading.value = false;
                });
        })
        .catch(() => {
            proxy.$modal.msg("已取消");
        });
};
// 导出