学 赵 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. 41
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js
  5. 39
      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;
}
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 () => {
if (route.meta.children?.length) {
for (const item of route.meta.children) {
@ -833,6 +866,7 @@ export default {
});
return {
load,
action,
config,
queryModel,
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("update", "title=编辑"),
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 html from "html";
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 };
},
};
import useList from "../_list.js";
export default useList("base-data/role");

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

39
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-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-col>
<el-button type="primary" @click="showAddAdjDialog">新建</el-button>
@ -60,27 +60,25 @@ export default {
</el-row>
<el-scrollbar ref="scrollRef">
<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" />
</el-col>
</el-row>
</el-scrollbar>
</div>
<div v-show="setupRef===2" style="height:100%;">
<el-row style="padding:14px 0;height:60px;">
<el-col>
<el-button type="primary" @click="showAddAdjDialog">新建</el-button>
<el-button type="primary" @click="showImportAdjDialog">导入</el-button>
<el-button type="primary" @click="deleteAdj">删除</el-button>
<div class="setup2" v-show="setupRef===2" style="height:calc(100% - 60px);background:#ebeef5;">
<el-row style="width:100%;height:100%;padding:10px;">
<el-col :span="12" style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" />
</el-scrollbar>
</el-col>
</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 :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-row>
</el-scrollbar>
</div>
<template #footer>
<span class="dialog-footer">
@ -107,7 +105,7 @@ export default {
</span>
</template>
</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>
<el-scrollbar>
<el-row v-loading="loading">
@ -139,10 +137,11 @@ export default {
.el-dialog__body {
height: calc(100% - 120px);
}
/*
.re-open .el-scrollbar,
.re-open .el-scrollbar__view {
height: calc(100% - 120px);
}
} */
</style>`,
props: ["modelValue", "data", "isBusiness"],
emit: ["update:modelValue"],
@ -361,6 +360,9 @@ export default {
if (valid) {
adjList.value.unshift(adjModel.value);
addDialogVisible.value = false;
nextTick(() => {
scrollRef.value.update();
});
}
} catch (error) {
console.log(error);
@ -406,6 +408,9 @@ export default {
if (!result.errors) {
adjList.value = result.data;
importDialogVisible.value = false;
nextTick(() => {
scrollRef.value.update();
});
}
}
} catch (error) {
@ -431,7 +436,7 @@ export default {
console.log(e);
}
} else {
setupRef += 1;
setupRef.value += 1;
}
};
const submitReOpen = async () => {};

Loading…
Cancel
Save