学 赵 1 year ago
parent
commit
6107419fbc
  1. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js
  2. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js
  3. 7
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js
  4. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
  5. 28
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian.js
  6. 27
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou.js
  7. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  8. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js

@ -34,6 +34,10 @@ const schema = {
title: "合同号", title: "合同号",
type: "string", type: "string",
}, },
isCancel: {
type: "boolean",
title: "是否已停用",
},
}, },
}; };

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js

@ -33,6 +33,10 @@ const schema = {
title: "合同号", title: "合同号",
type: "string", type: "string",
}, },
isCancel: {
type: "boolean",
title: "是否已停用",
},
}, },
}; };

7
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 = { const querySchema = {
title: "结算数据", title: "结算数据",
type: "object", type: "object",

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js

@ -56,7 +56,13 @@ export default [
// }, // },
{ {
...createPage("bei-jian", "title=备件价格单"), ...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===false"),
createButton("disable", "title=停用&disabled=o=>o.isCancel===true"),
],
}, },
// { // {
// ...createPage("cai-gou", "title=采购价格单"), // ...createPage("cai-gou", "title=采购价格单"),
@ -64,7 +70,13 @@ export default [
// }, // },
{ {
...createPage("xiao-shou", "title=销售价格单"), ...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===false"),
createButton("disable", "title=停用&disabled=o=>o.isCancel===true"),
],
}, },
// { // {
// ...createPage("ke-hu", "title=客户库位关系表"), // ...createPage("ke-hu", "title=客户库位关系表"),

28
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian.js

@ -1,2 +1,26 @@
import useList from "../_list.js"; import html from "html";
export default useList("base-data/bei-jian"); 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`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
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 };
},
};

27
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou.js

@ -1,2 +1,25 @@
import useList from "../_list.js"; import html from "html";
export default useList("base-data/xiao-shou"); 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`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
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 };
},
};

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -256,19 +256,19 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
entity.IsCancel = input.IsCancel; entity.IsCancel = input.IsCancel;
if (entity.IsCancel == false) if (entity.IsCancel == false)
{ {
var existsPriceList = _settleAccountDbContext.Set<PriceList>() var existPriceList = _settleAccountDbContext.Set<PriceList>()
.Where(t => t.LU == entity.LU) .Where(t => t.LU == entity.LU)
.Where(t => t.IsCancel == false) .Where(t => t.IsCancel == false)
.Where(t => t.Id != entity.Id) .Where(t => t.Id != entity.Id)
.ToList(); .ToList();
var existsPrice = existsPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime)); var existPrice = existPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime));
if (existsPrice != null) 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<PriceList>().Update(entity); await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false);
var dto = ObjectMapper.Map<PriceList, PriceListDto>(entity); var dto = ObjectMapper.Map<PriceList, PriceListDto>(entity);
return dto; return dto;
} }

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -214,19 +214,19 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
entity.IsCancel = input.IsCancel; entity.IsCancel = input.IsCancel;
if (entity.IsCancel == false) if (entity.IsCancel == false)
{ {
var existsPriceBjList = _settleAccountDbContext.Set<PriceListBJ>() var existPriceBjList = _settleAccountDbContext.Set<PriceListBJ>()
.Where(t => t.LU == entity.LU) .Where(t => t.LU == entity.LU)
.Where(t => t.IsCancel == false) .Where(t => t.IsCancel == false)
.Where(t => t.Id != entity.Id) .Where(t => t.Id != entity.Id)
.ToList(); .ToList();
var existsPriceBj = existsPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate)); var existPriceBj = existPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate));
if (existsPriceBj != null) 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<PriceListBJ>().Update(entity); await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false);
var dto = ObjectMapper.Map<PriceListBJ, PriceListBJDto>(entity); var dto = ObjectMapper.Map<PriceListBJ, PriceListBJDto>(entity);
return dto; return dto;
} }

Loading…
Cancel
Save