Merge branch 'multi-store' of https://e.coding.net/g-cphe0354/cashier/cashier-web into multi-store

This commit is contained in:
wwz
2025-04-12 11:01:21 +08:00
25 changed files with 283 additions and 111 deletions

View File

@@ -20,7 +20,15 @@ const contentConfig: IContentConfig = {
return Api.edit(data);
},
pk: "id",
toolbar: ["add"],
toolbar: [
{
icon: "plus",
text: "新增",
type: "primary",
name: "add",
auth: "import",
},
],
defaultToolbar: ["refresh", "filter", "search"],
cols: [
// { type: "selection", width: 50, align: "center" },
@@ -49,7 +57,7 @@ const contentConfig: IContentConfig = {
fixed: "right",
width: 280,
templet: "tool",
operat: ["edit"],
operat: [{ text: "编辑", icon: 'edit', name: "edit"}],
},
],
};

View File

@@ -71,6 +71,7 @@ import contentConfig from "./config/content";
import editModalConfig from "./config/edit";
import searchConfig from "./config/search";
import { returnOptionsLabel } from "./config/config";
import { isSyncStatus } from "@/utils/index";
const {
searchRef,
@@ -87,6 +88,14 @@ const {
handleFilterChange,
} = usePage();
if (isSyncStatus()) {
contentConfig.toolbar[0].hidden = true
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = true
} else {
contentConfig.toolbar[0].hidden = false
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = false
}
// 新增
async function handleAddClick() {
addModalRef.value?.setModalVisible();

View File

@@ -28,7 +28,20 @@ const contentConfig: IContentConfig = {
indexActionData: {},
pk: "id",
toolbar: [
"add",
{
icon: "plus",
text: "新增",
type: "primary",
name: "add",
auth: "import",
},
{
icon: "refresh",
text: "同步",
type: "danger",
name: "sync",
auth: "import",
},
{
text: "入库",
name: "ruku",

View File

@@ -64,7 +64,7 @@
justify-content: center;
align-items: center;
">
<el-button type="primary" link @click="refAddHaocaiOpen(scope.row)">编辑</el-button>
<el-button type="primary" link @click="refAddHaocaiOpen(scope.row)" v-if="!isSyncStatus()">编辑</el-button>
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'consumables')">
耗材盘点
</el-button>
@@ -89,12 +89,16 @@ import addHaocai from "./components/add-haocai.vue";
import dataTongji from "./components/DataStatistics.vue";
import addConsTakin from "./components/addConsTakin.vue";
import consApi from "@/api/product/cons";
import UserAPI from "@/api/product/index";
import type { IObject, IOperatData } from "@/components/CURD/types";
import usePage from "@/components/CURD/usePage";
import contentConfig from "./config/content";
import editModalConfig from "./config/edit";
import searchConfig from "./config/search";
import { returnOptionsLabel } from "./config/config";
import { isSyncStatus } from "@/utils/index";
const router = useRouter();
const {
searchRef,
@@ -122,6 +126,15 @@ if (conName) {
}
}
if (isSyncStatus()) {
contentConfig.toolbar[0].hidden = true
contentConfig.toolbar[1].hidden = false
} else {
contentConfig.toolbar[0].hidden = false
contentConfig.toolbar[1].hidden = true
}
//统计数据
const gongjiData = reactive({ totalRow: 0 });
function getTongji(params: IObject | undefined) {
@@ -189,8 +202,13 @@ async function handleEditClick(row: IObject) {
editModalRef.value?.setFormData({ ...row, url: [row.url] });
}
// 其他工具栏
function handleToolbarClick(name: string) {
async function handleToolbarClick(name: string) {
console.log(name);
if (name === 'sync') {
let res = await UserAPI.sync()
ElMessage.success('操作成功,数据正在后台同步中...')
return;
}
if (name === "category") {
router.push({ path: "/inventory/classification" });
return;

View File

@@ -23,7 +23,15 @@ const contentConfig: IContentConfig = {
return Api.edit(data);
},
pk: "id",
toolbar: ["add"],
toolbar: [
{
icon: "plus",
text: "新增",
type: "primary",
name: "add",
auth: "import",
},
],
defaultToolbar: ["refresh", "filter", "search"],
cols: [
// { type: "selection", width: 50, align: "center" },
@@ -71,7 +79,7 @@ const contentConfig: IContentConfig = {
fixed: "right",
width: 280,
templet: "tool",
operat: ["edit", "delete"],
operat: [{ text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
},
],
};

View File

@@ -71,6 +71,7 @@ import contentConfig from "./config/content";
import editModalConfig from "./config/edit";
import searchConfig from "./config/search";
import { returnOptionsLabel } from "./config/config";
import { isSyncStatus } from "@/utils/index";
const {
searchRef,
@@ -87,6 +88,16 @@ const {
handleFilterChange,
} = usePage();
if (isSyncStatus()) {
contentConfig.toolbar[0].hidden = true
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = true
contentConfig.cols[contentConfig.cols.length - 1].operat[1].hidden = true
} else {
contentConfig.toolbar[0].hidden = false
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = false
contentConfig.cols[contentConfig.cols.length - 1].operat[1].hidden = false
}
// 新增
async function handleAddClick() {
addModalRef.value?.setModalVisible();