Browse Source

update

master
wanggang 1 year ago
parent
commit
7ca70388e3
  1. 20
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js
  2. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html
  3. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js
  4. 25
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/_options.js
  5. 145
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/adjust.js
  6. 139
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/backup.js
  7. 123
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance.js
  8. 145
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js
  9. 128
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/vmi.js
  10. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
  11. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  12. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/index.js
  13. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/login.js
  14. 22
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
  15. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
  16. 27
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js
  17. 17
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/adjust.js
  18. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/backup.js
  19. 17
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance.js
  20. 33
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/log.js

20
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js

@ -2,13 +2,16 @@ import html from "html";
import { ElConfigProvider } from "element-plus";
import zh from "./lib/element-plus/locale/zh-cn.min.mjs";
import en from "./lib/element-plus/locale/en.min.mjs";
import { reactive, onMounted } from "vue";
import { reactive, onMounted, onUnmounted } from "vue";
import { ElNotification } from "element-plus";
import { dayjs } from "element-plus";
export default {
components: { ElConfigProvider },
template: html`
<el-config-provider :locale="localeMap.get($i18n.locale)">
<router-view></router-view>
<el-popconfirm title="服务端已更新,是否刷新?"> </el-popconfirm>
</el-config-provider>
`,
setup() {
@ -18,7 +21,20 @@ export default {
["en", en],
])
);
onMounted(() => document.querySelector("#loading.loading").classList.remove("loading"));
const event = "Refresh";
onMounted(() => {
document.querySelector("#loading.loading").classList.remove("loading");
PubSub.subscribe(event, async () => {
await ElNotification.closeAll();
ElNotification({
type: "warning",
title: `${dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")}`,
dangerouslyUseHTMLString: true,
message: `<a href="javascript:location.reload(true)">站点已更新,点击刷新!</a>`,
});
});
});
onUnmounted(() => PubSub.unsubscribe(event));
return {
localeMap,
};

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html

