Browse Source

更新版本

master
zhaoxinyu 5 months ago
parent
commit
1b7bbc5005
  1. 13
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 309
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance-part-count.js
  3. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  4. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance-part-count.js
  5. 42
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

13
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -554,13 +554,16 @@ export default {
const method = config.edit.exportMethod; const method = config.edit.exportMethod;
const postData = buildQuery(); const postData = buildQuery();
postData.filters.push({ Object.keys(rows).forEach((o) => {
logic: "and", postData.filters.push({
column: "billNum", logic: "or",
action: "equal", column: "billNum",
value: rows[0].billNum, action: "equal",
value: rows[o].billNum,
});
}); });
await onClick(async () => { await onClick(async () => {
const response = await request(url, postData, { method }); const response = await request(url, postData, { method });
if (!response.errors) { if (!response.errors) {

309
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance-part-count.js

@ -0,0 +1,309 @@
import balanSchema from "./vmi.js";
import { dayjs } from "element-plus";
function balanceSchema() {
return {
title: "寄售库存",
type: "object",
properties: {
lu: {
title: "客户零件号",
type: "string",
rules: [
{
required: true,
},
],
},
partCode: {
title: "厂内零件号",
type: "string",
rules: [
{
required: true,
},
],
},
businessType: {
title: "业务类型",
type: "string",
rules: [
{
required: true,
},
],
},
BSEQty: {
title: "期初发货数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
BRETQty: {
title: "期初退货数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
SEQTY : {
title: "实际发货数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
RETQty: {
title: "实际退货数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
CANQty: {
title: "可结数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
NOTQty: {
title: "不可结数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
SE_SA_CAN_QTY: {
title: "有发有结有价格数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
SE_SA_NOT_QTY: {
title: "有发有结无价格数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
ONLY_SE_QTY: {
title: "有发运无结算数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
ONLY_SA_QTY: {
title: "有结算无发运数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
INVQty: {
title: "已开票数量",
type: "string",
input: "number",
rules: [
{
required: true,
},
],
},
sebegin: {
title: "发运开始",
type: "datetime",
},
seend: {
title: "发运结束",
type: "datetime",
},
sabegin: {
title: "结算开始",
type: "datetime",
},
saend: {
title: "结算结束",
type: "datetime",
},
},
};
}
const schema = balanceSchema();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/get-receive-ship-sum`;
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}/get-receive-ship-sum-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: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "sebegin",
action: "biggerThanOrEqual",
value: null,
readOnly: true,
title: "发运开始",
clearable: false,
},
{
logic: "and",
column: "seend",
action: "smallThan",
value: null,
readOnly: true,
title: "发运结束",
clearable: false,
},
{
logic: "and",
column: "sabegin",
action: "biggerThanOrEqual",
value: null,
readOnly: true,
title: "结算开始",
clearable: false,
},
{
logic: "and",
column: "saend",
action: "smallThan",
value: null,
readOnly: true,
title: "结算结束",
clearable: false,
},
],
},
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

@ -473,6 +473,10 @@ export default [
...createPage("balance-month", "title=库存按月汇总查询"), ...createPage("balance-month", "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-part-count", "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-part-count.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-part-count";
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 };
},
};

42
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -1728,20 +1728,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<string> GetReceiveShipSum(string sebegin, string seend, string sabegin, string saend,string partcode) public async Task<string> GetReceiveShipSum(RequestDto input)
{ {
ConcurrentBag<REC_SHIP_SUM> bagList = new ConcurrentBag<REC_SHIP_SUM>(); ConcurrentBag<REC_SHIP_SUM> bagList = new ConcurrentBag<REC_SHIP_SUM>();
List<EnumBusinessType> list = new List<EnumBusinessType>(); // ConcurrentBag<ShipReceiveSum> bagList = new ConcurrentBag<ShipReceiveSum>();
list.Add(EnumBusinessType.JisBBAC);
list.Add(EnumBusinessType.JisHBPO);
list.Add(EnumBusinessType.MaiDanJianHBPO);
list.Add(EnumBusinessType.MaiDanJianBBAC);
list.Add(EnumBusinessType.BeiJian);
list.Add(EnumBusinessType.ZhiGongJianHBPO);
list.Add(EnumBusinessType.ZhiGongJianBBAC);
list.Add(EnumBusinessType.YinDuJian);
Parallel.ForEach(list, async chunk => Parallel.ForEach(list, async chunk =>
{ {
@ -1753,21 +1745,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}); });
var entities=bagList.ToList(); var entities=bagList.ToList();
IExporter _csv = new CsvExporter(); // IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter(); // IExporter _excel = new ExcelExporter();
byte[] result = null; // byte[] result = null;
result = await _excel.ExportAsByteArray(entities).ConfigureAwait(false); // result = await _excel.ExportAsByteArray(entities).ConfigureAwait(false);
result.ShouldNotBeNull(); // result.ShouldNotBeNull();
string _fileName = $"收发存汇总{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"; // string _fileName = $"收发存汇总{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx";
//保存导出文件到服务器存成二进制 // //保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync( // await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto // new SaveExcelImportInputDto
{ // {
Name = _fileName, // Name = _fileName,
Content = result // Content = result
} // }
).ConfigureAwait(false); // ).ConfigureAwait(false);
return _fileName; // return _fileName;
} }

Loading…
Cancel
Save