From 8da897893b928873b62c712e7adb98e07cbb6ec3 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Sat, 12 Aug 2023 13:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E5=8A=A1=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=92=8C=E8=B4=A2=E5=8A=A1=E5=AE=A1=E6=A0=B8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=80=9A=E7=94=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/models/inventory/adjust.js | 2 +- .../wwwroot/models/inventory/log.js | 2 +- .../jis-bbac/settlement/bbac_ba_service.js | 134 ----- .../jis-hbpo/settlement/hbpo_ba_service.js | 134 ----- .../wwwroot/models/pub_ba_service.js | 27 +- .../wwwroot/router/business.js | 9 + .../wwwroot/views/_check.js | 473 +++++++++++++++++ .../views/bj/settlement/bj_pub_ba_service.js | 13 +- .../views/in/settlement/in_pub_ba_service.js | 13 +- .../views/invoice/invoice_map_group.js | 486 +----------------- .../jis-bbac/settlement/bbac_ba_service.js | 15 +- .../jis-hbpo/settlement/hbpo_ba_service.js | 15 +- .../settlement/bbac_jit_pub_ba_service.js | 15 +- .../settlement/hbpo_jit_pub_ba_service.js | 13 +- .../settlement/hbpo_md_pub_ba_service.js | 13 +- .../Entities/BQ/VmiAppService.cs | 102 ++-- 16 files changed, 625 insertions(+), 841 deletions(-) delete mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_service.js delete mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_service.js create mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js index 7b76c12f..a5500643 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js @@ -125,7 +125,7 @@ const detailsUrl = `${baseUrl}/get/%s`; const createUrl = "settleaccount/vmi/edit-balance"; const updateUrl = `${baseUrl}/update/%s`; const deleteUrl = `${baseUrl}/delete-list`; -const importUrl = `${baseUrl}/code-setting-upload-excel-import`; +const importUrl = `${baseUrl}/import`; const exportUrl = `${baseUrl}/export`; const queryMethod = "POST"; const detailsMethod = "POST"; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js index 6a36303c..61041005 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js @@ -109,7 +109,7 @@ 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 importUrl = `${baseUrl}/log-import`; const exportUrl = `${baseUrl}/log-export`; const queryMethod = "POST"; const detailsMethod = "POST"; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_service.js deleted file mode 100644 index 03f3f97f..00000000 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_service.js +++ /dev/null @@ -1,134 +0,0 @@ -import version from "../../version.js"; -import { state2 as state, state3 } from "../../state.js"; -import businessType from "../../businessType.js"; -import invoiceState from "../../invoiceState.js"; - -const schema = { - title: "商务审批", - type: "object", - properties: { - version, - realnvBillNum: { - title: "金税发票号", - type: "string", - }, - invbillNum: { - title: "系统发票号", - type: "string", - }, - amt: { - title: "未税金额", - type: "number", - }, - taxAmt: { - title: "税后金额", - type: "number", - }, - invGroupNum: { - title: "发票分组号", - type: "number", - }, - businessType, - state, - invoiceState, - taxDiff: { - title: "发票税后尾差", - type: "number", - }, - clientCode: { - title: "客户代码", - type: "string", - }, - }, -}; - -const queryUrl = "settleaccount/bbac_ba_service/main-query"; -const exportUrl = "settleaccount/bbac_ba_service/export"; -const invoiceUrl = "settleaccount/bbac_ba_service/generate-invoice"; -const receivedUrl = "settleaccount/bbac_ba_service/received"; -const rejectUrl = "settleaccount/bbac_ba_service/reject"; -const reissueUrl = "settleaccount/bbac_ba_service/reissue-invoice"; -const queryMethod = "POST"; -const exportMethod = "POST"; -const invoiceMethod = "POST"; -const receivedMethod = "POST"; -const rejectMethod = "POST"; -const reissueMethod = "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: "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, - invoiceUrl, - receivedUrl, - rejectUrl, - reissueUrl, - exportMethod, - invoiceMethod, - receivedMethod, - rejectMethod, - reissueMethod, - schema: schema, - }, - }; -} diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_service.js deleted file mode 100644 index f8088f76..00000000 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_service.js +++ /dev/null @@ -1,134 +0,0 @@ -import version from "../../version.js"; -import { state2 as state, state3 } from "../../state.js"; -import businessType from "../../businessType.js"; -import invoiceState from "../../invoiceState.js"; - -const schema = { - title: "不可结算单", - type: "object", - properties: { - version, - realnvBillNum: { - title: "金税发票号", - type: "string", - }, - invbillNum: { - title: "系统发票号", - type: "string", - }, - amt: { - title: "未税金额", - type: "number", - }, - taxAmt: { - title: "税后金额", - type: "number", - }, - invGroupNum: { - title: "发票分组号", - type: "number", - }, - businessType, - state, - invoiceState, - taxDiff: { - title: "发票税后尾差", - type: "number", - }, - clientCode: { - title: "客户代码", - type: "string", - }, - }, -}; - -const queryUrl = "settleaccount/hbpo_ba_service/main-query"; -const exportUrl = "settleaccount/hbpo_ba_service/export"; -const invoiceUrl = "settleaccount/hbpo_ba_service/generate-invoice"; -const receivedUrl = "settleaccount/hbpo_ba_service/received"; -const rejectUrl = "settleaccount/hbpo_ba_service/reject"; -const reissueUrl = "settleaccount/hbpo_ba_service/reissue-invoice"; -const queryMethod = "POST"; -const exportMethod = "POST"; -const invoiceMethod = "POST"; -const receivedMethod = "POST"; -const rejectMethod = "POST"; -const reissueMethod = "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: "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, - invoiceUrl, - receivedUrl, - rejectUrl, - reissueUrl, - exportMethod, - invoiceMethod, - receivedMethod, - rejectMethod, - reissueMethod, - schema: schema, - }, - }; -} diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_service.js index 546fa078..111260b0 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_service.js @@ -4,7 +4,7 @@ import businessType from "./businessType.js"; import invoiceState from "./invoiceState.js"; const schema = { - title: "不可结算单", + title: "商务审批", type: "object", properties: { version, @@ -15,6 +15,7 @@ const schema = { invbillNum: { title: "系统发票号", type: "string", + link: true, }, amt: { title: "未税金额", @@ -27,6 +28,7 @@ const schema = { invGroupNum: { title: "发票分组号", type: "number", + link: true, }, businessType, state, @@ -41,16 +43,19 @@ const schema = { }, }, }; -const queryUrl = "settleaccount/pub_ba_service/main-query"; -const exportUrl = "settleaccount/pub_ba_service/export"; -const invoiceUrl = "settleaccount/pub_ba_service/generate-invoice"; -const rejectUrl = "settleaccount/pub_ba_service/reject"; -const receivedUrl = "settleaccount/pub_ba_service/received"; + +const queryUrl = "settleaccount/bbac_ba_service/main-query"; +const exportUrl = "settleaccount/bbac_ba_service/export"; +const invoiceUrl = "settleaccount/bbac_ba_service/generate-invoice"; +const receivedUrl = "settleaccount/bbac_ba_service/received"; +const rejectUrl = "settleaccount/bbac_ba_service/reject"; +const reissueUrl = "settleaccount/bbac_ba_service/reissue-invoice"; const queryMethod = "POST"; const exportMethod = "POST"; const invoiceMethod = "POST"; -const rejectMethod = "POST"; const receivedMethod = "POST"; +const rejectMethod = "POST"; +const reissueMethod = "POST"; export default function () { return { @@ -59,7 +64,7 @@ export default function () { method: queryMethod, hasFilter: true, schema: { - title: "结算数据", + title: "商务审批", type: "object", properties: { filters: { @@ -117,12 +122,14 @@ export default function () { edit: { exportUrl, invoiceUrl, - rejectUrl, receivedUrl, + rejectUrl, + reissueUrl, exportMethod, invoiceMethod, - rejectMethod, receivedMethod, + rejectMethod, + reissueMethod, schema: schema, }, }; 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 99763e0c..1cb97111 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 @@ -3857,6 +3857,15 @@ export default [ isTop: true, }, }, + { + path: "import", + meta: { + type: "button", + title: "导入", + icon: "file", + isTop: true, + }, + }, ], }, ], diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js new file mode 100644 index 00000000..25463e64 --- /dev/null +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js @@ -0,0 +1,473 @@ +import html from "html"; +import { schemaToModel } from "html"; +import { ref, defineModel, 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"; + +export default { + components: { AppForm, AppTable }, + template: html` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + 新建 + 导入 + 删除 + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + `, + styles: html` `, + props: ["modelValue", "data", "isBusiness"], + emit: ["update:modelValue"], + setup(props, context) { + const show = ref(props.modelValue); + watch(show, (value) => context.emit("update:modelValue", value)); + const loading = ref(false); + const model = ref({ + invoicE_WAIT_DETAIL: [], + invoicE_MAP_GROUP: [], + invoicE_NOT_SETTLE: [], + adJ_DETAIL: [], + }); + // + const columns1 = [ + { + dataKey: "version", + title: "期间", + }, + { + dataKey: "invbillNum", + title: "发票号", + }, + { + dataKey: "invGroupNum", + title: "发票分组号", + }, + { + dataKey: "settleGroupNum", + title: "结算分组号", + }, + { + dataKey: "amt", + title: "金额", + }, + ]; + const columns2 = [ + { + key: "version", + dataKey: "version", + title: "期间", + }, + { + dataKey: "invbillNum", + title: "发票号", + }, + { + dataKey: "invGroupNum", + title: "发票分组号", + }, + { + dataKey: "lu", + title: "零件号", + }, + { + dataKey: "price", + title: "单价", + }, + { + dataKey: "qty", + title: "数量", + }, + { + dataKey: "amt", + title: "金额", + }, + { + dataKey: "bussiessType", + title: "业务分类", + }, + ]; + const columns3 = [ + { + dataKey: "version", + title: "期间", + }, + { + dataKey: "invGroupNum", + title: "发票分组号", + }, + { + dataKey: "settleGroupNum", + title: "结算分组号", + }, + { + dataKey: "lu", + title: "可结算分组号", + }, + { + dataKey: "lu1", + title: "不可结算分组号", + }, + ]; + const columns4 = [ + { + dataKey: "oldInvBillNum", + title: "作废发票号", + }, + { + dataKey: "invBillNum", + title: "发票号", + }, + { + dataKey: "settleDate", + title: "下线日期", + }, + { + dataKey: "invGroupNum", + title: "发票分组号", + }, + { + dataKey: "lu", + title: "零件号", + }, + { + dataKey: "pn", + title: "标识号", + }, + { + dataKey: "qty", + title: "数量", + }, + { + dataKey: "groupNum", + title: "结算分组", + }, + ]; + const columns5 = columns4.filter((o) => o.dataKey !== "oldInvBillNum" && o.dataKey !== "invGroupNum"); + columns5.unshift({ + input: "selection", + }); + //显示重开发票对话框 + const setupDialogVisable = ref(false); + const setupRef = ref(1); + const adjList = ref([]); + const scrollRef = ref(null); + const adjListRef = ref(null); + const addDialogVisible = ref(false); + const importDialogVisible = ref(false); + const showSetupDialog = () => { + adjList.value = []; + setupRef.value = 1; + setupDialogVisable.value = true; + }; + const deleteAdj = () => { + const list = adjListRef.value.getSelection(); + if (list.length > 0) { + for (let i = 0; i < list.length; i++) { + adjList.value.splice(list[i] - i, 1); + } + nextTick(() => { + adjListRef.value.clearSelection(); + scrollRef.value.update(); + }); + } + }; + const adjSchema = { + type: "object", + properties: { + invBillNum: { + type: "string", + title: "发票号", + rules: [{ required: true }], + }, + settleDate: { + type: "string", + title: "下线日期", + input: "datetime", + rules: [{ required: true }], + }, + lu: { + type: "string", + title: "零件号", + rules: [{ required: true }], + }, + pn: { + type: "string", + title: "标识号", + rules: [{ required: true }], + }, + qty: { + type: "string", + title: "数量", + input: "number", + rules: [{ required: true }], + }, + groupNum: { + type: "string", + title: "结算分组", + rules: [{ required: true }], + }, + }, + }; + const defaultAdjModel = schemaToModel(adjSchema); + const adjModel = ref(Object.assign({}, defaultAdjModel)); + const addAdjFormRef = ref(null); + const showAddAdjDialog = () => { + adjModel.value = Object.assign({}, defaultAdjModel); + addDialogVisible.value = true; + }; + const addAdj = async () => { + try { + const valid = await addAdjFormRef.value.validate(); + if (valid) { + adjList.value.unshift(adjModel.value); + addDialogVisible.value = false; + } + } catch (error) { + console.log(error); + } + }; + const importAdjFromRef = ref(null); + const importAdjSchema = { + type: "object", + properties: { + files: { + title: "文件", + type: "array", + multiple: true, + input: "file", + accept: ".xlsx", + default: [], + limit: 1, + size: 100 * 1024 * 1024, + rules: [ + { + required: true, + trigger: "change", + }, + ], + }, + }, + }; + const defaultImportAdjModel = schemaToModel(importAdjSchema); + const importAdjModel = ref(defaultImportAdjModel); + const showImportAdjDialog = async () => { + importAdjModel.value = Object.assign({}, defaultImportAdjModel); + importDialogVisible.value = true; + }; + const importAdj = async () => { + try { + const valid = await importAdjFromRef.value.validate(); + if (valid) { + loading.value = true; + const url = "settleaccount/vmi/excel-to-json"; + const formData = new FormData(); + formData.append("files", importAdjModel.value.files[0].raw); + const result = await request(url, formData); + if (!result.errors) { + adjList.value = result.data; + importDialogVisible.value = false; + } + } + } catch (error) { + console.log(error); + } finally { + loading.value = false; + } + }; + const submitReOpen = async () => {}; + // + onMounted(async () => { + loading.value = true; + const response = await request("settleaccount/invoice_service/detail-query", props.data, { method: "POST" }); + model.value = response.data; + loading.value = false; + }); + return { + show, + loading, + model, + columns1, + columns2, + columns3, + columns4, + columns4, + columns5, + showSetupDialog, + setupRef, + setupDialogVisable, + adjList, + adjListRef, + deleteAdj, + showAddAdjDialog, + addDialogVisible, + addAdj, + addAdjFormRef, + importAdjFromRef, + adjSchema, + adjModel, + showImportAdjDialog, + importDialogVisible, + importAdjModel, + importAdjSchema, + importAdj, + scrollRef, + }; + }, +}; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_service.js index 2636f5d1..e3c70576 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_service.js @@ -1,16 +1,23 @@ import AppList from "../../../components/list/index.js"; import html from "html"; +import { ref } from "vue"; import useConfig from "../../../models/pub_ba_service.js"; +import AppCheck from "../../_check.js"; export default { - components: { AppList }, - template: html``, + components: { AppList, AppCheck }, + template: html` + `, setup() { const config = useConfig(); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; console.log(item.path, item, rows); }; config.query.schema.properties.businessType.default = "BeiJian"; - return { config, onCommand }; + return { config, onCommand, visable, data }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_service.js index 2c50f341..3bfa2cf5 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_service.js @@ -1,16 +1,23 @@ import AppList from "../../../components/list/index.js"; import html from "html"; +import { ref } from "vue"; import useConfig from "../../../models/pub_ba_service.js"; +import AppCheck from "../../_check.js"; export default { - components: { AppList }, - template: html``, + components: { AppList, AppCheck }, + template: html` + `, setup() { const config = useConfig(); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; console.log(item.path, item, rows); }; config.query.schema.properties.businessType.default = "YinDuJian"; - return { config, onCommand }; + return { config, onCommand, visable, data }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js index 3a2113a0..cd945b2d 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js @@ -1,489 +1,23 @@ import AppList from "../../../components/list/index.js"; import AppForm from "../../../components/form/index.js"; import html from "html"; -import { ref, nextTick } from "vue"; +import { ref } from "vue"; import useConfig from "../../../models/invoice/invoice_map_group.js"; -import request from "../../../request/index.js"; -import AppTable from "../../components/table/index.js"; -import { post } from "../../../request/index.js"; -import { schemaToModel } from "html"; +import AppCheck from "../_check.js"; export default { - components: { AppList, AppForm, AppTable }, + components: { AppList, AppForm, AppCheck }, template: html` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - 新建 - 导入 - 删除 - - - - - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - `, - styles: html` `, + `, setup() { - const fileList = ref([]); - const openImportHandler = async () => { - const url = "settleaccount/vmi/excel-to-json"; - const method = "POST"; - const formData = new FormData(); - if (config.query.schema.properties.businessType?.default) { - formData.append("businessType", config.query.schema.properties.businessType.default); - } - for (let i = 0; i < fileList.value.length; i++) { - formData.append(`files`, fileList.value[i].raw); - } - await post(url, formData, method); - }; - //create - const invoiceValue = ref([]); - const addDialogVisible = ref(false); - const importDialogVisible = ref(false); - const dialogVisible = ref(false); const config = useConfig(); - const drawer = ref(false); - const loading = ref(false); - const model = ref({ - invoicE_WAIT_DETAIL: [], - invoicE_MAP_GROUP: [], - invoicE_NOT_SETTLE: [], - adJ_DETAIL: [], - }); - const prop = ref(""); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { - prop.value = item.path; - drawer.value = true; - loading.value = true; - const data = { [item.path]: rows[0][item.path] }; - const response = await request("settleaccount/invoice_service/detail-query", data, { method: "POST" }); - model.value = response.data; - loading.value = false; - }; - const columns1 = [ - { - dataKey: "version", - title: "期间", - }, - { - dataKey: "invbillNum", - title: "发票号", - }, - { - dataKey: "invGroupNum", - title: "发票分组号", - }, - { - dataKey: "settleGroupNum", - title: "结算分组号", - }, - { - dataKey: "amt", - title: "金额", - }, - ]; - const columns2 = [ - { - key: "version", - dataKey: "version", - title: "期间", - }, - { - dataKey: "invbillNum", - title: "发票号", - }, - { - dataKey: "invGroupNum", - title: "发票分组号", - }, - { - dataKey: "lu", - title: "零件号", - }, - { - dataKey: "price", - title: "单价", - }, - { - dataKey: "qty", - title: "数量", - }, - { - dataKey: "amt", - title: "金额", - }, - { - dataKey: "bussiessType", - title: "业务分类", - }, - ]; - const columns3 = [ - { - dataKey: "version", - title: "期间", - }, - { - dataKey: "invGroupNum", - title: "发票分组号", - }, - { - dataKey: "settleGroupNum", - title: "结算分组号", - }, - { - dataKey: "lu", - title: "可结算分组号", - }, - { - dataKey: "lu1", - title: "不可结算分组号", - }, - ]; - const columns4 = [ - { - dataKey: "oldInvBillNum", - title: "作废发票号", - }, - { - dataKey: "invBillNum", - title: "发票号", - }, - { - dataKey: "settleDate", - title: "下线日期", - }, - { - dataKey: "invGroupNum", - title: "发票分组号", - }, - { - dataKey: "lu", - title: "零件号", - }, - { - dataKey: "pn", - title: "标识号", - }, - { - dataKey: "qty", - title: "数量", - }, - { - dataKey: "groupNum", - title: "结算分组", - }, - ]; - const columns5 = columns4.filter((o) => o.dataKey !== "oldInvBillNum" && o.dataKey !== "invGroupNum"); - columns5.unshift({ - input: "selection", - }); - // - const setupRef = ref(1); - const scrollRef = ref(null); - const adjListRef = ref(null); - const adjList = ref([]); - const showSetupDialog = () => { - adjList.value = []; - for (let i = 0; i < 10; i++) { - adjList.value.push({ invBillNum: i }); - } - setupRef.value = 1; - dialogVisible.value = true; - }; - const deleteAdj = () => { - const list = adjListRef.value.getSelection(); - if (list.length > 0) { - for (let i = 0; i < list.length; i++) { - adjList.value.splice(list[i] - i, 1); - } - nextTick(() => { - adjListRef.value.clearSelection(); - scrollRef.value.update(); - }); - } - }; - const adjSchema = { - type: "object", - properties: { - invBillNum: { - type: "string", - title: "发票号", - rules: [{ required: true }], - }, - settleDate: { - type: "string", - title: "下线日期", - input: "datetime", - rules: [{ required: true }], - }, - lu: { - type: "string", - title: "零件号", - rules: [{ required: true }], - }, - pn: { - type: "string", - title: "标识号", - rules: [{ required: true }], - }, - qty: { - type: "string", - title: "数量", - input: "number", - rules: [{ required: true }], - }, - groupNum: { - type: "string", - title: "结算分组", - rules: [{ required: true }], - }, - }, - }; - const defaultAdjModel = schemaToModel(adjSchema); - const adjModel = ref(Object.assign({}, defaultAdjModel)); - const addAdjFormRef = ref(null); - const showAddAdjDialog = () => { - adjModel.value = Object.assign({}, defaultAdjModel); - addDialogVisible.value = true; - }; - const addAdj = async () => { - try { - const valid = await addAdjFormRef.value.validate(); - if (valid) { - adjList.value.unshift(adjModel.value); - addDialogVisible.value = false; - } - } catch (error) { - console.log(error); - } - }; - const importAdjFromRef = ref(null); - const importAdjSchema = { - type: "object", - properties: { - files: { - title: "文件", - type: "array", - multiple: true, - input: "file", - accept: ".xlsx", - default: [], - limit: 1, - size: 100 * 1024 * 1024, - rules: [ - { - required: true, - trigger: "change", - }, - ], - }, - }, - }; - const defaultImportAdjModel = schemaToModel(importAdjSchema); - const importAdjModel = ref(defaultImportAdjModel); - const showImportAdjDialog = async () => { - importAdjModel.value = Object.assign({}, defaultImportAdjModel); - importDialogVisible.value = true; - }; - const importAdj = async () => { - try { - const valid = await importAdjFromRef.value.validate(); - if (valid) { - loading.value = true; - const url = "settleaccount/vmi/excel-to-json"; - const formData = new FormData(); - formData.append("files", importAdjModel.value.files[0].raw); - const result = await request(url, formData); - if (!result.errors) { - adjList.value = result.data; - importDialogVisible.value = false; - } - } - } catch (error) { - console.log(error); - } finally { - loading.value = false; - } - }; - return { - config, - onCommand, - drawer, - loading, - model, - columns1, - columns2, - columns3, - columns4, - columns4, - columns5, - addDialogVisible, - dialogVisible, - prop, - invoiceValue, - importDialogVisible, - openImportHandler, - setupRef, - showSetupDialog, - adjList, - adjListRef, - deleteAdj, - showAddAdjDialog, - addAdj, - addAdjFormRef, - importAdjFromRef, - adjSchema, - adjModel, - showImportAdjDialog, - importAdjModel, - importAdjSchema, - importAdj, - scrollRef, + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; + console.log(item.path, item, rows); }; + return { config, onCommand, visable, data }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_service.js index 55a02496..26f8e4f3 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_service.js @@ -1,16 +1,23 @@ import AppList from "../../../components/list/index.js"; import html from "html"; -import useConfig from "../../../models/jis-bbac/settlement/bbac_ba_service.js"; +import { ref } from "vue"; +import useConfig from "../../../models/pub_ba_service.js"; +import AppCheck from "../../_check.js"; export default { - components: { AppList }, - template: html``, + components: { AppList, AppCheck }, + template: html` + `, setup() { const config = useConfig(); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; console.log(item.path, item, rows); }; config.query.schema.properties.businessType.default = "JisBBAC"; - return { config, onCommand }; + return { config, onCommand, visable, data }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_service.js index a6cecca7..4acd8f80 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_service.js @@ -1,16 +1,23 @@ import AppList from "../../../components/list/index.js"; import html from "html"; -import useConfig from "../../../models/jis-hbpo/settlement/hbpo_ba_service.js"; +import { ref } from "vue"; +import useConfig from "../../../models/pub_ba_service.js"; +import AppCheck from "../../_check.js"; export default { - components: { AppList }, - template: html``, + components: { AppList, AppCheck }, + template: html` + `, setup() { const config = useConfig(); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; console.log(item.path, item, rows); }; config.query.schema.properties.businessType.default = "JisHBPO"; - return { config, onCommand }; + return { config, onCommand, visable, data }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_service.js index ba1c9850..c66aaa62 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_service.js @@ -1,16 +1,23 @@ import AppList from "../../../../components/list/index.js"; import html from "html"; +import { ref } from "vue"; import useConfig from "../../../../models/pub_ba_service.js"; +import AppCheck from "../../../_check.js"; export default { - components: { AppList }, - template: html``, + components: { AppList, AppCheck }, + template: html` + `, setup() { const config = useConfig(); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; console.log(item.path, item, rows); }; config.query.schema.properties.businessType.default = "ZhiGongJianBBAC"; - return { config, onCommand }; + return { config, onCommand, visable, data }; }, -}; \ No newline at end of file +}; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_service.js index aa37a9bf..5d261fed 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_service.js @@ -1,16 +1,23 @@ import AppList from "../../../../components/list/index.js"; import html from "html"; +import { ref } from "vue"; import useConfig from "../../../../models/pub_ba_service.js"; +import AppCheck from "../../../_check.js"; export default { - components: { AppList }, - template: html``, + components: { AppList, AppCheck }, + template: html` + `, setup() { const config = useConfig(); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; console.log(item.path, item, rows); }; config.query.schema.properties.businessType.default = "ZhiGongJianHBPO"; - return { config, onCommand }; + return { config, onCommand, visable, data }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_service.js index 671cdd3c..29ecd5fb 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_service.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_service.js @@ -1,16 +1,23 @@ import AppList from "../../../../components/list/index.js"; import html from "html"; +import { ref } from "vue"; import useConfig from "../../../../models/pub_ba_service.js"; +import AppCheck from "../../../_check.js"; export default { - components: { AppList }, - template: html``, + components: { AppList, AppCheck }, + template: html` + `, setup() { const config = useConfig(); + const visable = ref(false); + const data = ref(null); const onCommand = async (item, rows) => { + data.value = { [item.path]: rows[0][item.path] }; + visable.value = true; console.log(item.path, item, rows); }; config.query.schema.properties.businessType.default = "MaiDanJianHBPO"; - return { config, onCommand }; + return { config, onCommand, visable, data }; }, }; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index 71fc0975..20b9677e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -360,42 +360,6 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran }).ConfigureAwait(false); } - ///// - ///// 库存事务回滚 - ///// - //[NonAction] - //[UnitOfWork] - //public async Task UnDo(string groupId) - //{ - // var logList = this._logRepository.Where(o => o.GroupId == groupId).AsNoTracking().OrderBy(o => o.ChangedTime); - // foreach (var item in logList) - // { - // var balance = this._balanceRepository.FirstOrDefault(o => o.BillType == item.BillType && - // o.PartCode == item.PartCode && - // o.VinCode == item.VinCode && - // o.ErpToLoc == item.ErpToLoc && - // o.OrderNum == item.OrderNum); - // if (balance == null) - // { - // balance = new VmiBalance(GuidGenerator.Create()); - // balance.InjectFrom(item); - // await _balanceRepository.InsertAsync(balance).ConfigureAwait(false); - // } - // else - // { - // balance.Qty += item.ChangedQty; - // this._balanceRepository.UpdateAsync(balance).Wait(); - // } - // var log = new VmiLog(); - // log.InjectFrom(item); - // log.LogType = VmiLogType.Type300; - // log.ChangedType = VmiType.In; - // log.ChangedTime = DateTime.Now; - // log.ChangedBy = _currentUser.UserName; - // await _logRepository.InsertAsync(log).ConfigureAwait(false); - // } - //} - /// /// 库存余额查询 /// @@ -491,6 +455,47 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran return new PagedResultDto(count, entities); } + /// + /// 人工调整 + /// + /// + /// + [HttpPost] + public async Task EditBalance(VmiLog log) + { + if (log.Qty >= decimal.Zero) + { + log.LogType = VmiLogType.Type500; + log.ChangedType = VmiType.In; + var data = new VmiBalance(); + data.InjectFrom(log); + await In(VmiLogType.Type500, null, data).ConfigureAwait(false); + } + else + { + log.LogType = VmiLogType.Type600; + log.ChangedType = VmiType.Out; + log.Qty = -log.Qty; + await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false); + } + } + + /// + /// 库存调整导入 + /// + /// + [HttpPost] + public async Task Import(List files) + { + using var ms = new MemoryStream(); + await files.FirstOrDefault().OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); + var list = this.ImportInternal(ms.ToArray()); + foreach (var file in list) + { + await EditBalance(file).ConfigureAwait(false); + } + } + /// /// 快照列表 /// @@ -537,31 +542,6 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran return fileName; } - /// - /// 人工调整 - /// - /// - /// - [HttpPost] - public async Task EditBalance(VmiLog log) - { - if (log.Qty >= decimal.Zero) - { - log.LogType = VmiLogType.Type500; - log.ChangedType = VmiType.In; - var data = new VmiBalance(); - data.InjectFrom(log); - await In(VmiLogType.Type500, null, data).ConfigureAwait(false); - } - else - { - log.LogType = VmiLogType.Type600; - log.ChangedType = VmiType.Out; - log.Qty = -log.Qty; - await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false); - } - } - private byte[] GetContent(List entities, string name = "sheet1") { using var workbook = new XLWorkbook();