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. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js
  6. 42
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/version.js
  7. 5
      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. 33
      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. 17
      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 = {
title: "通用代码",
type: "object",
disableSelection: true,
properties: {
settleBillNum: {
title: "关联结算单号",

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

@ -54,6 +54,7 @@ async function getResult(response) {
try {
result.errors = await response.json();
} catch (error) {
result.errors = error;
console.log(error);
}
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 = "寄售库库存扣减审批") {
return {
...createPage(path, `title=${title}&businessType=${business}&client=${client}`),
component: "/settle/finance",
component: "/settle/vmi",
children: [
createButton("query", "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 };
},
};

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js

@ -12,8 +12,10 @@ export default {
const config = useConfig();
const onCommand = async (item, rows) => {
if (item.path === "reset-password") {
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);
if (rows.length) {
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);
}
}
};
return { appListRef, config, onCommand };

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

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

@ -64,7 +64,10 @@ export default function (type) {
delete data["downLineDateTime"];
const result = await request(url, data, { method: "POST" }, true);
if (!result.errors) {
dialogVisable.value = false;
if (!result.data?.code || result.data.code === 200) {
dialogVisable.value = false;
await load();
}
}
} catch (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 businessType = route.meta.businessType;
const config = useConfig(businessType);
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
const onCommand = async (item) => {
if (item.path === "sync") {
const url = config.edit.syncUrl;
const method = config.edit.syncMethod;

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

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

@ -14,22 +14,11 @@ export default {
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "unable");
const onCommand = async (item, rows) => {
const onCommand = async (item) => {
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;
}
const data = appListRef.value.buildQuery();
await appListRef.value.onClick(() => request(url, data, { method: "POST" }, true), `确认是否对所有符合查询条件的数据生成可结算单?`, true);
}
};
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;
if (item.path === "add") {
const invbillNum = rows[0].billNum;
try {
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;
}
await appListRef.value.onClick(async () => await request(url, { invbillNum }, { method: "POST" }, true), `确认为${invbillNum}创建发票?`, true);
}
};
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