This commit is contained in:
zc
2026-03-18 09:50:13 +08:00
parent 2dc2d4887d
commit 0320c8d8bc
5 changed files with 310 additions and 21 deletions

View File

@@ -193,9 +193,6 @@
<div class="weighing-section">
<div class="section-header">
<h4>称重列表</h4>
<div class="table-actions">
<a-button>打印</a-button>
</div>
</div>
<a-table :columns="columns" :data="weighingList" bordered>
<template #action="{ record }">
@@ -244,6 +241,7 @@
</div>
</div>
<div class="completion-actions">
<a-button type="primary" @click="onPrint">打印</a-button>
<a-button type="primary" @click="handleBackToFirst">返回首页</a-button>
</div>
</div>
@@ -274,9 +272,10 @@
<script setup lang="ts">
import { nextTick, onBeforeUnmount, onMounted, onUnmounted, reactive, ref } from 'vue'
import { Message, Modal, Notification } from '@arco-design/web-vue'
import {getImg, getMaterialDetail, validateWeighing, vmSend} from '@/apis/weightManage/weightManage'
import {type WorkOrderResp, addWorkOrder, getWorkOrder} from '@/apis/workOrder/workOrder'
import { getMaterialDetail, validateWeighing, vmSend } from '@/apis/weightManage/weightManage'
import {type WorkOrderResp, addWorkOrder} from '@/apis/workOrder/workOrder'
import { catchPhoto } from '@/apis/material/materialInfo'
import router from "@/router";
defineOptions({ name: 'WeightManage' })
@@ -752,6 +751,7 @@ const handleNext = async () => {
title: '操作成功',
content: `工单创建成功!`,
})
workOrderResp.value.id = res.data?.id || ''
workOrderResp.value.matchResult = 'success'
workOrderResp.value.title = res.data?.title || ''
workOrderResp.value.orderNo = res.data?.orderNo || ''
@@ -822,6 +822,17 @@ const handlePrevious = () => {
}
}
// 打印
const onPrint = () => {
// 跳转到标签打印页面,并传递数据
router.push({
path: '/print',
query: {
workerOrderId: workOrderResp.value.id,
}
})
}
// 返回第一步
const handleBackToFirst = () => {
// 重置所有数据
@@ -869,7 +880,7 @@ const calculateWeight = () => {
//处理确定
const handleConfirm = () => {
const handleConfirm = async () => {
// 校验输入数量是否为空
if (!inputQuantity.value || inputQuantity.value.trim() === '') {
Message.error('请输入数量')
@@ -881,16 +892,16 @@ const handleConfirm = () => {
}
const data = {
materialId: formData.id,
calculatedWeight: calculatedWeight.value,
inputQuantity: inputQuantity.value,
ahDeviceWeight: ahDeviceWeight.value,
}
validateWeighing(data).then(res => {
if (res.code != '0') {
Message.error(res.msg || '系统异常!')
}
});
const res = await validateWeighing(data);
if (res.code != '0') {
Message.error(res.msg || '系统异常!');
return;
}
// 立即创建一个新项的基本数据
const newItem = {
@@ -1324,6 +1335,9 @@ onUnmounted(() => {
.completion-actions {
margin-top: 40px;
display: flex;
gap: 16px;
justify-content: center;
}
/* 图片占位符 */