fix: 🧩 优化

This commit is contained in:
2025-07-22 14:04:25 +08:00
parent 2975f9692c
commit de3e1f8177
2 changed files with 31 additions and 30 deletions

View File

@@ -96,6 +96,10 @@ export const getCodeListApi = (params: Record<string, any>) => {
export const getUpdateMaterialApi = (params: Record<string, any>) => {
return http.post<ResPage<any>>(`SerialNumber/UpdateMaterial`, params);
};
//2件装转换
export const getTransferSnApi = (params: Record<string, any>) => {
return http.post<any>(`SerialNumber/TransferSn`, params);
};
//产品条码列表下载
export const getSerialNumberDownLoadApi = (params: Record<string, any>) => {
return http.post<ResPage<any>>(`SerialNumber/Export`, params);

View File

@@ -5,34 +5,31 @@
</template>
<script setup lang="ts">
// import { ElMessageBox } from "element-plus";
import { ElMessageBox } from "element-plus";
import { useMsg } from "@/hooks/useMsg";
// import { } from "@/api/modules/global";
import { getTransferSnApi } from "@/api/modules/barCode";
// const $router = useRouter();
// 接口地址映射
// const URLS: Record<string, string> = {
// boxMarkIndex: "BoxMark/delete", //入库任务列表
// subscriptionIndex: "SubscribeNotification/Delete" //订阅列表
// };
const props: any = defineProps<{
selectionList?: any[];
handleChildBtnCallback?: () => void;
ruleForm: any;
}>();
// const emits = defineEmits<{
// (e: "handleChildBtnCallback", result: Record<string, any>): void;
// }>();
const emits = defineEmits<{
(e: "handleChildBtnCallback", result: Record<string, any>): void;
}>();
// 提交事件
const handleBtnClick = () => {
console.log(props.selectionList, "============>");
if (!props.selectionList.length) {
useMsg("warning", `请选择需要转换的数据 `);
return;
}
let isSome = props.selectionList.filter((item: any) => {
return item.useNumber;
});
console.log(isSome, "======isSome======");
if (isSome.length) {
let specifications = isSome[0].specifications;
useMsg("warning", `${specifications}序列码存在已使用, 不支持转两件装 `);
return;
}
@@ -44,23 +41,23 @@ const handleBtnClick = () => {
ids.push(item.id);
}
});
// ElMessageBox.confirm("确定数据转换为两件装, 一旦转换不可回退!", "温馨提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning"
// })
// .then(async () => {
// const result = await commitListApi(URLS[routeName], { ids: ids });
// if (result.status === 200) {
// useMsg("success", "删除成功 ");
// emits("handleChildBtnCallback", {
// type: "Convert"
// });
// } else {
// useMsg("error", result.message);
// }
// })
// .catch(() => {});
ElMessageBox.confirm("确定数据转换为两件装, 一旦转换不可回退!", "温馨提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(async () => {
const result: any = await getTransferSnApi({ ids: ids });
if (result.status === 200) {
useMsg("success", "操作成功 ");
emits("handleChildBtnCallback", {
type: "Convert"
});
} else {
useMsg("error", result.message);
}
})
.catch(() => {});
};
</script>