feat: 🚀 入库单添加弹窗

This commit is contained in:
2025-10-14 16:30:16 +08:00
parent c18746fcf5
commit 54522f7ca2
6 changed files with 57 additions and 13 deletions

View File

@@ -2,6 +2,9 @@ import http from "@/api";
//订阅入庫單列表 /admapi/subscribe /admapi/subscribe/wrr
export const getSubscribeWrrListApi = (params: any) => {
if (params?.notif_ret_status === "空") {
params.notif_ret_status = 0;
}
return http.get<any>(`subscribe/wrr`, params);
};
//订阅入库单刷新

View File

@@ -6,6 +6,7 @@
export {}
declare global {
const EffectScope: typeof import("vue")["EffectScope"];
const ElMessage: typeof import("element-plus/es")["ElMessage"];
const ElMessageBox: typeof import("element-plus/es")["ElMessageBox"];
const computed: typeof import("vue")["computed"];
const createApp: typeof import("vue")["createApp"];

View File

@@ -65,12 +65,12 @@ export const useTable = (
}
};
//其他數據處理
const initData = () => {
if (state.totalParam?.warehouse_number) {
state.totalParam.warehouse_number = state.totalParam?.warehouse_number.split("_")[0];
}
};
// //其他數據處理
// const initData = () => {
// if (state.totalParam?.warehouse_number) {
// state.totalParam.warehouse_number = state.totalParam?.warehouse_number.split("_")[0];
// }
// };
//删除临时参数和空值参数
const deleteParams = () => {
const KEY = ["Time", "customer_number1", "customer_numbers"];
@@ -90,7 +90,7 @@ export const useTable = (
try {
await initSubscribeData();
await deleteParams();
await initData();
// await initData();
let params = {
...state.totalParam,
...pageParam.value

View File

@@ -45,6 +45,10 @@ export const FORM_DATA: FormItem[] = [
value: 1,
label: "成功"
},
{
value: "空",
label: "空"
},
{
value: -1,
label: "失败"
@@ -65,11 +69,11 @@ export const FORM_DATA: FormItem[] = [
options: []
},
{
prop: "warehouse_number",
placeholder: "请选择仓库",
type: "select",
label: "仓库: ",
options: []
prop: "warehouse_name",
placeholder: "请输入仓库",
type: "input",
label: "仓库: "
// options: []
},
{
prop: "sub_warehouse_name",

View File

@@ -23,6 +23,23 @@
:formData="dataStore.formData"
/>
</template>
<template #notif_ret_text="scope">
<div
v-if="scope.row.notif_ret_text === '成功'"
style="color: #4178d5; cursor: pointer"
@click="handleClickSuccess(scope.row)"
>
{{ scope.row.notif_ret_text }}
</div>
<div
v-else-if="scope.row.notif_ret_text === '失败'"
style="color: red; cursor: pointer"
@click="handleClickError(scope.row)"
>
{{ scope.row.notif_ret_text }}
</div>
<div v-else-if="!scope.row.notif_ret_text">--</div>
</template>
</ProTable>
</div>
</template>
@@ -96,6 +113,25 @@ const handleReset = () => {
proTable.value!.getTableList();
});
};
const handleClickSuccess = (row: any) => {
Array.isArray;
ElMessageBox.alert(
`<div style='font-size:16px'>${
Array.isArray(row?.notif_user_names) && row?.notif_user_names.length ? row?.notif_user_names.join(",") : ""
}</div>`,
"接收人",
{
dangerouslyUseHTMLString: true,
showConfirmButton: false
}
);
};
const handleClickError = (row: any) => {
ElMessageBox.alert(`<div style='font-size:16px'>${row.fail_msg}</div>`, "失败原因", {
dangerouslyUseHTMLString: true,
showConfirmButton: false
});
};
</script>
<style scope lang="scss">

View File

@@ -39,7 +39,7 @@ const getWarehousesList = async () => {
data.forEach((item: any) => {
options.push({
id: item.id,
value: item.warehouse_number + "_" + item.id,
value: item.warehouse_name,
label: item.warehouse_name
});
});