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