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