|
@@ -1,128 +0,0 @@
|
|
|
-<template>
|
|
|
- <el-dialog v-model="state.dialogVisible" draggable title="历史工单" ref="dialogRef" width="60%" append-to-body>
|
|
|
- <ProTable
|
|
|
- ref="proTableRef"
|
|
|
- :columns="columns"
|
|
|
- :data="state.tableData"
|
|
|
- @updateTable="queryList"
|
|
|
- :loading="state.loading"
|
|
|
- :total="state.total"
|
|
|
- v-model:page-index="state.queryParams.PageIndex"
|
|
|
- v-model:page-size="state.queryParams.PageSize"
|
|
|
- :toolButton="false"
|
|
|
- :isRefreshClearSelection="false"
|
|
|
- :selectIds="state.ruleForm.duplicateIds"
|
|
|
- max-height="500px"
|
|
|
- >
|
|
|
- <template #table-search>
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent>
|
|
|
- <el-form-item label="关键词" prop="Keyword">
|
|
|
- <el-input v-model="state.queryParams.Keyword" placeholder="工单标题/工单编码" clearable @keyup.enter="handleQuery" class="keyword-input"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
- <el-button @click="resetQuery(ruleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
- <template #title="{ row }">
|
|
|
- <order-detail :order="row" @updateList="queryList">{{ row.title }}</order-detail>
|
|
|
- </template>
|
|
|
- </ProTable>
|
|
|
- <template #footer>
|
|
|
- <span class="dialog-footer">
|
|
|
- <el-button class="default-button" @click="state.dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="selectConfirm" :disabled="!canChoose">确 定</el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script setup lang="ts" name="orderHistory">
|
|
|
-import { reactive, ref, defineAsyncComponent, computed } from 'vue';
|
|
|
-import type { FormInstance } from 'element-plus';
|
|
|
-import { historyOrder } from '@/api/business/order';
|
|
|
-import { useRoute } from 'vue-router';
|
|
|
-
|
|
|
-const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
|
|
|
-// 引入组件
|
|
|
-const emit = defineEmits(['saveSelect']);
|
|
|
-// 定义变量内容
|
|
|
-const state = reactive<any>({
|
|
|
- dialogVisible: false, // 弹窗显示隐藏
|
|
|
- queryParams: {
|
|
|
- PageIndex: 1, // 当前页
|
|
|
- PageSize: 10, // 每页条数
|
|
|
- Keyword: null, // 关键字
|
|
|
- },
|
|
|
- tableData: [], // 表格数据
|
|
|
- total: 0, // 总条数
|
|
|
- loading: false, // 加载状态
|
|
|
- ruleForm: {}, // 表单数据
|
|
|
-});
|
|
|
-// 表格配置项
|
|
|
-const columns = ref<any[]>([
|
|
|
- { type: 'selection', fixed: 'left', width: 50, align: 'center',reserveSelection:true },
|
|
|
- { prop: 'title', label: '工单标题'},
|
|
|
- { prop: 'no', label: '工单编码'},
|
|
|
- { prop: 'hotspotName', label: '热点分类' },
|
|
|
- { prop: 'currentStepName', label: '当前节点' },
|
|
|
- { prop: 'statusText', label: '工单状态', width: 100 },
|
|
|
-]);
|
|
|
-const ruleFormRef = ref<RefType>(); // 表单ref
|
|
|
-const route = useRoute(); // 路由
|
|
|
-// 打开弹窗
|
|
|
-const openDialog = (row: any) => {
|
|
|
- state.ruleForm = row;
|
|
|
- queryList();
|
|
|
- state.dialogVisible = true;
|
|
|
-};
|
|
|
-const dialogRef = ref<RefType>();
|
|
|
-// 关闭弹窗
|
|
|
-const closeDialog = () => {
|
|
|
- state.dialogVisible = false;
|
|
|
-};
|
|
|
-/** 搜索按钮操作 */
|
|
|
-const handleQuery = () => {
|
|
|
- state.queryParams.PageIndex = 1;
|
|
|
- queryList();
|
|
|
-};
|
|
|
-/** 重置按钮操作 */
|
|
|
-const resetQuery = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.resetFields();
|
|
|
- handleQuery();
|
|
|
-};
|
|
|
-/** 获取历史工单 */
|
|
|
-const queryList = () => {
|
|
|
- if (!state.ruleForm.contact) return;
|
|
|
- state.loading = true;
|
|
|
- let request = {
|
|
|
- ...state.queryParams,
|
|
|
- PhoneNo: state.ruleForm.contact,
|
|
|
- OrderId: route.query.id ?? '', //传入id 排除重复工单选择自己
|
|
|
- };
|
|
|
- historyOrder(request)
|
|
|
- .then((response: any) => {
|
|
|
- state.tableData = response?.result.items ?? [];
|
|
|
- state.total = response?.result.total;
|
|
|
- state.loading = false;
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- state.loading = false;
|
|
|
- });
|
|
|
-};
|
|
|
-const proTableRef = ref<RefType>();
|
|
|
-const canChoose = computed(() => {
|
|
|
- return proTableRef.value?.selectedList.length;
|
|
|
-});
|
|
|
-// 确定选择历史工单
|
|
|
-const selectConfirm = () => {
|
|
|
- emit('saveSelect', proTableRef.value?.selectedList);
|
|
|
-};
|
|
|
-// 暴露变量
|
|
|
-defineExpose({
|
|
|
- openDialog,
|
|
|
- closeDialog,
|
|
|
-});
|
|
|
-</script>
|