Commit b52929e9 by qinjianhui

feat: 操作单操作日志

parent 7dd60816
...@@ -32,9 +32,12 @@ defineProps({ ...@@ -32,9 +32,12 @@ defineProps({
.log-list { .log-list {
height: 500px; height: 500px;
overflow: auto; overflow: auto;
font-size: 14px;
} }
.log-item { .log-item {
line-height: 26px; line-height: 26px;
white-space: pre-wrap;
word-break: break-all;
} }
.log-item div:not(:last-child) { .log-item div:not(:last-child) {
margin-right: 6px; margin-right: 6px;
......
...@@ -95,7 +95,11 @@ ...@@ -95,7 +95,11 @@
> >
{{ item.customizedQuantity === 1 ? '单' : '多' }} {{ item.customizedQuantity === 1 ? '单' : '多' }}
</div> </div>
<Icon name="caozuorizhi" style="width: 28px; height: 28px"> <Icon
name="caozuorizhi"
style="width: 28px; height: 28px"
@click.stop="openLogDialog(item)"
>
<template #title> <template #title>
<title>操作日志</title> <title>操作日志</title>
</template> </template>
...@@ -211,16 +215,27 @@ ...@@ -211,16 +215,27 @@
@current-change="onCurrentPageChange" @current-change="onCurrentPageChange"
/> />
</div> </div>
<el-dialog
v-model="logVisible"
title="操作日志"
width="1000px"
:close-on-click-modal="false"
>
<LogList :log-list="logList" />
<div v-if="!logList.length" class="empty-content">暂无数据</div>
</el-dialog>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { getCardLayoutListApi } from '@/api/factoryOrderNew' import { getCardLayoutListApi, getFactoryOrderNewLogApi } from '@/api/factoryOrderNew'
import type { PaginationData } from '@/types/api' import type { PaginationData } from '@/types/api'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
import { operateOrderListData } from '@/types/api/factoryOrderNew' import { operateOrderListData } from '@/types/api/factoryOrderNew'
import type { LogListData } from '@/types/api/order'
import LogList from '@/components/LogList.vue'
import platformJson from '../../../../json/platform.json' import platformJson from '../../../../json/platform.json'
const props = defineProps<{ const props = defineProps<{
...@@ -255,6 +270,8 @@ const { ...@@ -255,6 +270,8 @@ const {
}) })
const selectedItems = ref<operateOrderListData[]>([]) const selectedItems = ref<operateOrderListData[]>([])
const logVisible = ref(false)
const logList = ref<LogListData[]>([])
const isSelected = (item: operateOrderListData) => const isSelected = (item: operateOrderListData) =>
selectedItems.value.some((s) => s.id === item.id) selectedItems.value.some((s) => s.id === item.id)
...@@ -274,6 +291,17 @@ const copyText = (text: string) => { ...@@ -274,6 +291,17 @@ const copyText = (text: string) => {
ElMessage.success('复制成功') ElMessage.success('复制成功')
} }
const openLogDialog = async (item: operateOrderListData) => {
if (!item.podOrderId) return
try {
const res = await getFactoryOrderNewLogApi(item.podOrderId as number)
logList.value = (res.data || []) as unknown as LogListData[]
logVisible.value = true
} catch (e) {
// ignore
}
}
const clearSelection = () => { const clearSelection = () => {
selectedItems.value = [] selectedItems.value = []
emit('selection-change', []) emit('selection-change', [])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment