fix: 店铺列表增加单独激活码弹窗,修改耗材列表搜索时间筛选条件传参

This commit is contained in:
YeMingfei666 2025-03-20 15:38:47 +08:00
parent c73a838e8c
commit 552e3f20a0
3 changed files with 79 additions and 3 deletions

View File

@ -123,7 +123,13 @@ function toGoods(id: number | string) {
//
const gongjiData = reactive({ totalRow: 0 });
function getTongji(params: IObject | undefined) {
consApi.statistics(params).then((res) => {
const query = { ...params };
if (params?.createAt) {
query.beginTime = params.createAt[0];
query.endTime = params.createAt[1];
delete query.createAt;
}
consApi.statistics(query).then((res) => {
Object.assign(gongjiData, res);
});
}

View File

@ -0,0 +1,60 @@
<template>
<el-dialog title="激活码" width="500px" v-model="show" @close="reset">
<el-form :model="form" ref="refForm" :rules="rules">
<el-form-item label="激活码" prop="activateCode">
<el-input v-model="form.activateCode" placeholder="请输入激活码"></el-input>
<div class="tips">输入有效激活码表示添加的同时直接激活该店铺</div>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</template>
</el-dialog>
</template>
<script setup>
import ShopApi from "@/api/account/shop";
const show = ref(false);
const form = reactive({
activateCode: "",
id: "",
});
const rules = {
activateCode: [{ required: true, message: "请输入激活码", trigger: "blur" }],
};
function reset() {
form.activateCode = "";
form.id = "";
}
const emit = defineEmits(["submit"]);
const refForm = ref();
function submit() {
refForm.value.validate((valid) => {
if (valid) {
ShopApi.edit(form).then(() => {
ElNotification({
title: "成功",
message: "操作成功",
type: "success",
});
emit("success");
close();
});
}
});
}
function close() {
show.value = false;
}
function open(obj) {
form.id = obj.id;
show.value = true;
}
defineExpose({
open,
close,
});
</script>

View File

@ -103,12 +103,16 @@
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<el-table-column label="操作" width="200">
<template v-slot="scope">
<el-link @click="addShopShow(scope.row)">
<el-icon><Edit /></el-icon>
编辑
</el-link>
<el-link @click="activateCodeShow(scope.row)">
<el-icon><Edit /></el-icon>
激活
</el-link>
<el-dropdown @command="dropdownClick($event, scope.row)">
<el-link>
更多
@ -143,16 +147,22 @@
</div>
<addShop ref="refAddShop" @success="getTableData" />
<detailModal ref="refDetailModal" />
<!-- 激活码 -->
<activateCode ref="refActivateCode" @success="getTableData" />
</div>
</template>
<script setup>
import activateCode from "./components/activateCode.vue";
import dayjs from "dayjs";
import ShopApi from "@/api/account/shop";
import { ElNotification, ElMessageBox } from "element-plus";
import addShop from "./components/addShop.vue";
import detailModal from "./components/detailModal.vue";
const refActivateCode = ref(null);
function activateCodeShow(row) {
refActivateCode.value.open(row);
}
const refAddShop = ref(null);
function addShopShow(row) {
refAddShop.value.show(row);