Browse Source

[CI SKIP] Qad发票同步状态查询前端页面

master
wanggang 1 year ago
parent
commit
9f6ddc4390
  1. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/_options.js
  2. 145
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/finance.js
  3. 123
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/sync.js
  4. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  5. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js
  6. 71
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/finance/check.js
  7. 18
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/finance/sync.js
  8. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  9. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
  10. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js
  11. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/_options.js

@ -175,5 +175,17 @@ const invState = {
],
};
const taskState = {
title: "状态",
type: "string",
input: "select",
options: [
{ value: 0, label: "未读" },
{ value: 1, label: "正在读取" },
{ value: 2, label: "成功" },
{ value: 3, label: "失败" },
],
};
export default businessType;
export { version, state, state2, state3, transType, deliverBillType, deliverSubBillType, proType, billState, codeType, invState };
export { version, state, state2, state3, transType, deliverBillType, deliverSubBillType, proType, billState, codeType, invState, taskState };

145
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/finance.js

@ -1,145 +0,0 @@
//财务审核
import version from "../version.js";
import { state2 } from "../state.js";
import { businessType, invoiceState } from "../_options.js";
const state = Object.assign({}, state2);
state.input = "tabs";
const schema = {
title: "商务审批",
type: "object",
properties: {
version,
realnvBillNum: {
title: "金税发票号",
type: "string",
},
invbillNum: {
title: "系统发票号",
type: "string",
link: true,
},
amt: {
title: "未税金额",
type: "number",
},
taxAmt: {
title: "税后金额",
type: "number",
},
invGroupNum: {
title: "发票分组号",
type: "number",
link: true,
},
businessType,
state,
invoiceState,
taxDiff: {
title: "发票税后尾差",
type: "number",
},
clientCode: {
title: "客户代码",
type: "string",
},
},
};
export default function () {
const service = "invoice_service";
const queryUrl = `settleaccount/${service}/main-query`;
const exportUrl = `settleaccount/${service}/export`;
const invoiceUrl = `settleaccount/${service}/generate-invoice`;
const receivedUrl = `settleaccount/${service}/received`;
const rejectUrl = `settleaccount/${service}/reject`;
const reissueUrl = `settleaccount/${service}/reissue-invoice`;
const queryMethod = "POST";
const exportMethod = "POST";
const invoiceMethod = "POST";
const receivedMethod = "POST";
const rejectMethod = "POST";
const reissueMethod = "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,
},
{
logic: "and",
column: "state",
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,
invoiceUrl,
receivedUrl,
rejectUrl,
reissueUrl,
exportMethod,
invoiceMethod,
receivedMethod,
rejectMethod,
reissueMethod,
schema: schema,
},
};
}

123
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/sync.js

