Browse Source

update

master
wanggang 1 year ago
parent
commit
12c3045bd8
  1. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
  2. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
  3. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  4. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-log.js
  5. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js
  6. 34
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/version.js
  7. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/compare/_compare.js
  8. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/input/fa-yun.js
  9. 27
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  10. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
  11. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
  12. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
  13. 48
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js

@ -1,6 +1,7 @@
const schema = { const schema = {
title: "通用代码", title: "通用代码",
type: "object", type: "object",
disableSelection: true,
properties: { properties: {
settleBillNum: { settleBillNum: {
title: "关联结算单号", title: "关联结算单号",

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

@ -54,6 +54,7 @@ async function getResult(response) {
try { try {
result.errors = await response.json(); result.errors = await response.json();
} catch (error) { } catch (error) {
result.errors = error;
console.log(error); console.log(error);
} }
ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`); ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`);

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

@ -95,7 +95,7 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
function createVmiOutCheckList(path, business, client, title = "寄售库库存扣减审批") { function createVmiOutCheckList(path, business, client, title = "寄售库库存扣减审批") {
return { return {
...createPage(path, `title=${title}&businessType=${business}&client=${client}`), ...createPage(path, `title=${title}&businessType=${business}&client=${client}`),
component: "/settle/finance", component: "/settle/vmi",
children: [ children: [
createButton("query", "title=查询&isTop=true"), createButton("query", "title=查询&isTop=true"),
createButton("compare", "title=扣减审核通过&isTop=true"), createButton("compare", "title=扣减审核通过&isTop=true"),

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-log.js

@ -1,15 +0,0 @@
import AppList from "../../components/list/index.js";
import html from "html";
import useConfig from "../../models/base-data/job-log.js";
export default {
components: { AppList },
template: html`<app-list :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/base-data/user.js

@ -12,9 +12,11 @@ export default {
const config = useConfig(); const config = useConfig();
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
if (item.path === "reset-password") { if (item.path === "reset-password") {
if (rows.length) {
const url = `base/user/${rows[0].id}/${item.path}`; const url = `base/user/${rows[0].id}/${item.path}`;
await appListRef.value.onClick(async () => await request(url, null, { method: item.meta.method }, true), `是否重置用户${rows[0].userName}密码?`, false); await appListRef.value.onClick(async () => await request(url, null, { method: item.meta.method }, true), `是否重置用户${rows[0].userName}密码?`, false);
} }
}
}; };
return { appListRef, config, onCommand }; return { appListRef, config, onCommand };
}, },

34
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/version.js

@ -3,37 +3,29 @@ import { ref } from "vue";
import request from "../../request/index.js"; import request from "../../request/index.js";
import AppList from "../../components/list/index.js"; import AppList from "../../components/list/index.js";
import useConfig from "../../models/base-data/version.js"; import useConfig from "../../models/base-data/version.js";
import { ElMessage, ElMessageBox } from "element-plus";
export default { export default {
components: { AppList }, components: { AppList },
template: html`<app-list ref="listRef" :config="config" @command="onCommand" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup(props, context) { setup() {
const listRef = ref(null); const appListRef = ref(null);
const config = useConfig(); const config = useConfig();
const onCommand = async (item, rows, load) => { const onCommand = async (item, rows) => {
if (item.path === "open-version" || item.path === "closed-version") {
try {
await ElMessageBox.confirm(`确认${item.path === "open-version" ? "启用" : "停用"}选中的${rows.length}行数据吗?`, "提示", {
type: "warning",
});
const url = `${config.baseUrl}/${item.path}`; const url = `${config.baseUrl}/${item.path}`;
if (item.path === "open-version" || item.path === "closed-version") {
await appListRef.value.onClick(
async () =>
await request( await request(
url, url,
rows.map((o) => o.id), rows.map((o) => o.id),
{ method: "POST" } { method: "POST" },
true
),
`确认${item.path === "open-version" ? "启用" : "停用"}选中的${rows.length}行数据吗?`,
true
); );
await load();
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
}
} }
}; };
return { config, onCommand }; return { appListRef, config, onCommand };
}, },
}; };

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/compare/_compare.js

@ -64,7 +64,10 @@ export default function (type) {
delete data["downLineDateTime"]; delete data["downLineDateTime"];
const result = await request(url, data, { method: "POST" }, true); const result = await request(url, data, { method: "POST" }, true);
if (!result.errors) { if (!result.errors) {
if (!result.data?.code || result.data.code === 200) {
dialogVisable.value = false; dialogVisable.value = false;
await load();
}
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/input/fa-yun.js

@ -13,8 +13,7 @@ export default {
const route = useRoute(); const route = useRoute();
const businessType = route.meta.businessType; const businessType = route.meta.businessType;
const config = useConfig(businessType); const config = useConfig(businessType);
const onCommand = async (item, rows) => { const onCommand = async (item) => {
console.log(item.path, item, rows);
if (item.path === "sync") { if (item.path === "sync") {
const url = config.edit.syncUrl; const url = config.edit.syncUrl;
const method = config.edit.syncMethod; const method = config.edit.syncMethod;

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

@ -2,8 +2,7 @@ import AppList from "../../components/list/index.js";
import html from "html"; import html from "html";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { ref } from "vue"; import { ref } from "vue";
import { ElMessage, ElMessageBox } from "element-plus"; import request, { getUrl } from "../../request/index.js";
import request from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js"; import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js"; import AppCheck from "./_check.js";
@ -20,12 +19,7 @@ export default {
const config = useConfig(businessType, "shang-wu"); const config = useConfig(businessType, "shang-wu");
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
if (item.path === "approval" || item.path === "reject" || item.path === "receive") { if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
if (rows.length === 0) { if (rows.length > 0) {
ElMessage({
type: "warning",
message: "没有选中的数据",
});
} else {
const message = const message =
item.path === "approval" item.path === "approval"
? `确认审核通过选中的${rows.length}行数据吗?` ? `确认审核通过选中的${rows.length}行数据吗?`
@ -34,18 +28,7 @@ export default {
: `确认选中的${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 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; const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
try { await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
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 === "export-group") { } else if (item.path === "export-group") {
const url = config.edit.exportUrl; const url = config.edit.exportUrl;
@ -60,10 +43,12 @@ export default {
}, },
], ],
}; };
const response = await request(url, postData, { method }); await appListRef.value.onClick(async () => {
const response = await request(url, postData, { method }, true);
if (!response.errors) { if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
} }
});
} else if (item.path === "invbillNum" || item.path === "invGroupNum") { } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] }; data.value = { [item.path]: rows[0][item.path] };
visable.value = true; visable.value = true;

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

@ -1,44 +0,0 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
import request, { getUrl } from "../../request/index.js";
export default {
components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" />`,
setup() {
const visable = ref(false);
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 === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
const response = await request(url, postData, { method });
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
}
console.log(item.path, item, rows);
};
return { config, onCommand, visable, data };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js

@ -14,22 +14,11 @@ export default {
const route = useRoute(); const route = useRoute();
const businessType = route.meta.businessType; const businessType = route.meta.businessType;
const config = useConfig(businessType, "unable"); const config = useConfig(businessType, "unable");
const onCommand = async (item, rows) => { const onCommand = async (item) => {
const url = config.edit.addUrl; const url = config.edit.addUrl;
if (item.path === "add") { if (item.path === "add") {
try {
await ElMessageBox.confirm(`确认是否对所有符合查询条件的数据生成可结算单?`, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;
const data = appListRef.value.buildQuery(); const data = appListRef.value.buildQuery();
const result = request(url, data, { method: "POST" }); await appListRef.value.onClick(() => request(url, data, { method: "POST" }, true), `确认是否对所有符合查询条件的数据生成可结算单?`, true);
console.log(result);
} catch (e) {
console.log(e);
} finally {
appListRef.value.tableLoading = false;
}
} }
}; };
return { appListRef, config, onCommand }; return { appListRef, config, onCommand };

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

@ -18,21 +18,7 @@ export default {
const url = config.edit.addUrl; const url = config.edit.addUrl;
if (item.path === "add") { if (item.path === "add") {
const invbillNum = rows[0].billNum; const invbillNum = rows[0].billNum;
try { await appListRef.value.onClick(async () => await request(url, { invbillNum }, { method: "POST" }, true), `确认为${invbillNum}创建发票?`, true);
await ElMessageBox.confirm(`确认为${invbillNum}创建发票?`, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;
const result = request(url, { invbillNum }, { method: "POST" });
if (!result.errors) {
await appListRef.value.load();
}
console.log(result);
} catch (e) {
console.log(e);
} finally {
appListRef.value.tableLoading = false;
}
} }
}; };
return { appListRef, config, onCommand }; return { appListRef, config, onCommand };

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

@ -0,0 +1,48 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
import request, { getUrl } from "../../request/index.js";
export default {
components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" />`,
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, "cai-wu");
const onCommand = async (item, rows) => {
// if (item.path === "export-group") {
// const url = config.edit.exportUrl;
// const method = config.edit.exportMethod;
// const postData = {
// filters: [
// {
// logic: "and",
// column: "invGroupNum",
// action: "equal",
// value: rows[0]["invGroupNum"],
// },
// ],
// };
// const getUrl = getUrl;
// await appListRef.value.onClick(async () => {
// const response = await request(url, postData, { method });
// if (!response.errors) {
// window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
// }
// });
// } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
// data.value = { [item.path]: rows[0][item.path] };
// visable.value = true;
// }
// console.log(item.path, item, rows);
};
return { appListRef, config, onCommand, visable, data };
},
};
Loading…
Cancel
Save