Compare commits
3 Commits
e259886cbc
...
7b4e4f81d2
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b4e4f81d2 | |||
| 629232a243 | |||
| b9c5ded6ec |
@@ -8,3 +8,7 @@ import http from "@/api";
|
||||
export const getMaterialListApi = (params: any) => {
|
||||
return http.get<any>(`material`, params);
|
||||
};
|
||||
//刷新 /admapi/material/reload
|
||||
export const getMaterialListReloadApi = (params: any) => {
|
||||
return http.get<any>(`material/reload`, params);
|
||||
};
|
||||
|
||||
@@ -24,3 +24,8 @@ export const getUsersApi = (params: any) => {
|
||||
export const getProductLinesApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/productlines`, params);
|
||||
};
|
||||
|
||||
//仓库
|
||||
export const getWarehousesListApi = () => {
|
||||
return http.get<any>(`basicinfo/warehouses`);
|
||||
};
|
||||
|
||||
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,
|
||||
// rowKey: `id${index}`,
|
||||
// searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
||||
sizes: [1, 2, 3, 4]
|
||||
sizes: [50, 100, 150, 200]
|
||||
});
|
||||
|
||||
// 是否显示搜索模块
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { cloneDeep } from "lodash-es";
|
||||
|
||||
export const useFilter = (datas: any) => {
|
||||
const target = cloneDeep(datas);
|
||||
const returnTarget = target.filter((item: any) => {
|
||||
return !item.disable;
|
||||
});
|
||||
return returnTarget;
|
||||
};
|
||||
@@ -30,7 +30,8 @@ export const useTable = (
|
||||
console.log("分页参数更新:", newVal);
|
||||
}
|
||||
});
|
||||
//订阅列表数据处理
|
||||
|
||||
//数据处理
|
||||
const initSubscribeData = () => {
|
||||
if (routeName === "foundationSubscribeList") {
|
||||
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ export const BUTTON = [
|
||||
{
|
||||
text: "导出",
|
||||
permission: "foundationSetMaterialBtnExport",
|
||||
type: "add",
|
||||
type: "export",
|
||||
props: {
|
||||
type: "primary"
|
||||
}
|
||||
@@ -10,6 +10,6 @@ export const BUTTON = [
|
||||
{
|
||||
text: "刷新",
|
||||
permission: "foundationSetMaterialBtnRefresh",
|
||||
type: "del"
|
||||
type: "reset"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -4,58 +4,70 @@ export const COLUMNS = [
|
||||
align: "left",
|
||||
fixed: true,
|
||||
label: "物料编码",
|
||||
prop: "material_number"
|
||||
prop: "material_number",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "规格型号(SKU)",
|
||||
prop: "sku"
|
||||
prop: "sku",
|
||||
fixed: true,
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料名称",
|
||||
prop: "material_name"
|
||||
prop: "material_name",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "组织",
|
||||
prop: "org_name"
|
||||
prop: "org_name",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "品线",
|
||||
prop: "product_line"
|
||||
prop: "product_line",
|
||||
width: 200
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "69码",
|
||||
prop: "bar_code"
|
||||
prop: "bar_code",
|
||||
width: 200
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "FNSKU",
|
||||
prop: "fnsku"
|
||||
prop: "fnsku",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "1级分类",
|
||||
prop: "category_lv1"
|
||||
prop: "category_lv1",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "2级分类",
|
||||
prop: "category_lv2"
|
||||
prop: "category_lv2",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "3级分类",
|
||||
prop: "category_lv3"
|
||||
prop: "category_lv3",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "SPU",
|
||||
prop: "spu"
|
||||
prop: "spu",
|
||||
width: 200
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { getMaterialListReloadApi } from "@/api/modules/foundationMaterial";
|
||||
import { useMsg } from "@/hooks/useMsg";
|
||||
//getMaterialListResetApi
|
||||
// 直接导出函数,无需额外包装对象
|
||||
export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
export const handleExport = (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("导出操作", item);
|
||||
console.log(selectionList, "=selectionList=");
|
||||
let length = selectionList.length;
|
||||
@@ -24,8 +26,8 @@ export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
// proTable: any
|
||||
export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
// proTable: any getMaterialListReloadApi
|
||||
export const handleReload = async (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("刷新操作", item);
|
||||
let length = selectionList.length;
|
||||
let ids: any = [];
|
||||
@@ -36,9 +38,15 @@ export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
selectionList.forEach((item: any) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
let id = ids.join(",");
|
||||
const result = await getMaterialListReloadApi({ id });
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "数据刷新成功 !");
|
||||
proTable.value!.getTableList();
|
||||
}
|
||||
};
|
||||
|
||||
export const btnClick: any = {
|
||||
del: handleDel,
|
||||
add: handleAdd
|
||||
export: handleExport,
|
||||
reset: handleReload
|
||||
};
|
||||
|
||||
@@ -42,6 +42,7 @@ const dataStore = reactive({
|
||||
});
|
||||
const userStore = useUserStore();
|
||||
const $route = useRoute();
|
||||
|
||||
dataStore.formData[0].options = userStore.orgIdArr;
|
||||
//新增
|
||||
const handleAdd = () => {
|
||||
|
||||
@@ -10,6 +10,6 @@ export const BUTTON = [
|
||||
{
|
||||
text: "刷新",
|
||||
permission: "foundationSubscribeWarehousingBtnRefresh",
|
||||
type: "del"
|
||||
type: "reset"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -17,33 +17,42 @@ interface FormItem {
|
||||
}
|
||||
export const FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "bill_no",
|
||||
placeholder: "请输入单据编号",
|
||||
type: "input",
|
||||
label: "单据编号: "
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "src_bill_no",
|
||||
placeholder: "请输入来源单号",
|
||||
type: "input",
|
||||
label: "来源单号: "
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "order_no",
|
||||
placeholder: "请输入订单单号",
|
||||
type: "input",
|
||||
label: "订单单号: "
|
||||
},
|
||||
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "notif_ret_status",
|
||||
placeholder: "请选择推送结果",
|
||||
type: "select",
|
||||
label: "推送结果: ",
|
||||
options: []
|
||||
options: [
|
||||
{
|
||||
value: 1,
|
||||
label: "成功"
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
value: -1,
|
||||
label: "失败"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: "material",
|
||||
placeholder: "请输入物料名称/编码/规格型号",
|
||||
type: "input",
|
||||
label: "物料编码: "
|
||||
@@ -56,14 +65,14 @@ export const FORM_DATA: FormItem[] = [
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "warehouse_number",
|
||||
placeholder: "请选择仓库",
|
||||
type: "select",
|
||||
label: "仓库: ",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "sub_warehouse_name",
|
||||
placeholder: "请输入子仓库",
|
||||
type: "input",
|
||||
label: "子仓库: "
|
||||
@@ -75,12 +84,12 @@ export const FORM_DATA: FormItem[] = [
|
||||
options: [],
|
||||
startPlaceholder: "入库开始日期",
|
||||
endPlaceholder: "入库结束日期",
|
||||
startDate: "createBeginDate",
|
||||
endDate: "createEndDate",
|
||||
startDate: "storage_time",
|
||||
// endDate: "createEndDate",
|
||||
label: "入库日期: "
|
||||
},
|
||||
{
|
||||
prop: "lotNumbers",
|
||||
prop: "subscriber_name",
|
||||
placeholder: "请输入订阅人",
|
||||
type: "input",
|
||||
label: "订阅人: "
|
||||
@@ -90,5 +99,6 @@ export const FORM_DATA: FormItem[] = [
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 50,
|
||||
org_number: ["101"]
|
||||
org_number: ["101"],
|
||||
subscriber_name: ""
|
||||
};
|
||||
|
||||
@@ -4,92 +4,110 @@ export const COLUMNS = [
|
||||
align: "left",
|
||||
fixed: true,
|
||||
label: "单据编码",
|
||||
prop: "securityNumber"
|
||||
prop: "bill_no",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "来源单号",
|
||||
prop: "id"
|
||||
prop: "src_bill_no",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "订单单号",
|
||||
prop: "specifications"
|
||||
prop: "order_no",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "客户名称",
|
||||
prop: "createTime"
|
||||
prop: "customer_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库组织",
|
||||
prop: "downLoadNumber"
|
||||
prop: "warehousing_org_name",
|
||||
width: 200
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "单据类型",
|
||||
prop: "downLoadTime"
|
||||
prop: "bill_type_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "规格型号",
|
||||
prop: "downLoadTime"
|
||||
prop: "specification",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料编码",
|
||||
prop: "downLoadTime"
|
||||
prop: "material_number",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料名称",
|
||||
prop: "downLoadTime"
|
||||
prop: "material_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "出厂价",
|
||||
prop: "downLoadTime"
|
||||
prop: "factory_price",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库仓库",
|
||||
prop: "downLoadTime"
|
||||
prop: "warehouse_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库子仓库",
|
||||
prop: "downLoadTime"
|
||||
prop: "sub_warehouse_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库数量",
|
||||
prop: "downLoadTime"
|
||||
prop: "real_qty",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "订单明细备注",
|
||||
prop: "downLoadTime"
|
||||
prop: "remark",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "单位",
|
||||
prop: "downLoadTime"
|
||||
prop: "unit_name",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库时间",
|
||||
prop: "downLoadTime"
|
||||
prop: "storage_time",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "创建时间",
|
||||
prop: "downLoadTime"
|
||||
prop: "created_at",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "推送结果",
|
||||
prop: "downLoadTime"
|
||||
prop: "notif_ret_text",
|
||||
width: 120
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 质检单 -->
|
||||
<!-- 入库单 -->
|
||||
<template>
|
||||
<div class="table-box">
|
||||
<div style="padding-bottom: 16px">
|
||||
@@ -11,7 +11,7 @@
|
||||
<ProTable
|
||||
ref="proTable"
|
||||
:columns="dataStore.columns"
|
||||
:request-api="getMaterialListApi"
|
||||
:request-api="getSubscribeWrrListApi"
|
||||
:init-param="dataStore.initParam"
|
||||
@selectionChange="selectionChange"
|
||||
>
|
||||
@@ -32,7 +32,7 @@ import ProTable from "@/components/ProTable/index.vue";
|
||||
|
||||
// import { useMsg } from "@/hooks/useMsg";
|
||||
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 { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||
//表格TS
|
||||
@@ -57,8 +57,16 @@ const dataStore = reactive<any>({
|
||||
selectionList: [], //选中表格的行
|
||||
loading: false
|
||||
});
|
||||
|
||||
const init = () => {
|
||||
//设置组织数组
|
||||
dataStore.formData[5].options = userStore.orgIdArr;
|
||||
//设置仓库数据
|
||||
dataStore.formData[6].options = userStore.warehouse;
|
||||
//订阅人
|
||||
dataStore.initParam.subscriber_name = userStore.userInfo.nickname;
|
||||
};
|
||||
init();
|
||||
// 表格选择事件
|
||||
const selectionChange = (selection: any) => {
|
||||
dataStore.selectionList = selection;
|
||||
@@ -67,8 +75,23 @@ const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
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);
|
||||
init();
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
proTable.value!.getTableList();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useMsg } from "@/hooks/useMsg";
|
||||
import { getSubscribeResetListApi } from "@/api/modules/warehousing";
|
||||
// 直接导出函数,无需额外包装对象
|
||||
export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("导出操作", item);
|
||||
@@ -25,16 +26,27 @@ export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
.catch(() => {});
|
||||
};
|
||||
// proTable: any
|
||||
export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
export const handleReSet = async (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("刷新操作", item);
|
||||
let length = selectionList.length;
|
||||
if (length && length > 100) {
|
||||
useMsg("warning", "选中刷新数据最大100条!");
|
||||
return;
|
||||
}
|
||||
let ids: any = [];
|
||||
selectionList.forEach((item: any) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
|
||||
let id = ids.join(",");
|
||||
const result = await getSubscribeResetListApi({ id });
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "数据刷新成功 !");
|
||||
proTable.value!.getTableList();
|
||||
}
|
||||
};
|
||||
|
||||
export const btnClick: any = {
|
||||
del: handleDel,
|
||||
add: handleAdd
|
||||
reset: handleReSet
|
||||
};
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
|
||||
<script setup lang="ts" name="home">
|
||||
//登录请求接口
|
||||
import { getOrgsApi } from "@/api/modules/global";
|
||||
import { getOrgsApi, getWarehousesListApi } from "@/api/modules/global";
|
||||
|
||||
//用户信息存储
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
//setOrgIdArr
|
||||
const userStore = useUserStore();
|
||||
//获取组织
|
||||
const getOrgs = async () => {
|
||||
@@ -30,16 +30,24 @@ const getOrgs = async () => {
|
||||
}
|
||||
};
|
||||
getOrgs();
|
||||
|
||||
// //获取供应商
|
||||
// const getSupplier = async () => {
|
||||
// const result = await getSupplierApi();
|
||||
// if (result?.code === 0) {
|
||||
// const { data } = result;
|
||||
// console.log(data, "=============>");
|
||||
// }
|
||||
// };
|
||||
// getSupplier();
|
||||
const getWarehousesList = async () => {
|
||||
const result = await getWarehousesListApi();
|
||||
if (result?.code === 0) {
|
||||
const { data } = result;
|
||||
if (data?.length) {
|
||||
let options: any = [];
|
||||
data.forEach((item: any) => {
|
||||
options.push({
|
||||
id: item.id,
|
||||
value: item.warehouse_number,
|
||||
label: item.warehouse_name
|
||||
});
|
||||
});
|
||||
userStore.setWarehouse(options);
|
||||
}
|
||||
}
|
||||
};
|
||||
getWarehousesList();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user