Browse Source

12个月库存

master
zhouhongjun 11 months ago
parent
commit
0a5f7683ea
  1. 452
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance-month.js
  2. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  3. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance-month.js

452
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance-month.js

@ -0,0 +1,452 @@
import balanSchema from "./vmi.js";
function balanceSchema() {
return {
title: "寄售库存",
type: "object",
properties: {
year: {
title: "年",
type: "string",
rules: [
{
required: true,
},
],
},
realPartCode: {
title: "厂内零件号",
type: "string",
rules: [
{
required: true,
},
],
},
erpToLoc: {
title: "ERP库位",
type: "string",
rules: [
{
required: true,
},
],
},
historyQty: {
title: "历史库存数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
balanceQty: {
title: "当年库存数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
inventQty: {
title: "库存余额数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleQty: {
title: "有结无发合计",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
january: {
title: "1月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleJanuary: {
title: "1月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
february: {
title: "2月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleFebruary: {
title: "2月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
march: {
title: "3月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleMarch: {
title: "3月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
april: {
title: "4月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleApril: {
title: "4月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
may: {
title: "5月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleMay: {
title: "5月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
june: {
title: "6月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleJune: {
title: "6月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
july: {
title: "7月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleJuly: {
title: "7月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
august: {
title: "8月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleAugust: {
title: "8月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
september: {
title: "9月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleSeptember: {
title: "9月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
october: {
title: "10月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleOctober: {
title: "10月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
november: {
title: "11月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleNovember: {
title: "11月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
december: {
title: "12月",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
settleDecember: {
title: "12月有结无发",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
// reMark: {
// title: "备注",
// type: "string",
// input: "textarea",
// },
},
};
}
const schema = balanceSchema();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/balance-sum-by-version`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`;
const exportUrl = `${baseUrl}/balance-sum-by-version-export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "寄售库存",
type: "object",
properties: {
filters: {
title: "项目",
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
column: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "realPartCode",
action: "like",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js

@ -446,6 +446,10 @@ export default [
...createPage("balance", "title=库存余额查询"), ...createPage("balance", "title=库存余额查询"),
children: [createButton("query", "title=查询&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged")], children: [createButton("query", "title=查询&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged")],
}, },
{
...createPage("balance-month", "title=库存按月汇总查询"),
children: [createButton("query", "title=查询&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged")],
},
// { // {
// ...createPage("balance-sum", "title=库存余额报表查询"), // ...createPage("balance-sum", "title=库存余额报表查询"),
// children: // children:

44
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance-month.js

@ -0,0 +1,44 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { ref, onMounted, onUnmounted } from "vue";
import { useRoute } from "vue-router";
import { ElNotification } from "element-plus";
import request from "../../request/index.js";
export default {
components: { AppList },
template: html`<app-list v-if="config" :config="config" @command="onCommand" />`,
setup() {
const config = ref(null);
const route = useRoute();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
const showMessage = async (data) => {
await ElNotification.closeAll();
ElNotification({
position: "bottom-right",
title: "提示",
message: `待同步库存数量: ${data}`,
duration: 0,
});
};
const event = "VmiBalance";
onMounted(async () => {
const model = "vmi/balance-month";
const useConfig = (await import(`../../models/${model}.js`)).default;
config.value = useConfig(route.meta?.businessType, route.meta);
const result = await request("settleaccount/vmi-async-message/get-message-count", null, { method: "POST" });
if (!result.errors) {
//showMessage(result.data);
}
PubSub.subscribe(event, async (_, data) => {
if (route.path === "/vmi/balance") {
//showMessage(data);
}
});
});
onUnmounted(() => PubSub.unsubscribe(event));
return { config, onCommand };
},
};
Loading…
Cancel
Save