diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
index 7c829a00..c961f506 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
@@ -885,6 +885,7 @@ export default {
load,
config,
queryModel,
+ buildQuery,
pageModel,
treeProps,
tableKey,
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
index 77c76808..535e3b8c 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
@@ -6,7 +6,6 @@ const schema = {
title: "商务审批",
type: "object",
properties: {
- version,
realnvBillNum: {
title: "金税发票号",
type: "string",
@@ -54,10 +53,10 @@ const schema = {
export default function (businessType, type) {
let service = null;
- if (type === "shangwu") {
+ if (type === "shang-wu") {
if (businessType === "JisBBAC") {
service = "bbac_ba_service";
- } else if (businessType === "JisBBAC") {
+ } else if (businessType === "JisHBPO") {
service = "hbpo_ba_service";
} else {
service = "pub_ba_service";
@@ -108,13 +107,6 @@ export default function (businessType, type) {
},
},
default: [
- {
- logic: "and",
- column: "version",
- action: "equal",
- value: null,
- readOnly: true,
- },
{
logic: "and",
column: "state",
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
index ff9eadd2..1a69b1ca 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
@@ -1,5 +1,3 @@
-import { version } from "../_options.js";
-
const schema = {
title: "通用代码",
type: "object",
@@ -68,14 +66,24 @@ const schema = {
},
};
-export default function (businessType) {
+export default function (businessType, type) {
let service;
- if (businessType === "JisBBAC") {
- service = "bbac_not_sa_service";
- } else if (businessType === "JisHBPO") {
- service = "hbpo_not_sa_service";
+ if (type === "unable") {
+ if (businessType === "JisBBAC") {
+ service = "bbac_not_sa_service";
+ } else if (businessType === "JisHBPO") {
+ service = "hbpo_not_sa_service";
+ } else {
+ service = "pub_not_sa_service";
+ }
} else {
- service = "pub_not_sa_service";
+ if (businessType === "JisBBAC") {
+ service = "bbac_can_sa_service";
+ } else if (businessType === "JisHBPO") {
+ service = "hbpo_can_sa_service";
+ } else {
+ service = "pub_can_sa_service";
+ }
}
if (businessType === "JisBBAC" || businessType === "JisHBPO" || businessType === "MaiDanJianBBAC" || businessType === "MaiDanJianHBPO") {
schema.properties.pn.title = "生产码";
@@ -93,7 +101,11 @@ export default function (businessType) {
delete schema.properties["site"];
}
const queryUrl = `settleaccount/${service}/detail-query`;
+ const addUrl = `settleaccount/${service}/generate-settlement-order`;
+ const exportUrl = `settleaccount/${service}/export`;
const queryMethod = "POST";
+ const addMethod = "POST";
+ const exportMethod = "POST";
return {
query: {
@@ -167,6 +179,11 @@ export default function (businessType) {
schema: schema,
},
edit: {
+ addUrl,
+ exportUrl,
+ addMethod,
+ exportUrl,
+ exportMethod,
schema: schema,
},
};
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js
new file mode 100644
index 00000000..ea1a6079
--- /dev/null
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js
@@ -0,0 +1,112 @@
+import { version, state } from "../_options.js";
+
+const schema = {
+ title: "可结算单",
+ type: "object",
+ properties: {
+ version,
+ state,
+ billNum: {
+ title: "结算单据",
+ type: "string",
+ oneToMany: "/settle/detail",
+ config: "/models/settle/detail.js",
+ },
+ settleBillNum: {
+ title: "关联结算单号",
+ type: "string",
+ },
+ invGroupNum: {
+ title: "发票分组号",
+ type: "string",
+ },
+ },
+};
+
+export default function (businessType) {
+ let service;
+ if (businessType === "JisBBAC") {
+ service = "bbac_can_sa_service";
+ } else if (businessType === "JisHBPO") {
+ service = "hbpo_can_sa_service";
+ } else {
+ service = "pub_can_sa_service";
+ }
+ const queryUrl = `settleaccount/${service}/main-query`;
+ const exportUrl = `settleaccount/${service}/export`;
+ const addUrl = `settleaccount/${service}/generate-invoice`;
+
+ const queryMethod = "POST";
+ const exportMethod = "POST";
+ const addMethod = "POST";
+
+ 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: "version",
+ action: "equal",
+ value: null,
+ readOnly: true,
+ },
+ ],
+ },
+ skipCount: {
+ hidden: true,
+ default: 0,
+ },
+ maxResultCount: {
+ hidden: true,
+ default: 10,
+ },
+ sorting: {
+ hidden: true,
+ },
+ businessType: {
+ hidden: true,
+ default: 0,
+ },
+ },
+ },
+ },
+ table: {
+ schema: schema,
+ },
+ edit: {
+ exportUrl,
+ addUrl,
+ exportMethod,
+ addMethod,
+ schema: schema,
+ },
+ };
+}
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
index da1865b6..534232f2 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
@@ -65,10 +65,7 @@ const getResult = async (response) => {
} catch (error) {
console.log(error);
}
- ElMessageBox.alert(
- `${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`,
- `${result.errors?.error?.code ?? result.status}`
- );
+ ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`);
}
return result;
};
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
index a7e2ba79..c60ac00d 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
@@ -85,10 +85,10 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
component: "/settle/commerce",
children: [
createButton("query", "title=查询&isTop=true"),
- createButton("compare", "title=商务审核通过&isTop=true"),
- createButton("reject", "title=退回&isTop=true"),
+ createButton("approval", "title=商务审核通过&isTop=true"),
+ createButton("reject", "title=退回"),
createButton("export", "title=导出&isTop=true&pattern=paged"),
- createButton("????", "title=客户已收票&isTop=true"),
+ createButton("receive", "title=客户已收票&isTop=true"),
],
};
}
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
index 73068307..6f8d38d5 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
@@ -38,7 +38,7 @@ export default {
@@ -70,7 +70,7 @@ export default {
上一步
@@ -253,6 +253,8 @@ export default {
const addDialogVisible = ref(false);
const importDialogVisible = ref(false);
const showSetupDialog = () => {
+ //重开发票号
+ //invBillNum=
adjList.value = [];
setupRef.value = 1;
setupDialogVisable.value = true;
@@ -276,6 +278,7 @@ export default {
type: "string",
title: "发票号",
rules: [{ required: true }],
+ default: props.data.invbillNum,
},
settleDate: {
type: "string",
@@ -307,7 +310,7 @@ export default {
},
};
const defaultAdjModel = schemaToModel(adjSchema);
- const adjModel = ref(Object.assign({}, defaultAdjModel));
+ const adjModel = ref(Object.assign({ invBillNum: "" }, defaultAdjModel));
const addAdjFormRef = ref(null);
const showAddAdjDialog = () => {
adjModel.value = Object.assign({}, defaultAdjModel);
@@ -372,6 +375,26 @@ export default {
loading.value = false;
}
};
+ const next = async () => {
+ if (setupRef.value === 1) {
+ try {
+ const url = "settleaccount/adj_service/check-import";
+ const result = await request(url, adjList.value, { method: "POST" });
+ if (!result.errors) {
+ if (result.data?.code === 200) {
+ //明细对比逻辑处理
+ setupRef += 1;
+ } else if (result.data?.code === 400 && result.data.fileName) {
+ window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
+ }
+ }
+ } catch (e) {
+ console.log(e);
+ }
+ } else {
+ setupRef += 1;
+ }
+ };
const submitReOpen = async () => {};
//
onMounted(async () => {
@@ -409,6 +432,7 @@ export default {
importAdjSchema,
importAdj,
scrollRef,
+ next,
};
},
};
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
index 07f17581..51e8894f 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
@@ -2,23 +2,56 @@ import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
+import { ElMessage, ElMessageBox } from "element-plus";
+import request from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
export default {
components: { AppList, AppCheck },
- template: html` `,
+ template: html` `,
setup() {
+ const appListRef = ref(null);
const visable = ref(false);
const data = ref(null);
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "shang-wu");
const onCommand = async (item, rows) => {
- data.value = { [item.path]: rows[0][item.path] };
- visable.value = true;
- console.log(item.path, item, rows);
+ if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
+ if (rows.length === 0) {
+ ElMessage({
+ type: "warning",
+ message: "没有选中的数据",
+ });
+ } else {
+ const message =
+ item.path === "approval"
+ ? `确认审核通过选中的${rows.length}行数据吗?`
+ : item.path === "reject"
+ ? `确认退回选中的${rows.length}行数据吗?`
+ : `确认选中的${rows.length}行数据客户已收票吗?`;
+ const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
+ const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
+ try {
+ await ElMessageBox.confirm(message, "提示", {
+ type: "warning",
+ });
+ appListRef.value.tableLoading = true;
+ const result = request(url, data, { method: "POST" });
+ console.log(result);
+ } catch (e) {
+ console.log(e);
+ } finally {
+ appListRef.value.tableLoading = false;
+ }
+ }
+ } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
+ data.value = { invbillNum: rows[0]["invbillNum"], invGroupNum: rows[0]["invGroupNum"] };
+ visable.value = true;
+ console.log(item.path, item, rows);
+ }
};
- return { config, onCommand, visable, data };
+ return { appListRef, config, onCommand, visable, data };
},
};
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
index 47b708b6..ed6df1fc 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
@@ -1,19 +1,37 @@
import AppList from "../../components/list/index.js";
import html from "html";
+import { ref } from "vue";
import { useRoute } from "vue-router";
+import { ElMessageBox } from "element-plus";
import useConfig from "../../models/settle/detail.js";
+import request from "../../request/index.js";
export default {
components: { AppList },
- template: html``,
+ template: html``,
setup() {
+ const appListRef = ref(null);
const route = useRoute();
const businessType = route.meta.businessType;
- const config = useConfig(businessType);
+ const config = useConfig(businessType, "unable");
const onCommand = async (item, rows) => {
+ const url = config.edit.addUrl;
if (item.path === "add") {
+ try {
+ await ElMessageBox.confirm(`确认是否对所有符合查询条件的数据生成可结算单?`, "提示", {
+ type: "warning",
+ });
+ appListRef.value.tableLoading = true;
+ const data = appListRef.value.buildQuery();
+ const result = request(url, data, { method: "POST" });
+ console.log(result);
+ } catch (e) {
+ console.log(e);
+ } finally {
+ appListRef.value.tableLoading = false;
+ }
}
};
- return { config, onCommand };
+ return { appListRef, config, onCommand };
},
};
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
index b14d10a7..f7d0bc3f 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
@@ -19,7 +19,7 @@ export default {
if (item.path === "add") {
const invbillNum = rows[0].billNum;
try {
- await ElMessageBox.confirm(`"确认为${invbillNum}创建发票?`, "提示", {
+ await ElMessageBox.confirm(`确认为${invbillNum}创建发票?`, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;