学 赵 1 year ago
parent
commit
eb77473570
  1. 34
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
  3. 19
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/role.js
  4. 43
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js
  5. 41
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

34
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -812,6 +812,39 @@ export default {
} }
return postData; return postData;
} }
const action = async (method, confirMmessage = "确认操作吗?", successMessage = "操作成功", reload = true) => {
try {
await ElMessageBox.confirm(confirMmessage, "提示", {
type: "warning",
});
tableLoading.value = true;
let result = null;
if (method.constructor.name == "AsyncFunction") {
result = await method();
} else {
result = method();
}
if (!result.errors) {
await ElMessage({
type: "info",
message: successMessage,
});
if (reload) {
pageModel.pageIndex = 1;
await load();
}
}
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
} finally {
tableLoading.value = false;
}
};
onMounted(async () => { onMounted(async () => {
if (route.meta.children?.length) { if (route.meta.children?.length) {
for (const item of route.meta.children) { for (const item of route.meta.children) {
@ -833,6 +866,7 @@ export default {
}); });
return { return {
load, load,
action,
config, config,
queryModel, queryModel,
buildQuery, buildQuery,

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js

@ -11,7 +11,7 @@ export default [
createButton("create", "title=新建&isTop=true"), createButton("create", "title=新建&isTop=true"),
createButton("update", "title=编辑"), createButton("update", "title=编辑"),
createButton("delete", "title=删除&disabled=o=>o.userName==='admin'"), createButton("delete", "title=删除&disabled=o=>o.userName==='admin'"),
createButton("%s/reset-password", "title=重置密码&method=PUT"), createButton("reset-password", "title=重置密码&method=PUT"),
], ],
}, },
{ {

19
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/role.js

@ -1,17 +1,2 @@
import AppList from "../../components/list/index.js"; import useList from "../_list.js";
import html from "html"; export default useList("base-data/role");
import useConfig from "../../models/base-data/role.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
// 变量定义
const config = useConfig();
// 函数定义
const onCommand = (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

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

@ -2,45 +2,24 @@ import AppList from "../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../models/base-data/user.js"; import useConfig from "../../models/base-data/user.js";
import request from "../../request/index.js"; import request from "../../request/index.js";
import { format } from "../../utils/index.js"; import { ref } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
export default { export default {
components: { AppList }, components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() { setup() {
const appListRef = ref(null);
const config = useConfig(); const config = useConfig();
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); if (item.path === "reset-password") {
if (item.path === "%s/reset-password") { const url = `base/user/${rows[0].id}/${item.path}`;
const url = format(item.path, rows[0].id); await appListRef.value.action(
await request(`base/user/${url}`, null, { method: item.meta.method }); async () => await request(url, null, { method: item.meta.method }),
try { `是否重置用户${rows[0].userName}密码`,
await ElMessageBox.confirm(format("是否重置用户%s密码", rows[0].userName), "提示", { `${rows[0].userName}密码已经重置为123456`
type: "warning", );
});
await ElMessage({
type: "info",
message: "密码已经成功重置为123456",
});
const url = `${config.baseUrl}/${item.path}`;
await request(
url,
rows.map((o) => o.id),
{ method: "POST" }
);
console.log(context);
await load();
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
}
} }
}; };
return { config, onCommand }; return { appListRef, config, onCommand };
}, },
}; };

41
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

@ -50,7 +50,7 @@ export default {
<el-step title="发票明细对比" /> <el-step title="发票明细对比" />
<el-step title="发票预览" /> <el-step title="发票预览" />
</el-steps> </el-steps>
<div v-show="setupRef===1" style="height:100%;"> <div class="setup1" v-show="setupRef===1" style="height:calc(100% - 120px);">
<el-row style="padding:14px 0;height:60px;"> <el-row style="padding:14px 0;height:60px;">
<el-col> <el-col>
<el-button type="primary" @click="showAddAdjDialog">新建</el-button> <el-button type="primary" @click="showAddAdjDialog">新建</el-button>
@ -60,27 +60,25 @@ export default {
</el-row> </el-row>
<el-scrollbar ref="scrollRef"> <el-scrollbar ref="scrollRef">
<el-row style="height:100%;"> <el-row style="height:100%;">
<el-col style="height:calc(100% - 180px);"> <el-col style="height:calc(100% - 60px);">
<app-table ref="adjListRef" :data="adjList" :columns="columns5" /> <app-table ref="adjListRef" :data="adjList" :columns="columns5" />
</el-col> </el-col>
</el-row> </el-row>
</el-scrollbar> </el-scrollbar>
</div> </div>
<div v-show="setupRef===2" style="height:100%;"> <div class="setup2" v-show="setupRef===2" style="height:calc(100% - 60px);background:#ebeef5;">
<el-row style="padding:14px 0;height:60px;"> <el-row style="width:100%;height:100%;padding:10px;">
<el-col> <el-col :span="12" style="height:100%;padding:0 5px 0 0;">
<el-button type="primary" @click="showAddAdjDialog">新建</el-button> <el-scrollbar>
<el-button type="primary" @click="showImportAdjDialog">导入</el-button> <app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" />
<el-button type="primary" @click="deleteAdj">删除</el-button> </el-scrollbar>
</el-col>
<el-col :span="12" style="height:100%;padding:0 0 0 5px;">
<el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" />
</el-scrollbar>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar ref="scrollRef">
<el-row style="height:100%;">
<el-col style="height:calc(100% - 180px);">
<app-table ref="adjListRef" :data="adjList" :columns="columns5" />
</el-col>
</el-row>
</el-scrollbar>
</div> </div>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
@ -107,7 +105,7 @@ export default {
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog style="width:380px;height:480px;" align-center destroy-on-close :close-on-click-modal="false" v-model="importDialogVisible"> <el-dialog style="width:480px;height:480px;" align-center destroy-on-close :close-on-click-modal="false" v-model="importDialogVisible">
<template #header>导入调整明细</template> <template #header>导入调整明细</template>
<el-scrollbar> <el-scrollbar>
<el-row v-loading="loading"> <el-row v-loading="loading">
@ -139,10 +137,11 @@ export default {
.el-dialog__body { .el-dialog__body {
height: calc(100% - 120px); height: calc(100% - 120px);
} }
/*
.re-open .el-scrollbar, .re-open .el-scrollbar,
.re-open .el-scrollbar__view { .re-open .el-scrollbar__view {
height: calc(100% - 120px); height: calc(100% - 120px);
} } */
</style>`, </style>`,
props: ["modelValue", "data", "isBusiness"], props: ["modelValue", "data", "isBusiness"],
emit: ["update:modelValue"], emit: ["update:modelValue"],
@ -361,6 +360,9 @@ export default {
if (valid) { if (valid) {
adjList.value.unshift(adjModel.value); adjList.value.unshift(adjModel.value);
addDialogVisible.value = false; addDialogVisible.value = false;
nextTick(() => {
scrollRef.value.update();
});
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
@ -406,6 +408,9 @@ export default {
if (!result.errors) { if (!result.errors) {
adjList.value = result.data; adjList.value = result.data;
importDialogVisible.value = false; importDialogVisible.value = false;
nextTick(() => {
scrollRef.value.update();
});
} }
} }
} catch (error) { } catch (error) {
@ -431,7 +436,7 @@ export default {
console.log(e); console.log(e);
} }
} else { } else {
setupRef += 1; setupRef.value += 1;
} }
}; };
const submitReOpen = async () => {}; const submitReOpen = async () => {};

Loading…
Cancel
Save