From ecaf0c9ccaf32839c5332748fd01cc8164fae79c Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 15 Sep 2023 11:51:20 +0800 Subject: [PATCH 1/4] up --- .../Entities/Prices/PriceListAppService.cs | 8 ++++---- .../Entities/Prices/PriceListAppServiceBJ.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index f5b8d390..37101f16 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -256,16 +256,16 @@ public class PriceListAppService : SettleAccountApplicationBase entity.IsCancel = input.IsCancel; if (entity.IsCancel == false) { - var existsPriceList = _settleAccountDbContext.Set() + var existPriceList = _settleAccountDbContext.Set() .Where(t => t.LU == entity.LU) .Where(t => t.IsCancel == false) .Where(t => t.Id != entity.Id) .ToList(); - var existsPrice = existsPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime)); - if (existsPrice != null) + var existPrice = existPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime)); + if (existPrice != null) { - throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existsPrice.BeginTime:yyyy-MM-dd}至{existsPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); + throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPrice.BeginTime:yyyy-MM-dd}至{existPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); } } _settleAccountDbContext.Set().Update(entity); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index f4cf5dc8..3e378daf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -214,16 +214,16 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase entity.IsCancel = input.IsCancel; if (entity.IsCancel == false) { - var existsPriceBjList = _settleAccountDbContext.Set() + var existPriceBjList = _settleAccountDbContext.Set() .Where(t => t.LU == entity.LU) .Where(t => t.IsCancel == false) .Where(t => t.Id != entity.Id) .ToList(); - var existsPriceBj = existsPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate)); - if (existsPriceBj != null) + var existPriceBj = existPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate)); + if (existPriceBj != null) { - throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existsPriceBj.BeginDate:yyyy-MM-dd}至{existsPriceBj.EndDate:yyyy-MM-dd}】存在交集", "400"); + throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPriceBj.BeginDate:yyyy-MM-dd}至{existPriceBj.EndDate:yyyy-MM-dd}】存在交集", "400"); } } _settleAccountDbContext.Set().Update(entity); From c0075026c52e44fcd0f08d034922447ba88a33ba Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 15 Sep 2023 11:51:22 +0800 Subject: [PATCH 2/4] update --- .../wwwroot/models/base-data/bei-jian.js | 4 +++ .../wwwroot/models/base-data/xiao-shou.js | 4 +++ .../wwwroot/models/input/jie-suan.js | 7 +++++ .../wwwroot/router/base-data.js | 16 +++++++++-- .../wwwroot/views/base-data/bei-jian.js | 28 +++++++++++++++++-- .../wwwroot/views/base-data/xiao-shou.js | 27 ++++++++++++++++-- 6 files changed, 80 insertions(+), 6 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js index 1dbaf4c1..6dbb4b13 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js @@ -34,6 +34,10 @@ const schema = { title: "合同号", type: "string", }, + isCancel: { + type: "boolean", + title: "是否已停用", + }, }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js index 3cc2d226..2a0d5f7b 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js @@ -33,6 +33,10 @@ const schema = { title: "合同号", type: "string", }, + isCancel: { + type: "boolean", + title: "是否已停用", + }, }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js index ed1229f6..341acd5e 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js @@ -38,6 +38,13 @@ export default function (type, meta) { }, }; + if (type.indexOf("HBPO") > -1) { + schema.properties.place = { + type: "string", + title: "地点", + }; + } + const querySchema = { title: "结算数据", type: "object", diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js index 4d273df5..bf9e4680 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js @@ -56,7 +56,13 @@ export default [ // }, { ...createPage("bei-jian", "title=备件价格单"), - children: [createButton("query", "title=查询&isTop=true"), createButton("import", "title=导入&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged")], + children: [ + createButton("query", "title=查询&isTop=true"), + createButton("import", "title=导入&isTop=true"), + createButton("export", "title=导出&isTop=true&pattern=paged"), + createButton("enable", "title=启用&disabled=o=>o.isCancel===true"), + createButton("disable", "title=停用&disabled=o=>o.isCancel===false"), + ], }, // { // ...createPage("cai-gou", "title=采购价格单"), @@ -64,7 +70,13 @@ export default [ // }, { ...createPage("xiao-shou", "title=销售价格单"), - children: [createButton("query", "title=查询&isTop=true"), createButton("import", "title=导入&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged")], + children: [ + createButton("query", "title=查询&isTop=true"), + createButton("import", "title=导入&isTop=true"), + createButton("export", "title=导出&isTop=true&pattern=paged"), + createButton("enable", "title=启用&disabled=o=>o.isCancel===true"), + createButton("disable", "title=停用&disabled=o=>o.isCancel===false"), + ], }, // { // ...createPage("ke-hu", "title=客户库位关系表"), diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian.js index 6c6985ca..210421b4 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian.js @@ -1,2 +1,26 @@ -import useList from "../_list.js"; -export default useList("base-data/bei-jian"); +import html from "html"; +import { ref } from "vue"; +import request from "../../request/index.js"; +import AppList from "../../components/list/index.js"; +import useConfig from "../../models/base-data/bei-jian.js"; + +export default { + components: { AppList }, + template: html``, + setup() { + const appListRef = ref(null); + const config = useConfig(); + const onCommand = async (item, rows) => { + const url = `${config.baseUrl}/${item.path}`; + if (item.path === "enable" || item.path === "disable") { + await appListRef.value.onClick( + async () => + await request("settleaccount/price-list-app-service-bj/update", { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true), + `确认${item.path === "open-version" ? "启用" : "停用"}选中的${rows.length}行数据吗?`, + true + ); + } + }; + return { appListRef, config, onCommand }; + }, +}; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou.js index bb80ff15..28d0f058 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou.js @@ -1,2 +1,25 @@ -import useList from "../_list.js"; -export default useList("base-data/xiao-shou"); +import html from "html"; +import { ref } from "vue"; +import request from "../../request/index.js"; +import AppList from "../../components/list/index.js"; +import useConfig from "../../models/base-data/xiao-shou.js"; + +export default { + components: { AppList }, + template: html``, + setup() { + const appListRef = ref(null); + const config = useConfig(); + const onCommand = async (item, rows) => { + const url = `${config.baseUrl}/${item.path}`; + if (item.path === "enable" || item.path === "disable") { + await appListRef.value.onClick( + async () => await request("settleaccount/price-list/update", { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true), + `确认${item.path === "open-version" ? "启用" : "停用"}选中的${rows.length}行数据吗?`, + true + ); + } + }; + return { appListRef, config, onCommand }; + }, +}; From b5a743fa05282d9469bd56b45c8f98db90c799c7 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 15 Sep 2023 11:57:23 +0800 Subject: [PATCH 3/4] up --- .../wwwroot/router/base-data.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js index bf9e4680..937125ee 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js @@ -60,8 +60,8 @@ export default [ createButton("query", "title=查询&isTop=true"), createButton("import", "title=导入&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged"), - createButton("enable", "title=启用&disabled=o=>o.isCancel===true"), - createButton("disable", "title=停用&disabled=o=>o.isCancel===false"), + createButton("enable", "title=启用&disabled=o=>o.isCancel===false"), + createButton("disable", "title=停用&disabled=o=>o.isCancel===true"), ], }, // { @@ -74,8 +74,8 @@ export default [ createButton("query", "title=查询&isTop=true"), createButton("import", "title=导入&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged"), - createButton("enable", "title=启用&disabled=o=>o.isCancel===true"), - createButton("disable", "title=停用&disabled=o=>o.isCancel===false"), + createButton("enable", "title=启用&disabled=o=>o.isCancel===false"), + createButton("disable", "title=停用&disabled=o=>o.isCancel===true"), ], }, // { From 48fefb910dda691b198a6b592c272f28d5377ea9 Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 15 Sep 2023 12:15:24 +0800 Subject: [PATCH 4/4] up --- .../Entities/Prices/PriceListAppService.cs | 2 +- .../Entities/Prices/PriceListAppServiceBJ.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index 37101f16..5930002b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -268,7 +268,7 @@ public class PriceListAppService : SettleAccountApplicationBase throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPrice.BeginTime:yyyy-MM-dd}至{existPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); } } - _settleAccountDbContext.Set().Update(entity); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index 3e378daf..d274e04e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -226,7 +226,7 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPriceBj.BeginDate:yyyy-MM-dd}至{existPriceBj.EndDate:yyyy-MM-dd}】存在交集", "400"); } } - _settleAccountDbContext.Set().Update(entity); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; }