@ -0,0 +1,123 @@
//库存扣减
import { taskState } from "../_options.js";
export default function () {
const schema = {
title: "Qad发票同步状态查询",
type: "object",
properties: {
taskState,
taskId: {
title: "任务Id",
type: "string",
},
tableName: {
title: "表名",
type: "string",
},
failedInfo: {
title: "失败信息",
type: "string",
},
site: {
title: "地点",
type: "string",
},
domain: {
title: "域",
type: "string",
},
invoiceNumber: {
title: "金税发票号",
type: "string",
},
sasInvoiceNumber: {
title: "结算发票号",
type: "string",
},
customer: {
title: "客户",
type: "string",
},
voucher: {
title: "凭证号",
type: "string",
},
},
};
const queryUrl = "settleaccount/bbac_pd_service/detail-query";
return {
query: {
url: queryUrl,
method: "POST",
hasFilter: true,
schema: {
title: "Qad发票同步状态查询",
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: "invoiceNumber",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "sasInvoiceNumber",
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,
},
edit: {
schema,
},
};
}

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

@ -355,11 +355,11 @@ export default [
],
},
{
...createRoute("invoice", "title=财务审核"),
...createRoute("finance", "title=财务审核"),
children: [
{
...createPage("finance", `title=财务审核`),
component: "/settle/finance",
...createPage("check", `title=财务审核`),
component: "/finance/check",
children: [
createButton("query", "title=查询&isTop=true"),
createButton("export", "title=导出&isTop=true&pattern=paged"),
@ -387,6 +387,11 @@ export default [
),
],
},
{
...createPage("sync", `title=Qad发票同步状态查询`),
component: "/finance/sync",
children: [createButton("query", "title=查询&isTop=true")],
},
],
},
{

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js

@ -1,14 +1,14 @@
import html from "html";
import { schemaToModel } from "html";
import { ref, nextTick, onMounted, watch } from "vue";
import request from "../../request/index.js";
import AppForm from "../../components/form/index.js";
import AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js";
import businessTypes from "../../models/_options.js";
import { required, trim } from "../../utils/validation.js";
import { delay } from "../../utils/index.js";
import request from "../request/index.js";
import AppForm from "../components/form/index.js";
import AppTable from "../components/table/index.js";
import extraProperties from "../models/_extraProperties.js";
import { getUrl } from "../request/index.js";
import businessTypes from "../models/_options.js";
import { required, trim } from "../utils/validation.js";
import { delay } from "../utils/index.js";
import { ElMessage, ElMessageBox } from "element-plus";
export default {

71
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/finance/check.js

@ -0,0 +1,71 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "../_check.js";
export default {
components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :businessType="businessType" :row="row" :data="data" />`,
setup() {
const appListRef = ref(null);
const visable = ref(false);
const row = ref(null);
const data = ref(null);
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "cai-wu");
const onCommand = async (item, rows) => {
if (item.path === "approval" || item.path === "reject" || item.path === "receive" || item.path === "sync") {
if (rows.length > 0) {
let message = null;
let url = null;
let data = rows.map((o) => o.invbillNum);
if (item.path === "approval") {
message = `确认审核通过选中的${rows.length}行数据吗?`;
url = config.edit.approvalUrl;
} else if (item.path === "reject") {
message = `确认退回选中的${rows.length}行数据吗?`;
data = rows[0]["invGroupNum"];
url = config.edit.rejectUrl;
} else if (item.path === "receive") {
message = `确认选中的${rows.length}行数据客户已收票吗?`;
url = config.edit.receivedUrl;
} else if (item.path === "sync") {
message = `确认选中的${rows.length}行数据同步到QAD吗?`;
url = "settleaccount/invoice_service/submit-to-qad";
}
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
const url = config.edit.exportGroupUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
await appListRef.value.onClick(async () => {
const response = await request(url, postData, { method }, true);
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
});
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
row.value = rows[0];
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
}
console.log(item.path, item, rows);
};
return { appListRef, config, onCommand, visable, row, data, businessType };
},
};

18
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/finance/sync.js

@ -0,0 +1,18 @@
import AppList from "../../components/list/index.js";
import html from "html";
import useConfig from "../../models/settle/sync.js";
export default {
components: { AppList },
template: html`<app-list v-if="config" :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return {
config,
onCommand,
};
},
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js

@ -4,7 +4,7 @@ import { useRoute } from "vue-router";
import { ref } from "vue";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
import AppCheck from "../_check.js";
export default {
components: { AppList, AppCheck },

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js

@ -4,7 +4,7 @@ import { useRoute } from "vue-router";
import { ref } from "vue";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
import AppCheck from "../_check.js";
export default {
components: { AppList, AppCheck },

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js

@ -4,7 +4,7 @@ import { useRoute } from "vue-router";
import { ref } from "vue";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/inventory.js";
import AppCheck from "./_check.js";
import AppCheck from "../_check.js";
export default {
components: { AppList, AppCheck },

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js

@ -4,7 +4,7 @@ import { useRoute } from "vue-router";
import { ref } from "vue";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/inventory.js/index.js";
import AppCheck from "./_check.js";
import AppCheck from "../_check.js";
export default {
components: { AppList, AppCheck },

Loading…
Cancel
Save