feat: 修改transact模块处理逻辑
This commit is contained in:
parent
08d2a4fd5d
commit
8a9fd00273
@ -49,6 +49,7 @@ export default defineComponent({
|
||||
const processTypes = ref<ProcessType[]>([]);
|
||||
const txTypes = ref<ProcessType[]>([]);
|
||||
const statusTypes = ref<ProcessType[]>([]);
|
||||
const totalWeight = ref('');
|
||||
const transact = ref({
|
||||
id: null,
|
||||
txtype: '',
|
||||
@ -64,7 +65,6 @@ export default defineComponent({
|
||||
|
||||
const stocks = ref<StockItem[]>([]);
|
||||
const sends = ref<StockItem[]>([]);
|
||||
const totalWeight = ref(''); // 添加总重响应式变量
|
||||
|
||||
const loadDictData = async () => {
|
||||
try {
|
||||
@ -123,8 +123,10 @@ export default defineComponent({
|
||||
transact.value.sendUser = currentUser.login;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
alertService.showHttpError(e);
|
||||
} catch (e: any) {
|
||||
// 确保错误对象具有message属性
|
||||
const error = e?.response?.data?.message ? e : { response: { data: { message: '未知错误' } } };
|
||||
alertService.showHttpError(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
@ -209,7 +211,7 @@ export default defineComponent({
|
||||
|
||||
const onWeight = async (result: string) => {
|
||||
if (result) {
|
||||
//console.log('检测到重量:', result);
|
||||
console.log('检测到重量:', result);
|
||||
totalWeight.value = result; // 更新总重值
|
||||
if (weightActive.value) {
|
||||
weightActive.value = false;
|
||||
@ -279,6 +281,7 @@ export default defineComponent({
|
||||
statusTypes,
|
||||
scannerActive,
|
||||
weightActive,
|
||||
totalWeight,
|
||||
save,
|
||||
handleScan,
|
||||
handleWeight,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user