|
@@ -1,61 +1,63 @@
|
|
|
<template>
|
|
|
- <el-dialog v-model="state.dialogVisible" width="60%" draggable title="查看修改记录" append-to-body destroy-on-close>
|
|
|
- <ProTable ref="proTableRef" :columns="columns" :data="state.tableData" @updateTable="queryList" :loading="state.loading" :pagination="false">
|
|
|
- </ProTable>
|
|
|
- <template #footer>
|
|
|
- <el-button @click="state.dialogVisible = false" class="default-button">关 闭</el-button>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
+ <el-dialog v-model="state.dialogVisible" width="60%" draggable title="查看修改记录" append-to-body destroy-on-close>
|
|
|
+ <ProTable ref="proTableRef" :columns="columns" :data="state.tableData" @updateTable="queryList" :loading="state.loading" :pagination="false">
|
|
|
+ </ProTable>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="state.dialogVisible = false" class="default-button">关 闭</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
<script setup lang="tsx">
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
import { reactive, ref } from 'vue';
|
|
|
-import { getEditRecord } from "@/api/dataShare";
|
|
|
+import { getEditRecord } from '@/api/dataShare';
|
|
|
|
|
|
const state = reactive({
|
|
|
- queryParams: {
|
|
|
- id: '',
|
|
|
- },
|
|
|
- tableData: [], //表格
|
|
|
- loading: false, // 加载
|
|
|
- total: 0, // 总数
|
|
|
- dialogVisible: false, // 弹窗
|
|
|
+ queryParams: {
|
|
|
+ id: '',
|
|
|
+ },
|
|
|
+ tableData: [], //表格
|
|
|
+ loading: false, // 加载
|
|
|
+ total: 0, // 总数
|
|
|
+ dialogVisible: false, // 弹窗
|
|
|
});
|
|
|
const columns = ref<any[]>([
|
|
|
- {
|
|
|
- label: '修改时间',
|
|
|
- prop: 'creationTime',
|
|
|
- width: 170,
|
|
|
- render: (scope: any) => {
|
|
|
- return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
- },
|
|
|
- },
|
|
|
- { prop: 'creatorName', label: '修改人'},
|
|
|
- { prop: 'creatorOrgName', label: '修改人部门'},
|
|
|
- { prop: 'provinceNo', label: '省工单编码'},
|
|
|
- { prop: 'updateOrderTypeText', label: '修改类型', width: 150 },
|
|
|
+ { prop: 'updateOrderTypeText', label: '修改类型', width: 150 },
|
|
|
+ { prop: 'oldValue', label: '修改前' },
|
|
|
+ { prop: 'newValue', label: '修改后' },
|
|
|
+ {
|
|
|
+ label: '修改时间',
|
|
|
+ prop: 'creationTime',
|
|
|
+ width: 170,
|
|
|
+ render: (scope: any) => {
|
|
|
+ return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { prop: 'creatorName', label: '修改人' },
|
|
|
+ { prop: 'orderNo', label: '工单编码' },
|
|
|
+ { prop: 'provinceNo', label: '省工单编码',width: 210 },
|
|
|
]);
|
|
|
// 打开弹窗
|
|
|
const openDialog = (row?: any) => {
|
|
|
- if (row) {
|
|
|
- state.queryParams.id = row.id;
|
|
|
- queryList();
|
|
|
- }
|
|
|
+ if (row) {
|
|
|
+ state.queryParams.id = row.id;
|
|
|
+ queryList();
|
|
|
+ }
|
|
|
};
|
|
|
// 查看修改记录
|
|
|
const queryList = async () => {
|
|
|
- state.dialogVisible = true;
|
|
|
- try {
|
|
|
- state.loading = true;
|
|
|
- const res = await getEditRecord(state.queryParams);
|
|
|
- state.tableData = res.result ?? [];
|
|
|
- state.loading = false;
|
|
|
- } catch (e) {
|
|
|
- console.log(e);
|
|
|
- state.loading = false;
|
|
|
- }
|
|
|
+ state.dialogVisible = true;
|
|
|
+ try {
|
|
|
+ state.loading = true;
|
|
|
+ const res = await getEditRecord(state.queryParams);
|
|
|
+ state.tableData = res.result ?? [];
|
|
|
+ state.loading = false;
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ state.loading = false;
|
|
|
+ }
|
|
|
};
|
|
|
defineExpose({
|
|
|
- openDialog,
|
|
|
+ openDialog,
|
|
|
});
|
|
|
</script>
|