优化追溯
This commit is contained in:
@@ -12,7 +12,6 @@ export interface WorkOrderResp {
|
|||||||
photoUrl: string
|
photoUrl: string
|
||||||
totalWeight: string
|
totalWeight: string
|
||||||
totalCount: string
|
totalCount: string
|
||||||
workOrderInfos: Array<WorkOrderInfoResp>
|
|
||||||
createUserString: string
|
createUserString: string
|
||||||
updateUserString: string
|
updateUserString: string
|
||||||
}
|
}
|
||||||
@@ -24,6 +23,7 @@ export interface WorkOrderInfoResp {
|
|||||||
weightTime: string
|
weightTime: string
|
||||||
quantity: string
|
quantity: string
|
||||||
weight: string
|
weight: string
|
||||||
|
imgUrl: string
|
||||||
calculatedWeight: string
|
calculatedWeight: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ export function listWorkOrder(query: WorkOrderPageQuery) {
|
|||||||
|
|
||||||
/** @desc 查询工作订单详情 */
|
/** @desc 查询工作订单详情 */
|
||||||
export function getWorkOrder(id: string) {
|
export function getWorkOrder(id: string) {
|
||||||
return http.get<WorkOrderResp>(`${BASE_URL}/${id}`)
|
return http.get<Array<WorkOrderInfoResp>>(`${BASE_URL}/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @desc 删除工作订单 */
|
/** @desc 删除工作订单 */
|
||||||
|
|||||||
@@ -72,6 +72,35 @@
|
|||||||
</template>
|
</template>
|
||||||
</GiTable>
|
</GiTable>
|
||||||
|
|
||||||
|
<!-- 详情弹窗 -->
|
||||||
|
<a-modal
|
||||||
|
v-model:visible="detailModalVisible"
|
||||||
|
title="称重详情"
|
||||||
|
width="800px"
|
||||||
|
:loading="detailLoading"
|
||||||
|
>
|
||||||
|
<GiTable
|
||||||
|
v-if="detailData.length > 0"
|
||||||
|
row-key="id"
|
||||||
|
:data="detailData"
|
||||||
|
:columns="detailColumns"
|
||||||
|
:scroll="{ x: '100%', y: '100%', minWidth: 700 }"
|
||||||
|
>
|
||||||
|
<template #imgUrl="{ record }">
|
||||||
|
<a-image :src="record.imgUrl" width="50" />
|
||||||
|
</template>
|
||||||
|
<template #calculatedWeight="{ record }">
|
||||||
|
{{ record.calculatedWeight + 'g' }}
|
||||||
|
</template>
|
||||||
|
<template #weight="{ record }">
|
||||||
|
{{ record.weight + 'g' }}
|
||||||
|
</template>
|
||||||
|
</GiTable>
|
||||||
|
<div v-else class="no-data">
|
||||||
|
<icon-loading style="font-size: 48px; color: rgb(var(--arcoblue-6));" />
|
||||||
|
<p>暂无称重数据</p>
|
||||||
|
</div>
|
||||||
|
</a-modal>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -82,11 +111,11 @@ import { useDownload, useTable } from '@/hooks'
|
|||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
import has from '@/utils/has'
|
import has from '@/utils/has'
|
||||||
import type GiTable from "@/components/GiTable/index.vue";
|
import type GiTable from "@/components/GiTable/index.vue";
|
||||||
import {ref} from "vue";
|
import {ref, reactive} from "vue";
|
||||||
import {Message} from "@arco-design/web-vue";
|
import {Message} from "@arco-design/web-vue";
|
||||||
import {
|
import {
|
||||||
deleteWorkOrder,
|
deleteWorkOrder,
|
||||||
exportWorkOrder,
|
exportWorkOrder, getWorkOrder,
|
||||||
listWorkOrder,
|
listWorkOrder,
|
||||||
type WorkOrderQuery,
|
type WorkOrderQuery,
|
||||||
type WorkOrderResp
|
type WorkOrderResp
|
||||||
@@ -164,10 +193,36 @@ const reset = () => {
|
|||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情弹窗状态
|
||||||
const onDetail = (record: WorkOrderResp) => {
|
const detailModalVisible = ref(false)
|
||||||
|
const detailLoading = ref(false)
|
||||||
|
const detailData = ref<any[]>([])
|
||||||
|
|
||||||
}
|
// 详情列配置
|
||||||
|
const detailColumns = ref<TableInstanceColumns[]>([
|
||||||
|
{ title: '称重次数', dataIndex: 'weightTime' },
|
||||||
|
{ title: '物料名称', dataIndex: 'materialName' },
|
||||||
|
{ title: '数量', dataIndex: 'quantity' },
|
||||||
|
{ title: '重量', dataIndex: 'weight', slotName: 'weight' },
|
||||||
|
{ title: '计算重量', dataIndex: 'calculatedWeight', slotName: 'calculatedWeight' },
|
||||||
|
{ title: '抓拍图片', dataIndex: 'imgUrl', slotName: 'imgUrl' }
|
||||||
|
])
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
const onDetail = async (record: WorkOrderResp) => {
|
||||||
|
detailLoading.value = true
|
||||||
|
detailModalVisible.value = true
|
||||||
|
detailData.value = []
|
||||||
|
|
||||||
|
getWorkOrder(record.id).then(res => {
|
||||||
|
if (res.code == '0') {
|
||||||
|
detailData.value = res.data;
|
||||||
|
detailLoading.value = false
|
||||||
|
} else {
|
||||||
|
Message.error('获取详情失败')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const onDeleteOne = (id) => {
|
const onDeleteOne = (id) => {
|
||||||
@@ -195,4 +250,18 @@ const onExport = () => {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss">
|
||||||
|
.no-data {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 40px 0;
|
||||||
|
color: var(--color-text-4);
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 16px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user