fix: 修改桌台统计跳转订单页面展示效果,增加员工修改密码弹窗,修改店铺添加激活码为非必填

This commit is contained in:
YeMingfei666 2025-03-20 10:06:38 +08:00
parent d48199b991
commit b76e67c207
7 changed files with 114 additions and 10 deletions

View File

@ -41,10 +41,10 @@ const searchConfig: ISearchConfig = {
}, },
{ {
type: "input", type: "input",
label: "台桌编码", label: "台桌名称",
prop: "tableCode", prop: "tableName",
attrs: { attrs: {
placeholder: "请输入台桌编码", placeholder: "请输入台桌名称",
clearable: true, clearable: true,
style: { style: {
width: "200px", width: "200px",

View File

@ -154,9 +154,10 @@ function returnOriginAmount(order: OrderInfoVo) {
const route = useRoute(); const route = useRoute();
onMounted(() => { onMounted(() => {
const { orderNo, tableName, tableCode } = route.query; const { orderNo, tableName, tableCode } = route.query;
handleQueryClick({ orderNo, tableCode }); handleQueryClick({ orderNo, tableCode, tableName });
searchRef.value?.setQueryValue("orderNo", orderNo); searchRef.value?.setQueryValue("orderNo", orderNo);
searchRef.value?.setQueryValue("tableCode", tableCode); searchRef.value?.setQueryValue("tableName", tableName);
route;
}); });
// //

View File

@ -70,7 +70,7 @@
<el-radio-button value="release">正式</el-radio-button> <el-radio-button value="release">正式</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="激活码" prop="activateCode"> <el-form-item label="激活码">
<el-input v-model="state.form.activateCode" placeholder="请输入激活码"></el-input> <el-input v-model="state.form.activateCode" placeholder="请输入激活码"></el-input>
<div class="tips">输入有效激活码表示添加的同时直接激活该店铺</div> <div class="tips">输入有效激活码表示添加的同时直接激活该店铺</div>
</el-form-item> </el-form-item>

View File

@ -97,9 +97,12 @@
</el-table-column> </el-table-column>
<el-table-column prop="createdAt" label="到期时间"> <el-table-column prop="createdAt" label="到期时间">
<template v-slot="scope"> <template v-slot="scope">
{{ dayjs(scope.row.expireAt).format("YYYY-MM-DD HH:mm:ss") }} <span v-if="scope.row.expireTime">
{{ dayjs(scope.row.expireTime).format("YYYY-MM-DD HH:mm:ss") }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150"> <el-table-column label="操作" width="150">
<template v-slot="scope"> <template v-slot="scope">
<el-link @click="addShopShow(scope.row)"> <el-link @click="addShopShow(scope.row)">

View File

@ -0,0 +1,78 @@
<template>
<el-dialog title="修改密码" v-model="visible" width="400px" @close="reset">
<el-form :model="form" ref="refForm" :rules="rules">
<el-form-item label="新密码" prop="newPwd">
<el-input v-model="form.newPwd" show-password></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="confirmPwd">
<el-input v-model="form.confirmPwd" show-password></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submit">提交</el-button>
<el-button @click="reset">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script setup>
import sysUserApi from "@/api/account/sysUser";
const visible = ref(false);
const form = reactive({
oldPwd: "",
newPwd: "",
confirmPwd: "",
});
const rules = {
newPwd: [{ required: true, message: "请输入新密码", trigger: "blur" }],
confirmPwd: [
{ required: true, message: "请再次输入新密码", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value !== form.newPwd) {
callback(new Error("两次输入密码不一致"));
} else {
callback();
}
},
trigger: "blur",
},
],
};
const emit = defineEmits(["update:visible"]);
function reset() {
visible.value = false;
form.oldPwd = "";
form.newPwd = "";
form.confirmPwd = "";
form.id = "";
}
const refForm = ref();
function submit() {
refForm.value.validate((valid) => {
if (valid) {
sysUserApi
.pwd({
id: form.id,
checkPassword: form.confirmPwd,
password: form.confirmPwd,
})
.then(() => {
ElMessage.success("修改成功");
close();
});
}
});
}
function open(data) {
visible.value = true;
form.id = data.id;
}
function close() {
visible.value = false;
}
defineExpose({
open,
close,
});
</script>

View File

@ -2,7 +2,7 @@ import ShopStaffApi, { type getListRequest } from "@/api/account/shopStaff";
import type { PageShopStaff } from "@/api/account/shopStaff"; import type { PageShopStaff } from "@/api/account/shopStaff";
import type { IContentConfig } from "@/components/CURD/types"; import type { IContentConfig } from "@/components/CURD/types";
const contentConfig = { const contentConfig: IContentConfig = {
pageName: "sys:user", pageName: "sys:user",
table: { table: {
border: true, border: true,
@ -56,7 +56,15 @@ const contentConfig = {
align: "center", align: "center",
fixed: "right", fixed: "right",
templet: "tool", templet: "tool",
operat: ["edit", "delete"], operat: ["edit", "delete",
{
name: "change_pwd",
auth: "password:reset",
icon: "refresh-left",
text: "修改密码",
type: "primary",
}
],
}, },
], ],
}; };

View File

@ -66,10 +66,14 @@
></selectPermission> ></selectPermission>
</template> </template>
</page-modal> </page-modal>
<!-- 修改密码 -->
<changePwd ref="changePwdRef" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import changePwd from "./components/change-pwd.vue";
import type { IObject, IOperatData } from "@/components/CURD/types"; import type { IObject, IOperatData } from "@/components/CURD/types";
import usePage from "@/components/CURD/usePage"; import usePage from "@/components/CURD/usePage";
import addModalConfig from "./config/add"; import addModalConfig from "./config/add";
@ -183,8 +187,18 @@ function handleToolbarClick(name: string) {
ElMessage.success("点击了自定义1按钮"); ElMessage.success("点击了自定义1按钮");
} }
} }
const changePwdRef = ref();
function changePwdRefShow(row: IObject) {
changePwdRef.value?.open(row);
}
// //
async function handleOperatClick(data: IOperatData) {} async function handleOperatClick(data: IOperatData) {
console.log(data);
if (data.name === "change_pwd") {
changePwdRefShow(data.row);
}
}
// //
</script> </script>