fix: 店铺列表增加单独激活码弹窗,修改耗材列表搜索时间筛选条件传参
This commit is contained in:
parent
c73a838e8c
commit
552e3f20a0
|
|
@ -123,7 +123,13 @@ function toGoods(id: number | string) {
|
||||||
//统计数据
|
//统计数据
|
||||||
const gongjiData = reactive({ totalRow: 0 });
|
const gongjiData = reactive({ totalRow: 0 });
|
||||||
function getTongji(params: IObject | undefined) {
|
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);
|
Object.assign(gongjiData, res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -103,12 +103,16 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" width="150">
|
<el-table-column label="操作" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-link @click="addShopShow(scope.row)">
|
<el-link @click="addShopShow(scope.row)">
|
||||||
<el-icon><Edit /></el-icon>
|
<el-icon><Edit /></el-icon>
|
||||||
编辑
|
编辑
|
||||||
</el-link>
|
</el-link>
|
||||||
|
<el-link @click="activateCodeShow(scope.row)">
|
||||||
|
<el-icon><Edit /></el-icon>
|
||||||
|
激活
|
||||||
|
</el-link>
|
||||||
<el-dropdown @command="dropdownClick($event, scope.row)">
|
<el-dropdown @command="dropdownClick($event, scope.row)">
|
||||||
<el-link>
|
<el-link>
|
||||||
更多
|
更多
|
||||||
|
|
@ -143,16 +147,22 @@
|
||||||
</div>
|
</div>
|
||||||
<addShop ref="refAddShop" @success="getTableData" />
|
<addShop ref="refAddShop" @success="getTableData" />
|
||||||
<detailModal ref="refDetailModal" />
|
<detailModal ref="refDetailModal" />
|
||||||
|
<!-- 激活码 -->
|
||||||
|
<activateCode ref="refActivateCode" @success="getTableData" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import activateCode from "./components/activateCode.vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import ShopApi from "@/api/account/shop";
|
import ShopApi from "@/api/account/shop";
|
||||||
import { ElNotification, ElMessageBox } from "element-plus";
|
import { ElNotification, ElMessageBox } from "element-plus";
|
||||||
import addShop from "./components/addShop.vue";
|
import addShop from "./components/addShop.vue";
|
||||||
import detailModal from "./components/detailModal.vue";
|
import detailModal from "./components/detailModal.vue";
|
||||||
|
const refActivateCode = ref(null);
|
||||||
|
function activateCodeShow(row) {
|
||||||
|
refActivateCode.value.open(row);
|
||||||
|
}
|
||||||
const refAddShop = ref(null);
|
const refAddShop = ref(null);
|
||||||
function addShopShow(row) {
|
function addShopShow(row) {
|
||||||
refAddShop.value.show(row);
|
refAddShop.value.show(row);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue