Compare commits
3 Commits
ef38880743
...
f057f07ce7
| Author | SHA1 | Date | |
|---|---|---|---|
| f057f07ce7 | |||
| 54522f7ca2 | |||
| c18746fcf5 |
@@ -6,6 +6,9 @@ import http from "@/api";
|
|||||||
|
|
||||||
//物料分页列表
|
//物料分页列表
|
||||||
export const getMaterialListApi = (params: any) => {
|
export const getMaterialListApi = (params: any) => {
|
||||||
|
if (params.disabled && params.disabled === "启用") {
|
||||||
|
params.disabled = 0;
|
||||||
|
}
|
||||||
return http.get<any>(`material`, params);
|
return http.get<any>(`material`, params);
|
||||||
};
|
};
|
||||||
//刷新 /admapi/material/reload
|
//刷新 /admapi/material/reload
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import http from "@/api";
|
|||||||
|
|
||||||
//订阅入庫單列表 /admapi/subscribe /admapi/subscribe/wrr
|
//订阅入庫單列表 /admapi/subscribe /admapi/subscribe/wrr
|
||||||
export const getSubscribeWrrListApi = (params: any) => {
|
export const getSubscribeWrrListApi = (params: any) => {
|
||||||
|
if (params?.notif_ret_status === "空") {
|
||||||
|
params.notif_ret_status = 0;
|
||||||
|
}
|
||||||
return http.get<any>(`subscribe/wrr`, params);
|
return http.get<any>(`subscribe/wrr`, params);
|
||||||
};
|
};
|
||||||
//订阅入库单刷新
|
//订阅入库单刷新
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const useTable = (
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//数据处理
|
//訂閲数据处理
|
||||||
const initSubscribeData = () => {
|
const initSubscribeData = () => {
|
||||||
if (routeName === "foundationSubscribeList") {
|
if (routeName === "foundationSubscribeList") {
|
||||||
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
||||||
@@ -64,6 +64,13 @@ export const useTable = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// //其他數據處理
|
||||||
|
// const initData = () => {
|
||||||
|
// if (state.totalParam?.warehouse_number) {
|
||||||
|
// state.totalParam.warehouse_number = state.totalParam?.warehouse_number.split("_")[0];
|
||||||
|
// }
|
||||||
|
// };
|
||||||
//删除临时参数和空值参数
|
//删除临时参数和空值参数
|
||||||
const deleteParams = () => {
|
const deleteParams = () => {
|
||||||
const KEY = ["Time", "customer_number1", "customer_numbers"];
|
const KEY = ["Time", "customer_number1", "customer_numbers"];
|
||||||
@@ -81,12 +88,14 @@ export const useTable = (
|
|||||||
if (!api) return;
|
if (!api) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initSubscribeData();
|
await initSubscribeData();
|
||||||
deleteParams();
|
await deleteParams();
|
||||||
|
// await initData();
|
||||||
let params = {
|
let params = {
|
||||||
...state.totalParam,
|
...state.totalParam,
|
||||||
...pageParam.value
|
...pageParam.value
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data } = await api(params);
|
const { data } = await api(params);
|
||||||
state.tableData = data.data || [];
|
state.tableData = data.data || [];
|
||||||
clearSelection && clearSelection();
|
clearSelection && clearSelection();
|
||||||
@@ -136,6 +145,7 @@ export const useTable = (
|
|||||||
state.totalParam = {};
|
state.totalParam = {};
|
||||||
// 同步到查询参数
|
// 同步到查询参数
|
||||||
state.searchParam = { ...newVal };
|
state.searchParam = { ...newVal };
|
||||||
|
console.log(state.searchParam, "= state.searchParam=");
|
||||||
// 同步到参数快照
|
// 同步到参数快照
|
||||||
state.totalParam = { ...newVal, ...pageParam.value };
|
state.totalParam = { ...newVal, ...pageParam.value };
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,6 +34,22 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
placeholder: "请输入品线",
|
placeholder: "请输入品线",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "品线: "
|
label: "品线: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "disabled",
|
||||||
|
placeholder: "请选择",
|
||||||
|
type: "select",
|
||||||
|
label: "物料状态: ",
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: "禁用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "启用",
|
||||||
|
label: "启用"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { RenderScope } from "@/components/ProTable/interface";
|
||||||
export const COLUMNS = [
|
export const COLUMNS = [
|
||||||
{ type: "selection", fixed: "left", width: 40 },
|
{ type: "selection", fixed: "left", width: 40 },
|
||||||
{
|
{
|
||||||
@@ -69,5 +70,24 @@ export const COLUMNS = [
|
|||||||
label: "SPU",
|
label: "SPU",
|
||||||
prop: "spu",
|
prop: "spu",
|
||||||
width: 200
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "物料状态",
|
||||||
|
prop: "disabled",
|
||||||
|
width: 200,
|
||||||
|
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||||
|
const OBJ: any = {
|
||||||
|
0: "启用",
|
||||||
|
1: "禁用"
|
||||||
|
};
|
||||||
|
return OBJ[scope.row.disabled];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新时间",
|
||||||
|
prop: "updated_at",
|
||||||
|
width: 200
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const selectionChange = (selection: any) => {
|
|||||||
};
|
};
|
||||||
const handleButtonClickCallback = (item: any) => {
|
const handleButtonClickCallback = (item: any) => {
|
||||||
const { type } = item;
|
const { type } = item;
|
||||||
// dataStore.selectionList, proTableRef
|
|
||||||
btnClick[type]({
|
btnClick[type]({
|
||||||
selectionList: dataStore.selectionList,
|
selectionList: dataStore.selectionList,
|
||||||
proTableRef,
|
proTableRef,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const handleReload = async (params: any) => {
|
|||||||
const result = await getMaterialListReloadApi({ id });
|
const result = await getMaterialListReloadApi({ id });
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
useMsg("success", "数据刷新成功 !");
|
useMsg("success", "数据刷新成功 !");
|
||||||
proTable.value!.getTableList();
|
proTable?.value!.getTableList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
value: 1,
|
value: 1,
|
||||||
label: "成功"
|
label: "成功"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: "空",
|
||||||
|
label: "空"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: -1,
|
value: -1,
|
||||||
label: "失败"
|
label: "失败"
|
||||||
@@ -65,11 +69,11 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "warehouse_number",
|
prop: "warehouse_name",
|
||||||
placeholder: "请选择仓库",
|
placeholder: "请输入仓库",
|
||||||
type: "select",
|
type: "input",
|
||||||
label: "仓库: ",
|
label: "仓库: "
|
||||||
options: []
|
// options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "sub_warehouse_name",
|
prop: "sub_warehouse_name",
|
||||||
|
|||||||
@@ -23,6 +23,23 @@
|
|||||||
:formData="dataStore.formData"
|
:formData="dataStore.formData"
|
||||||
/>
|
/>
|
||||||
</template>
|
</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>
|
</ProTable>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -96,6 +113,25 @@ const handleReset = () => {
|
|||||||
proTable.value!.getTableList();
|
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>
|
</script>
|
||||||
|
|
||||||
<style scope lang="scss">
|
<style scope lang="scss">
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const getWarehousesList = async () => {
|
|||||||
data.forEach((item: any) => {
|
data.forEach((item: any) => {
|
||||||
options.push({
|
options.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
value: item.warehouse_number,
|
value: item.warehouse_name,
|
||||||
label: item.warehouse_name
|
label: item.warehouse_name
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user