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 ef2dc6d7..0ca4da42 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 @@ -227,12 +227,29 @@ export default { /> @@ -391,16 +408,22 @@ export default { const editFormTitle = ref(""); const editFormSchema = ref(null); const editFormModel = ref(null); - const exportModel = reactive({ - includeAll: false, - includeDeleted: false, - }); - const importModel = reactive({ - // partial: true, - // replace: false, + const defaultExportModel = { + version: "", + date1: "", + date2: "", + date3: "", + date4: "", + ln: "", + pn: "", + enumBusinessType: route.meta.enumBusinessType, + }; + const exportModel = ref(defaultExportModel); + const defaultImportModel = { factory: "", version: "", - }); + }; + const importModel = ref(defaultExportModel); const factories = ref([]); const versions = ref([]); const fileList = ref([]); @@ -550,7 +573,7 @@ export default { await load(); } else if (item.path === "export") { //export - if ((item.pattern = "paged")) { + if (item.pattern === "paged") { const url = config.edit.exportUrl; const method = config.edit.exportMethod; const postData = buildQuery(); @@ -558,13 +581,21 @@ export default { if (!response.errors) { window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); } - } else { - editFormTitle.value = `${t(item.path)}${querySchema.value?.title}`; + } else if (item.meta.isTop) { + exportModel.value = defaultExportModel; + versions.value = ( + await request("settleaccount/centralized-control/get-all", null, { method: "POST" }) + ).data.items.map((o) => ({ + value: o.version, + label: o.version, + })); + editFormTitle.value = `${t(item.path)}${config.query.schema.title}`; dialogVisible.value = true; } } else if (item.path === "import") { //import try { + importModel.value = Object.assign({}, defaultImportModel); editFormloading.value = true; editFormTitle.value = `${t(item.path)}${config.query.schema.title}`; fileList.value = []; @@ -624,20 +655,22 @@ export default { dialogVisible.value = false; editFormMode.value = null; } else if (editFormMode.value === "export") { - const postData = JSON.parse(JSON.stringify(queryModel.value)); - postData.filters = filterList.value.filter((o) => o.property && o.value); - delete postData.query["items"]; - delete postData.query["id"]; - const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`; - const response = await post(url, postData); - download(response); + // const postData = JSON.parse(JSON.stringify(queryModel.value)); + // postData.filters = filterList.value.filter((o) => o.property && o.value); + // delete postData.query["items"]; + // delete postData.query["id"]; + // const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`; + // const response = await post(url, postData); + // download(response); + const url = config.edit.exportUrl; + await request(url, exportModel.value, { method: config.edit.exportMethod }); dialogVisible.value = false; } else if (editFormMode.value === "import") { editFormloading.value = true; const url = config.edit.importUrl; const formData = new FormData(); - formData.append("version", importModel.version); - formData.append("factory", importModel.factory); + formData.append("version", importModel.value.version); + formData.append("factory", importModel.value.factory); for (let i = 0; i < fileList.value.length; i++) { formData.append(`files`, fileList.value[i].raw); } @@ -776,6 +809,13 @@ export default { } return postData; } + function isNotJit() { + return ( + route.meta.enumBusinessType !== "ZhiGongJian" || + route.meta.enumBusinessType !== "BeiJian" || + route.meta.enumBusinessType !== "YingDuJian" + ); + } onMounted(async () => { if (route.meta.children?.length) { for (const item of route.meta.children) { @@ -788,18 +828,6 @@ export default { queryModel.value = schemaToModel(config.query.schema); getSortModel(queryModel.value); filterList.value = queryModel.value?.filters ?? []; - //pushfilterList(); - // if (!querySchema.value) { - // const vm = (await get(indexUrl)).data; - // querySchema.value = vm.schema.properties.query; - // tableSchema.value = vm.schema.properties.items.items; - // data.value = vm.model ?? schemaToModel(vm.schema); - // if (props.query) { - // Object.assign(data.value.query, props.query); - // } - // getSortModel(data.value); - // getColumns(vm.schema.properties.query); - // } getColumns(config.table.schema); if (props.query) { Object.assign(queryModel.value.query, props.query); @@ -857,6 +885,7 @@ export default { versions, pushfilterList, getOperators, + isNotJit, }; }, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js index ab5483cf..d11dfac4 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js @@ -1,6 +1,8 @@ import html from "html"; import { defineAsyncComponent, reactive, watch } from "vue"; import { useRouter } from "vue-router"; +import { useAppStore } from "../store/index.js"; +import { ElMessageBox } from "element-plus"; export default { name: "menuItem", @@ -33,6 +35,7 @@ export default { }, }, setup(props, context) { + const appStore = useAppStore(); const router = useRouter(); const model = reactive(props.modelValue); watch( @@ -45,6 +48,11 @@ export default { // const click = (route) => { if (!route.meta.isExternal) { + // if (appStore.routes.length >= 10) { + // ElMessageBox.alert(`已经页签数量`, `提示`); + // } else { + // router.push(route.meta.path); + // } router.push(route.meta.path); } else { window.open(route.path);