feat(api): 🚀 入库单列表
This commit is contained in:
10
src/api/modules/warehousing.ts
Normal file
10
src/api/modules/warehousing.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import http from "@/api";
|
||||||
|
|
||||||
|
//订阅入庫單列表 /admapi/subscribe /admapi/subscribe/wrr
|
||||||
|
export const getSubscribeWrrListApi = (params: any) => {
|
||||||
|
return http.get<any>(`subscribe/wrr`, params);
|
||||||
|
};
|
||||||
|
//订阅入库单刷新
|
||||||
|
export const getSubscribeResetListApi = (params: any) => {
|
||||||
|
return http.get<any>(`subscribe/wrr/reload`, params);
|
||||||
|
};
|
||||||
@@ -135,7 +135,7 @@ const props = withDefaults(defineProps<ProTableProps>(), {
|
|||||||
toolButton: true,
|
toolButton: true,
|
||||||
// rowKey: `id${index}`,
|
// rowKey: `id${index}`,
|
||||||
// searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
// searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
||||||
sizes: [1, 2, 3, 4]
|
sizes: [50, 100, 150, 200]
|
||||||
});
|
});
|
||||||
|
|
||||||
// 是否显示搜索模块
|
// 是否显示搜索模块
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export const useTable = (
|
|||||||
console.log("分页参数更新:", newVal);
|
console.log("分页参数更新:", newVal);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//订阅列表数据处理
|
//订阅列表数据处理
|
||||||
const initSubscribeData = () => {
|
const initSubscribeData = () => {
|
||||||
if (routeName === "foundationSubscribeList") {
|
if (routeName === "foundationSubscribeList") {
|
||||||
@@ -53,6 +54,15 @@ export const useTable = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (routeName === "foundationSubscribeWarehousing") {
|
||||||
|
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
||||||
|
state.totalParam.org_number = state.totalParam.org_number.join(",");
|
||||||
|
}
|
||||||
|
if (state.totalParam?.subscriber_name) {
|
||||||
|
// let names: any = "";
|
||||||
|
state.totalParam.subscriber_name = state.totalParam?.subscriber_name.replace(/[,,]/g, ",");
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
//删除临时参数和空值参数
|
//删除临时参数和空值参数
|
||||||
const deleteParams = () => {
|
const deleteParams = () => {
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ export const BUTTON = [
|
|||||||
{
|
{
|
||||||
text: "刷新",
|
text: "刷新",
|
||||||
permission: "foundationSubscribeWarehousingBtnRefresh",
|
permission: "foundationSubscribeWarehousingBtnRefresh",
|
||||||
type: "del"
|
type: "reset"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -17,33 +17,42 @@ interface FormItem {
|
|||||||
}
|
}
|
||||||
export const FORM_DATA: FormItem[] = [
|
export const FORM_DATA: FormItem[] = [
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "bill_no",
|
||||||
placeholder: "请输入单据编号",
|
placeholder: "请输入单据编号",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "单据编号: "
|
label: "单据编号: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "src_bill_no",
|
||||||
placeholder: "请输入来源单号",
|
placeholder: "请输入来源单号",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "来源单号: "
|
label: "来源单号: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "order_no",
|
||||||
placeholder: "请输入订单单号",
|
placeholder: "请输入订单单号",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "订单单号: "
|
label: "订单单号: "
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "notif_ret_status",
|
||||||
placeholder: "请选择推送结果",
|
placeholder: "请选择推送结果",
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "推送结果: ",
|
label: "推送结果: ",
|
||||||
options: []
|
options: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: "成功"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
value: -1,
|
||||||
|
label: "失败"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "material",
|
||||||
placeholder: "请输入物料名称/编码/规格型号",
|
placeholder: "请输入物料名称/编码/规格型号",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "物料编码: "
|
label: "物料编码: "
|
||||||
@@ -56,14 +65,14 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "warehouse_number",
|
||||||
placeholder: "请选择仓库",
|
placeholder: "请选择仓库",
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "仓库: ",
|
label: "仓库: ",
|
||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "sub_warehouse",
|
||||||
placeholder: "请输入子仓库",
|
placeholder: "请输入子仓库",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "子仓库: "
|
label: "子仓库: "
|
||||||
@@ -75,12 +84,12 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
options: [],
|
options: [],
|
||||||
startPlaceholder: "入库开始日期",
|
startPlaceholder: "入库开始日期",
|
||||||
endPlaceholder: "入库结束日期",
|
endPlaceholder: "入库结束日期",
|
||||||
startDate: "createBeginDate",
|
startDate: "storage_time",
|
||||||
endDate: "createEndDate",
|
// endDate: "createEndDate",
|
||||||
label: "入库日期: "
|
label: "入库日期: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "lotNumbers",
|
prop: "subscriber_name",
|
||||||
placeholder: "请输入订阅人",
|
placeholder: "请输入订阅人",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "订阅人: "
|
label: "订阅人: "
|
||||||
@@ -90,5 +99,6 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
export const RULE_FORM = {
|
export const RULE_FORM = {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 50,
|
size: 50,
|
||||||
org_number: ["101"]
|
org_number: ["101"],
|
||||||
|
subscriber_name: ""
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,92 +4,110 @@ export const COLUMNS = [
|
|||||||
align: "left",
|
align: "left",
|
||||||
fixed: true,
|
fixed: true,
|
||||||
label: "单据编码",
|
label: "单据编码",
|
||||||
prop: "securityNumber"
|
prop: "bill_no",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "来源单号",
|
label: "来源单号",
|
||||||
prop: "id"
|
prop: "src_bill_no",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "订单单号",
|
label: "订单单号",
|
||||||
prop: "specifications"
|
prop: "order_no",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "客户名称",
|
label: "客户名称",
|
||||||
prop: "createTime"
|
prop: "customer_name",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "入库组织",
|
label: "入库组织",
|
||||||
prop: "downLoadNumber"
|
prop: "warehousing_org_name",
|
||||||
|
width: 200
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "单据类型",
|
label: "单据类型",
|
||||||
prop: "downLoadTime"
|
prop: "bill_type_name",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "规格型号",
|
label: "规格型号",
|
||||||
prop: "downLoadTime"
|
prop: "specification",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "物料编码",
|
label: "物料编码",
|
||||||
prop: "downLoadTime"
|
prop: "material_number",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "物料名称",
|
label: "物料名称",
|
||||||
prop: "downLoadTime"
|
prop: "material_name",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "出厂价",
|
label: "出厂价",
|
||||||
prop: "downLoadTime"
|
prop: "factory_price",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "入库仓库",
|
label: "入库仓库",
|
||||||
prop: "downLoadTime"
|
prop: "warehouse_name",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "入库子仓库",
|
label: "入库子仓库",
|
||||||
prop: "downLoadTime"
|
prop: "sub_warehouse_name",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "入库数量",
|
label: "入库数量",
|
||||||
prop: "downLoadTime"
|
prop: "real_qty",
|
||||||
|
width: 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "订单明细备注",
|
label: "订单明细备注",
|
||||||
prop: "downLoadTime"
|
prop: "remark",
|
||||||
|
width: 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "单位",
|
label: "单位",
|
||||||
prop: "downLoadTime"
|
prop: "unit_name",
|
||||||
|
width: 120
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "入库时间",
|
label: "入库时间",
|
||||||
prop: "downLoadTime"
|
prop: "storage_time",
|
||||||
|
width: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
prop: "downLoadTime"
|
prop: "created_at",
|
||||||
|
width: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "推送结果",
|
label: "推送结果",
|
||||||
prop: "downLoadTime"
|
prop: "notif_ret_text",
|
||||||
|
width: 120
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- 质检单 -->
|
<!-- 入库单 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
<div style="padding-bottom: 16px">
|
<div style="padding-bottom: 16px">
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<ProTable
|
<ProTable
|
||||||
ref="proTable"
|
ref="proTable"
|
||||||
:columns="dataStore.columns"
|
:columns="dataStore.columns"
|
||||||
:request-api="getMaterialListApi"
|
:request-api="getSubscribeWrrListApi"
|
||||||
:init-param="dataStore.initParam"
|
:init-param="dataStore.initParam"
|
||||||
@selectionChange="selectionChange"
|
@selectionChange="selectionChange"
|
||||||
>
|
>
|
||||||
@@ -32,7 +32,7 @@ import ProTable from "@/components/ProTable/index.vue";
|
|||||||
|
|
||||||
// import { useMsg } from "@/hooks/useMsg";
|
// import { useMsg } from "@/hooks/useMsg";
|
||||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
|
import { getSubscribeWrrListApi } from "@/api/modules/warehousing";
|
||||||
import SearchForm from "@/components/SearchForm/index.vue";
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||||
//表格TS
|
//表格TS
|
||||||
@@ -59,6 +59,10 @@ const dataStore = reactive<any>({
|
|||||||
});
|
});
|
||||||
//设置组织数组
|
//设置组织数组
|
||||||
dataStore.formData[5].options = userStore.orgIdArr;
|
dataStore.formData[5].options = userStore.orgIdArr;
|
||||||
|
|
||||||
|
//订阅人
|
||||||
|
dataStore.initParam.subscriber_name = userStore.userInfo.nickname;
|
||||||
|
|
||||||
// 表格选择事件
|
// 表格选择事件
|
||||||
const selectionChange = (selection: any) => {
|
const selectionChange = (selection: any) => {
|
||||||
dataStore.selectionList = selection;
|
dataStore.selectionList = selection;
|
||||||
@@ -67,8 +71,22 @@ const handleButtonClickCallback = (item: any) => {
|
|||||||
const { type } = item;
|
const { type } = item;
|
||||||
btnClick[type](item, dataStore.selectionList, proTable);
|
btnClick[type](item, dataStore.selectionList, proTable);
|
||||||
};
|
};
|
||||||
const handleSearch = () => {};
|
//搜索
|
||||||
const handleReset = () => {};
|
const handleSearch = async (params: any) => {
|
||||||
|
dataStore.initParam = cloneDeep(params);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
proTable.value!.getTableList();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//重置
|
||||||
|
const handleReset = () => {
|
||||||
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
proTable.value!.getTableList();
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scope lang="scss">
|
<style scope lang="scss">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useMsg } from "@/hooks/useMsg";
|
import { useMsg } from "@/hooks/useMsg";
|
||||||
|
import { getSubscribeResetListApi } from "@/api/modules/warehousing";
|
||||||
// 直接导出函数,无需额外包装对象
|
// 直接导出函数,无需额外包装对象
|
||||||
export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||||
console.log("导出操作", item);
|
console.log("导出操作", item);
|
||||||
@@ -25,16 +26,25 @@ export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
// proTable: any
|
// proTable: any
|
||||||
export const handleAdd = (item: any, selectionList: any[]) => {
|
export const handleReSet = async (item: any, selectionList: any[], proTable: any) => {
|
||||||
console.log("刷新操作", item);
|
console.log("刷新操作", item);
|
||||||
let length = selectionList.length;
|
let length = selectionList.length;
|
||||||
if (length && length > 100) {
|
if (length && length > 100) {
|
||||||
useMsg("warning", "选中刷新数据最大100条!");
|
useMsg("warning", "选中刷新数据最大100条!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let ids: any = [];
|
||||||
|
selectionList.forEach((item: any) => {
|
||||||
|
ids.push(item.id);
|
||||||
|
});
|
||||||
|
const result = await getSubscribeResetListApi(ids);
|
||||||
|
if (result?.code === 0) {
|
||||||
|
useMsg("success", "数据刷新成功 !");
|
||||||
|
proTable.value!.getTableList();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const btnClick: any = {
|
export const btnClick: any = {
|
||||||
del: handleDel,
|
del: handleDel,
|
||||||
add: handleAdd
|
reset: handleReSet
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user