入库单明细增加操作日志

main
HUOJIN\92525 2025-04-09 11:21:31 +08:00
parent 72a1b7773e
commit 90d593a388
4 changed files with 148 additions and 131 deletions

View File

@ -12,20 +12,20 @@
<a-form class="smart-query-form">
<a-row class="smart-query-form-row">
<a-form-item label="关键字" class="smart-query-form-item">
<a-input style="width: 300px" v-model:value="queryForm.keywords" placeholder="变更内容" />
<a-input style="width: 300px" v-model:value="queryForm.keywords" placeholder="变更内容"/>
</a-form-item>
<a-form-item class="smart-query-form-item smart-margin-left10">
<a-button-group>
<a-button type="primary" @click="onSearch">
<template #icon>
<SearchOutlined />
<SearchOutlined/>
</template>
查询
</a-button>
<a-button @click="onReload">
<template #icon>
<ReloadOutlined />
<ReloadOutlined/>
</template>
重置
</a-button>
@ -39,7 +39,7 @@
<!-- <DataTracerTable :tableData="tableData" @showDetail="showDetail" /> -->
<!--- timeline 时间轴形式 显示-->
<DataTracerTimeline :tableData="tableData" @showDetail="showDetail" />
<DataTracerTimeline :tableData="tableData" @showDetail="showDetail"/>
<a-pagination
showSizeChanger
@ -60,17 +60,17 @@
</a-card>
</template>
<script setup lang="ts">
import * as Diff from 'diff';
import * as Diff2Html from 'diff2html';
import 'diff2html/bundles/css/diff2html.min.css';
import uaparser from 'ua-parser-js';
import { nextTick, reactive, ref, watch } from 'vue';
import { dataTracerApi } from '/@/api/support/data-tracer-api';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
import { smartSentry } from '/@/lib/smart-sentry';
import DataTracerTimeline from './data-tracer-timeline.vue';
import * as Diff from 'diff';
import * as Diff2Html from 'diff2html';
import 'diff2html/bundles/css/diff2html.min.css';
import uaparser from 'ua-parser-js';
import {nextTick, reactive, ref, watch} from 'vue';
import {dataTracerApi} from '/@/api/support/data-tracer-api';
import {PAGE_SIZE, PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
import {smartSentry} from '/@/lib/smart-sentry';
import DataTracerTimeline from './data-tracer-timeline.vue';
let props = defineProps({
let props = defineProps({
// id
dataId: {
type: Number,
@ -79,35 +79,38 @@
type: {
type: Number,
},
});
});
// --------------- ---------------
// --------------- ---------------
const queryFormState = {
const queryFormState = {
pageNum: 1,
pageSize: PAGE_SIZE,
searchCount: true,
keywords: undefined,
};
const queryForm = reactive({ ...queryFormState });
const tableLoading = ref(false);
const tableData = ref([]);
const total = ref(0);
};
const queryForm = reactive({...queryFormState});
const tableLoading = ref(false);
const tableData = ref([]);
const total = ref(0);
function onReload() {
function onReload() {
Object.assign(queryForm, queryFormState);
onSearch();
}
}
function onSearch() {
function onSearch() {
queryForm.pageNum = 1;
ajaxQuery();
}
}
async function ajaxQuery() {
async function ajaxQuery() {
try {
tableLoading.value = true;
let responseModel = await dataTracerApi.queryList(Object.assign({}, queryForm, { dataId: props.dataId, type: props.type }));
let responseModel = await dataTracerApi.queryList(Object.assign({}, queryForm, {
dataId: props.dataId,
type: props.type
}));
for (const e of responseModel.data.list) {
if (!e.userAgent) {
continue;
@ -126,10 +129,10 @@
} finally {
tableLoading.value = false;
}
}
}
// ========= watch ===============
watch(
// ========= watch ===============
watch(
() => props.dataId,
(e) => {
if (e) {
@ -137,14 +140,15 @@
onSearch();
}
},
{ immediate: true }
);
{immediate: true}
);
// --------------- diff ---------------
// diff
const visibleDiff = ref(false);
let prettyHtml = ref('');
function showDetail(record) {
// --------------- diff ---------------
// diff
const visibleDiff = ref(false);
let prettyHtml = ref('');
function showDetail(record) {
visibleDiff.value = true;
let diffOld = record.diffOld.replaceAll('<br/>', '\r\n');
let diffNew = record.diffNew.replaceAll('<br/>', '\r\n');
@ -176,5 +180,9 @@
});
}
});
}
}
defineExpose({
ajaxQuery
});
</script>

View File

@ -8,7 +8,7 @@
* @Copyright 1024 https://1024lab.net Since 2012
*/
import { SmartEnum } from '/@/types/smart-enum';
import {SmartEnum} from '/@/types/smart-enum';
// 业务类型
export const DATA_TRACER_TYPE_ENUM: SmartEnum<number> = {
@ -24,6 +24,14 @@ export const DATA_TRACER_TYPE_ENUM: SmartEnum<number> = {
value: 3,
desc: 'OA-企业信息',
},
ASN: {
value: 4,
desc: '入库',
},
ASN_DETAIL: {
value: 5,
desc: '入库明细',
},
};
export default {

View File

@ -84,13 +84,13 @@
<a-card class="smart-margin-top10" size="small">
<a-tabs @change="handleTabChange">
<a-tab-pane key="asnDetail" tab="入库明细">
<ReceiveDetailList ref="receiveDetailListRef" :asnId="form.asnId" />
<ReceiveDetailList ref="receiveDetailListRef" :asnId="form.asnId"/>
</a-tab-pane>
<a-tab-pane key="asnTask" tab="收货详情">
<AsnTaskList ref="asnTaskListRef" :asnId="form.asnId"/>
</a-tab-pane>
<a-tab-pane key="dataTracer" tab="操作记录">
<DataTracer :dataId="form.asnId" :type="DATA_TRACER_TYPE_ENUM.OA_ENTERPRISE.value"/>
<DataTracer ref="dataTracerRef" :dataId="form.asnId" :type="DATA_TRACER_TYPE_ENUM.ASN.value"/>
</a-tab-pane>
</a-tabs>
</a-card>
@ -238,11 +238,15 @@ function onBack() {
//
const receiveDetailListRef = ref()
const asnTaskListRef = ref()
const dataTracerRef = ref()
function handleTabChange(activeKey: string) {
if (activeKey === 'asnDetail' && receiveDetailListRef.value) {
receiveDetailListRef.value.queryData();
}else if(activeKey === 'asnTask' && asnTaskListRef.value){
} else if (activeKey === 'asnTask' && asnTaskListRef.value) {
asnTaskListRef.value.queryData();
} else if (activeKey === 'dataTracer' && dataTracerRef.value) {
dataTracerRef.value.ajaxQuery();
}
}
</script>

View File

@ -157,9 +157,6 @@ async function queryData() {
let queryResult = await taskApi.queryPage(queryForm);
tableData.value = queryResult.data.list;
total.value = queryResult.data.total;
console.log(props.asnId);
console.log(selectedRowKeyList.value);
} catch (e) {
smartSentry.captureError(e);
} finally {