@ -4,6 +4,9 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<base href="/" />
<style>
@keyframes loading-rotate {

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js

@ -2,12 +2,12 @@ import html from "html";
import { useAppStore } from "../store/index.js";
export default {
template: html`<router-link to="/" class="logo">
template: html`<a href="javascript:location.reload(true)" class="logo">
<div class="flex h-full items-center">
<img src="/assets/logo.svg" />
<h1 v-if="!appStore.isMenuCollapse">{{$t('application')}}</h1>
</div>
</router-link>`,
</a>`,
setup() {
const appStore = useAppStore();
return {

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

@ -129,5 +129,28 @@ const billState = {
],
};
const codeType = {
title: "生产码类型",
type: "string",
input: "select",
options: [
{ value: "01", label: "前保" },
{ value: "02", label: "后保" },
{ value: "03", label: " 左门槛" },
{ value: "04", label: "右门槛" },
{ value: "05", label: "扰流板" },
{ value: "06", label: "前左轮眉" },
{ value: "07", label: "前右轮眉 " },
{ value: "08", label: "后左轮眉" },
{ value: "09", label: "后右轮眉" },
],
clearable: true,
rules: [
{
required: true,
},
],
};
export default businessType;
export { version, state, state2, state3, transType, deliverBillType, deliverSubBillType, proType, billState };
export { version, state, state2, state3, transType, deliverBillType, deliverSubBillType, proType, billState, codeType };

145
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/adjust.js

@ -0,0 +1,145 @@
import { useLogSchema } from "./vmi.js";
const schema = useLogSchema();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/log`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = "settleaccount/vmi/edit-balance";
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/import`;
const exportUrl = `${baseUrl}/export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
type: "object",
properties: {
logTypes: { type: "array", hidden: true, default: ["Type500", "Type600"] },
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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "orderNum",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billTime",
action: "biggerThanOrEqual",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billTime",
action: "smallThanOrEqual",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

139
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/backup.js

@ -0,0 +1,139 @@
import useSchema from "./vmi.js";
const schema = useSchema();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/backup`;
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 exportUrl = `${baseUrl}/backup-export`;
const invokeUrl = "settleaccount/vmi/invoke";
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
const invokeMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
autoSubmit: true,
disableQueryOnLoad: true,
schema: {
title: "时点库存余额查询",
type: "object",
properties: {
name: {
title: "时间",
type: "string",
input: "select",
url: "settleaccount/vmi/snapshot",
value: "name",
label: "name",
defaultSelected: true,
clearable: false,
},
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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
invokeUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
invokeMethod,
schema: schema,
},
};
}

123
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance.js

@ -0,0 +1,123 @@
import useSchema from "./vmi.js";
const schema = useSchema();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/balance`;
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 exportUrl = `${baseUrl}/balance-export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

145
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js

@ -0,0 +1,145 @@
import { useLogSchema } from "./vmi.js";
const schema = useLogSchema();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/log`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/log-import`;
const exportUrl = `${baseUrl}/log-export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
type: "object",
properties: {
// logTypes: { type: "array", hidden: true, default: ["Type200", "Type400"] },
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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "orderNum",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billTime",
action: "biggerThanOrEqual",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billTime",
action: "smallThanOrEqual",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

128
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/vmi.js

@ -0,0 +1,128 @@
import { deliverBillType, deliverSubBillType, codeType } from "../_options.js";
function useSchema() {
return {
title: "寄售库存",
type: "object",
properties: {
partCode: {
title: "LU零件号",
type: "string",
},
customerPartCode: {
title: "客户零件号",
type: "string",
},
codeType,
billType: deliverBillType,
qty: {
title: "数量",
type: "string",
},
billTime: {
title: "发运日期",
type: "string",
input: "datetime",
},
deliverTime: {
title: "订单日期",
type: "string",
input: "datetime",
},
erpToLoc: {
title: "ERP库位",
type: "string",
},
seq: {
title: "EDI顺序号",
type: "string",
},
orderNum: {
title: "客户订单号",
type: "string",
},
uniqueCode: {
title: "塑件唯一码",
type: "string",
},
matchNumber: {
title: "EDI总成号",
type: "string",
},
pjsNum: {
title: "PJIS生产顺序号",
type: "string",
},
reMark: {
title: "备注",
type: "string",
},
configcode: {
title: "配置码",
type: "string",
},
factory: {
title: "工厂",
type: "string",
},
subBillType: deliverSubBillType,
realCode: {
title: "WMS实发生产码",
type: "string",
},
vinCode: {
title: "EDI订单生产码",
type: "string",
},
settlementVinCode: {
title: "结算生产码",
type: "string",
},
},
};
}
function useLogSchema() {
return Object.assign(
{
changedNumber: {
title: "变动单号",
type: "string",
},
changedTime: {
title: "变动时间",
type: "string",
input: "datetime",
},
changedType: {
title: "变动类型",
type: "string",
input: "select",
options: [
{
value: 0,
label: "入库",
value: 1,
label: "出库",
},
],
},
changedBy: {
title: "变动人",
type: "string",
},
partCode2: {
title: "结算厂内零件号",
type: "string",
},
settlementVinCode: {
title: "结算生产码",
type: "string",
},
},
useSchema()
);
}
export default useSchema;
export { useLogSchema };

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

@ -91,15 +91,15 @@ async function request(url, data, options, notify = false) {
await addToken(defaultOptions);
const response = await fetch(url, defaultOptions);
const result = await getResult(response);
if (result.data?.code && result.data.code !== 200) {
result.errors = result.data.message ?? result.data.code;
}
if (!result.errors && notify && (!result.data?.code || result.data.code === 200)) {
ElMessage({
type: "success",
message: "操作成功",
});
}
if (result.data?.code && result.data.code !== 200) {
result.errors = result.data.message;
}
return result;
}

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

@ -333,7 +333,7 @@ export default [
children: [
{
...createPage("finance", `title=财务审核`),
component: "/settle/finance",
component: "/settle/vmi",
children: [
createButton("query", "title=查询&isTop=true"),
createButton("import", "title=导入开票文件&isTop=true"),

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/index.js

@ -119,7 +119,9 @@ const refreshRouter = async () => {
});
};
setPermission(serverRoutes);
router.removeRoute("layout");
if (router.hasRoute("layout")) {
router.removeRoute("layout");
}
const layout = {
name: "layout",
path: "/",

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

@ -20,7 +20,7 @@ export default {
<layout-locale />
</div>
<el-card class="box-card" style="width:400px;">
<app-form :schema="schema" v-model="model" :action="action" @submit="submit">
<app-form :schema="schema" v-model="model" @submit="submit">
<template #submitText>{{$t('login')}}</template>
</app-form>
</el-card>

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

@ -2,9 +2,9 @@ import AppList from "../../components/list/index.js";
import html from "html";
import { ref } from "vue";
import { useRoute } from "vue-router";
import { ElMessageBox } from "element-plus";
import useConfig from "../../models/settle/detail.js";
import request from "../../request/index.js";
import request, { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus";
export default {
components: { AppList },
@ -18,7 +18,23 @@ export default {
const url = config.edit.addUrl;
if (item.path === "add") {
const data = appListRef.value.buildQuery();
await appListRef.value.onClick(() => request(url, data, { method: "POST" }, true), `确认是否对所有符合查询条件的数据生成可结算单?`, true);
await appListRef.value.onClick(
async () => {
const result = await request(url, data, { method: "POST" }, true);
if (result.errors) {
if (result.data.code === 400 && result.data.fileName) {
ElMessage({
type: "warnning",
message: "操作失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
console.log(result);
}
},
`确认是否对所有符合查询条件的数据生成可结算单?`,
true
);
}
};
return { appListRef, config, onCommand };

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

@ -2,7 +2,6 @@ import AppList from "../../components/list/index.js";
import html from "html";
import { ref } from "vue";
import { useRoute } from "vue-router";
import { ElMessageBox } from "element-plus";
import useConfig from "../../models/settle/usable.js";
import request from "../../request/index.js";

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

@ -4,7 +4,6 @@ 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 },
@ -17,31 +16,7 @@ export default {
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);
console.log(item.path, item, rows);
};
return { appListRef, config, onCommand, visable, data };
},

17
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/adjust.js

@ -1,15 +1,2 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/inventory/adjust.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 };
},
};
import useList from "../_list.js";
export default useList("vmi/adjust");

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

@ -1,6 +1,6 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/inventory/backup.js";
import useConfig from "../../../models/vmi/backup.js";
export default {
components: { AppList },

17
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance.js

@ -1,15 +1,2 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/inventory/balance.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 };
},
};
import useList from "../_list.js";
export default useList("vmi/balance");

33
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/log.js

@ -1,6 +1,6 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/inventory/log.js";
import useConfig from "../../../models/vmi/log.js";
import { ref } from "vue";
import { schemaToModel } from "../../utils/index.js";
import AppForm from "../../../components/form/index.js";
@ -10,16 +10,18 @@ import request, { getUrl } from "../../request/index.js";
export default {
components: { AppList, AppTable, AppForm },
template: html`
<app-list :config="config" @command="onCommand" />
<el-dialog v-model="addDialogVisible" align-center :close-on-click-modal="false" destroy-on-close style="width:380px;height:480px;">
<app-list ref="appListRef" :config="config" @command="onCommand" />
<el-dialog v-model="addDialogVisible" align-center :close-on-click-modal="false" destroy-on-close style="width:380px;">
<template #header>补货数据导出</template>
<el-scrollbar>
<el-row>
<el-col>
<app-form ref="addAdjFormRef" v-if="addDialogVisible && adjModel" :schema="adjSchema" v-model="adjModel" :hideButton="true" inline @submit="submitAdj" />
</el-col>
</el-row>
</el-scrollbar>
<div v-loading="loading" style="height:100%;">
<el-scrollbar style="height:calc(100% - -120px);">
<el-row>
<el-col>
<app-form ref="addAdjFormRef" v-if="addDialogVisible && adjModel" :schema="adjSchema" v-model="adjModel" :hideButton="true" inline @submit="submitAdj" />
</el-col>
</el-row>
</el-scrollbar>
</div>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitAdj">确定</el-button>
@ -28,18 +30,25 @@ export default {
</el-dialog>
`,
setup() {
const appListRef = ref(false);
const loading = ref(false);
const addDialogVisible = ref(false);
const addAdjFormRef = ref(null);
const submitAdj = async () => {
try {
const valid = await addAdjFormRef.value.validate();
loading.value = true;
const url = "settleaccount/vmi/replenished-export";
const method = "POST";
const response = await request(url, null, { method });
const response = await request(url, adjModel.value, { method }, true);
if (!response.errors) {
addDialogVisible.value = false;
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
} catch (error) {
console.log(error);
} finally {
loading.value = false;
}
};
const adjSchema = {
@ -71,6 +80,8 @@ export default {
console.log(item.path, item, rows);
};
return {
appListRef,
loading,
config,
onCommand,
submitAdj,

Loading…
Cancel
Save