Commit df3ce930 by qinjianhui

feat: 拣胚失败表格字段

parent 54e79062
<template>
<ElDialog
v-model="visible"
title="拣胚失败"
:title="dialogTitle"
width="1400px"
:close-on-click-modal="false"
@close="handleClose"
......@@ -66,7 +66,7 @@
</ElDialog>
</template>
<script setup lang="ts">
<script setup lang="tsx">
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import {
......@@ -75,7 +75,7 @@ import {
} from '@/api/factoryOrderNew'
import type { operateOrderListData } from '@/types/api/factoryOrderNew'
import TableView from '@/components/TableView.vue'
import type { CustomColumn } from '@/types/table'
import _ from 'lodash'
const emit = defineEmits<{
success: []
......@@ -85,8 +85,8 @@ const visible = ref(false)
const submitLoading = ref(false)
const tableData = ref<operateOrderListData[]>([])
const orderIds = ref<(number | string)[]>([])
const columns: CustomColumn<operateOrderListData>[] = [
const dialogTitle = ref('拣胚失败')
const columns = [
{
key: 'warehouseName',
prop: 'warehouseName',
......@@ -151,16 +151,26 @@ const columns: CustomColumn<operateOrderListData>[] = [
minWidth: 120,
align: 'right',
slot: 'suggestOutQuantity',
render: (row: operateOrderListData) => {
return (
<span style="color: #f56c6c; font-weight: bold">
{_.subtract(
Number(row.inventory ?? 0),
Number(row.producingQuantity ?? 0),
)}
</span>
)
},
},
{
prop: 'afterOutStock',
prop: 'producingQuantity',
label: '出库后库存数量',
minWidth: 130,
align: 'center',
slot: 'right',
},
{
prop: 'afterOutOccupied',
prop: 'inventory',
label: '出库后占用数量',
minWidth: 130,
align: 'right',
......@@ -170,12 +180,33 @@ const columns: CustomColumn<operateOrderListData>[] = [
label: '出库后可用库存',
minWidth: 130,
align: 'right',
render: (row: operateOrderListData) => {
return (
<span style="color: #f56c6c; font-weight: bold">
{_.subtract(
_.subtract(
Number(row.producingQuantity ?? 0),
Number(row.inventory ?? 0),
),
Number(row.freezeInventory ?? 0),
)}
</span>
)
},
},
]
const open = async (ids: (number | string)[]) => {
const open = async (
ids: (number | string)[],
options?: { title?: string; submitType?: string },
) => {
dialogTitle.value = options?.title || '拣胚失败'
orderIds.value = ids
visible.value = true
const loading = ElLoading.service({
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await applyForReplenishByIdApi(
ids,
......@@ -184,6 +215,8 @@ const open = async (ids: (number | string)[]) => {
tableData.value = res.data || []
} catch (_e) {
tableData.value = []
} finally {
loading.close()
}
}
......
......@@ -819,7 +819,9 @@
ref="weightDialogRef"
:list-by-no-api="listByNoPodOrderApi"
:order-weighing-api="orderWeighingPodOrderApi"
:build-order-weighing-payload="(rows) => ({ podOrderWeighingParams: rows })"
:build-order-weighing-payload="
(rows) => ({ podOrderWeighingParams: rows })
"
@update-list="() => refreshCurrentView({ isRefreshTree: true })"
/>
<FastProduction
......@@ -1657,7 +1659,10 @@ const handlePickComplete = () => {
}
const handlePickFail = () => {
if (!ensureSelection()) return
pickFailDialogRef.value?.open(getSelectedIds())
pickFailDialogRef.value?.open(getSelectedIds(), {
title: '拣胚失败',
submitType: 'pick',
})
}
const handleApplyReplenish = async () => {
await executeBatchAction({
......@@ -1725,7 +1730,10 @@ const handleReplenishComplete = () => {
}
const handleReplenishFail = () => {
if (!ensureSelection()) return
ElMessage.info('补胚失败功能待集成')
pickFailDialogRef.value?.open(getSelectedIds(), {
title: '补胚失败',
submitType: 'replenish',
})
}
const getOperationByNo = (operationNo: string) =>
getByOperationNoLogApi(operationNo) as Promise<{ data?: unknown }>
......
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