Merge branch 'multi-store' of https://e.coding.net/g-cphe0354/cashier/cashier-web into multi-store
This commit is contained in:
@@ -246,6 +246,7 @@ export interface UserInfo {
|
|||||||
* 用户分页查询对象
|
* 用户分页查询对象
|
||||||
*/
|
*/
|
||||||
export interface UserPageQuery extends PageQuery {
|
export interface UserPageQuery extends PageQuery {
|
||||||
|
times: any;
|
||||||
/** 搜索关键字 */
|
/** 搜索关键字 */
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="item.hidden === undefined || item.hidden === false"
|
||||||
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
||||||
:icon="item.icon"
|
:icon="item.icon"
|
||||||
:type="item.type ?? 'default'"
|
:type="item.type ?? 'default'"
|
||||||
@@ -284,31 +285,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<el-button
|
<template v-if="item.hidden === undefined || item.hidden === false">
|
||||||
v-if="item.isBtn"
|
|
||||||
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
|
||||||
:icon="item.icon"
|
|
||||||
:type="item.type ?? 'primary'"
|
|
||||||
size="small"
|
|
||||||
link
|
|
||||||
@click="
|
|
||||||
handleOperat({
|
|
||||||
name: item.name,
|
|
||||||
row: scope.row,
|
|
||||||
column: scope.column,
|
|
||||||
$index: scope.$index,
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ item.text }}
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<el-dropdown style="margin-top: 4px" v-else>
|
|
||||||
<el-button
|
<el-button
|
||||||
v-if="item.render === undefined || item.render(scope.row)"
|
v-if="item.isBtn"
|
||||||
v-bind="
|
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
||||||
item.auth ? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] } : {}
|
|
||||||
"
|
|
||||||
:icon="item.icon"
|
:icon="item.icon"
|
||||||
:type="item.type ?? 'primary'"
|
:type="item.type ?? 'primary'"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -324,26 +304,51 @@
|
|||||||
>
|
>
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<template v-if="item.options && item.options.length > 0" #dropdown>
|
|
||||||
<el-dropdown-menu>
|
<el-dropdown style="margin-top: 4px" v-else>
|
||||||
<el-dropdown-item
|
<el-button
|
||||||
@click="
|
v-if="item.render === undefined || item.render(scope.row)"
|
||||||
handleOperat({
|
v-bind="
|
||||||
name: item.name,
|
item.auth
|
||||||
row: scope.row,
|
? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] }
|
||||||
column: scope.column,
|
: {}
|
||||||
$index: scope.$index,
|
"
|
||||||
command: opt.command ? opt.command : '',
|
:icon="item.icon"
|
||||||
})
|
:type="item.type ?? 'primary'"
|
||||||
"
|
size="small"
|
||||||
v-for="opt in item.options"
|
link
|
||||||
:key="opt.value"
|
@click="
|
||||||
>
|
handleOperat({
|
||||||
{{ opt.label }}
|
name: item.name,
|
||||||
</el-dropdown-item>
|
row: scope.row,
|
||||||
</el-dropdown-menu>
|
column: scope.column,
|
||||||
</template>
|
$index: scope.$index,
|
||||||
</el-dropdown>
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ item.text }}
|
||||||
|
</el-button>
|
||||||
|
<template #dropdown v-if="item.options && item.options.length > 0">
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item
|
||||||
|
@click="
|
||||||
|
handleOperat({
|
||||||
|
name: item.name,
|
||||||
|
row: scope.row,
|
||||||
|
column: scope.column,
|
||||||
|
$index: scope.$index,
|
||||||
|
command: opt.command ? opt.command : '',
|
||||||
|
})
|
||||||
|
"
|
||||||
|
v-for="opt in item.options"
|
||||||
|
:key="opt.value"
|
||||||
|
>
|
||||||
|
{{ opt.label }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ export interface IContentConfig<T = any> {
|
|||||||
icon?: string;
|
icon?: string;
|
||||||
name: string;
|
name: string;
|
||||||
text: string;
|
text: string;
|
||||||
|
hidden?: boolean;
|
||||||
type?: "primary" | "success" | "warning" | "danger" | "info";
|
type?: "primary" | "success" | "warning" | "danger" | "info";
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
@@ -215,6 +216,7 @@ export interface IContentConfig<T = any> {
|
|||||||
name: string;
|
name: string;
|
||||||
text: string;
|
text: string;
|
||||||
isBtn?: boolean;
|
isBtn?: boolean;
|
||||||
|
hidden?: boolean;
|
||||||
type?: "primary" | "success" | "warning" | "danger" | "info";
|
type?: "primary" | "success" | "warning" | "danger" | "info";
|
||||||
render?: (row: IObject) => boolean;
|
render?: (row: IObject) => boolean;
|
||||||
options?: {
|
options?: {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ async function geiShopList() {
|
|||||||
state.branchList = res;
|
state.branchList = res;
|
||||||
if (!localStorage.getItem("shopName")) {
|
if (!localStorage.getItem("shopName")) {
|
||||||
state.shopName = state.branchList[0].shopName
|
state.shopName = state.branchList[0].shopName
|
||||||
localStorage.setItem("branch_shopId", data.shopInfo.id)
|
localStorage.setItem("branch_shopId", state.branchList[0].id)
|
||||||
localStorage.setItem("shopName", state.branchList[0].shopName)
|
localStorage.setItem("shopName", state.branchList[0].shopName)
|
||||||
} else {
|
} else {
|
||||||
state.shopName = localStorage.getItem("shopName")
|
state.shopName = localStorage.getItem("shopName")
|
||||||
|
|||||||
@@ -129,3 +129,16 @@ export function isSyncStatus() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否有某权限
|
||||||
|
*/
|
||||||
|
export function hasPermission(params: any) {
|
||||||
|
let $PermissionObj = JSON.parse(localStorage.getItem("permission") || '[]' )
|
||||||
|
const obj = $PermissionObj.find((v: any) => v == params || v == params)
|
||||||
|
if (obj) {
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ import couponEnum from "./couponEnum";
|
|||||||
import couponDetails from "./components/coupon_details.vue";
|
import couponDetails from "./components/coupon_details.vue";
|
||||||
import couponAdd from "./components/add.vue";
|
import couponAdd from "./components/add.vue";
|
||||||
import couponApi from "@/api/account/coupon";
|
import couponApi from "@/api/account/coupon";
|
||||||
|
import { hasPermission } from "@/utils/index";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// eslint-disable-next-line vue/no-unused-components
|
// eslint-disable-next-line vue/no-unused-components
|
||||||
@@ -100,6 +101,9 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
|
console.log(hasPermission('coupon:add'))
|
||||||
|
console.log(hasPermission('coupon:edit'))
|
||||||
|
// coupon:add shopStaff:add
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toAdd(data) {
|
toAdd(data) {
|
||||||
|
|||||||
@@ -20,7 +20,15 @@ const contentConfig: IContentConfig = {
|
|||||||
return Api.edit(data);
|
return Api.edit(data);
|
||||||
},
|
},
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: ["add"],
|
toolbar: [
|
||||||
|
{
|
||||||
|
icon: "plus",
|
||||||
|
text: "新增",
|
||||||
|
type: "primary",
|
||||||
|
name: "add",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
|
],
|
||||||
defaultToolbar: ["refresh", "filter", "search"],
|
defaultToolbar: ["refresh", "filter", "search"],
|
||||||
cols: [
|
cols: [
|
||||||
// { type: "selection", width: 50, align: "center" },
|
// { type: "selection", width: 50, align: "center" },
|
||||||
@@ -49,7 +57,7 @@ const contentConfig: IContentConfig = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: ["edit"],
|
operat: [{ text: "编辑", icon: 'edit', name: "edit"}],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ import contentConfig from "./config/content";
|
|||||||
import editModalConfig from "./config/edit";
|
import editModalConfig from "./config/edit";
|
||||||
import searchConfig from "./config/search";
|
import searchConfig from "./config/search";
|
||||||
import { returnOptionsLabel } from "./config/config";
|
import { returnOptionsLabel } from "./config/config";
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
@@ -87,6 +88,14 @@ const {
|
|||||||
handleFilterChange,
|
handleFilterChange,
|
||||||
} = usePage();
|
} = 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() {
|
async function handleAddClick() {
|
||||||
addModalRef.value?.setModalVisible();
|
addModalRef.value?.setModalVisible();
|
||||||
|
|||||||
@@ -28,7 +28,20 @@ const contentConfig: IContentConfig = {
|
|||||||
indexActionData: {},
|
indexActionData: {},
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: [
|
toolbar: [
|
||||||
"add",
|
{
|
||||||
|
icon: "plus",
|
||||||
|
text: "新增",
|
||||||
|
type: "primary",
|
||||||
|
name: "add",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "refresh",
|
||||||
|
text: "同步",
|
||||||
|
type: "danger",
|
||||||
|
name: "sync",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: "入库",
|
text: "入库",
|
||||||
name: "ruku",
|
name: "ruku",
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: 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 link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'consumables')">
|
||||||
耗材盘点
|
耗材盘点
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -89,12 +89,16 @@ import addHaocai from "./components/add-haocai.vue";
|
|||||||
import dataTongji from "./components/DataStatistics.vue";
|
import dataTongji from "./components/DataStatistics.vue";
|
||||||
import addConsTakin from "./components/addConsTakin.vue";
|
import addConsTakin from "./components/addConsTakin.vue";
|
||||||
import consApi from "@/api/product/cons";
|
import consApi from "@/api/product/cons";
|
||||||
|
import UserAPI from "@/api/product/index";
|
||||||
|
|
||||||
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 contentConfig from "./config/content";
|
import contentConfig from "./config/content";
|
||||||
import editModalConfig from "./config/edit";
|
import editModalConfig from "./config/edit";
|
||||||
import searchConfig from "./config/search";
|
import searchConfig from "./config/search";
|
||||||
import { returnOptionsLabel } from "./config/config";
|
import { returnOptionsLabel } from "./config/config";
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const {
|
const {
|
||||||
searchRef,
|
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 });
|
const gongjiData = reactive({ totalRow: 0 });
|
||||||
function getTongji(params: IObject | undefined) {
|
function getTongji(params: IObject | undefined) {
|
||||||
@@ -189,8 +202,13 @@ async function handleEditClick(row: IObject) {
|
|||||||
editModalRef.value?.setFormData({ ...row, url: [row.url] });
|
editModalRef.value?.setFormData({ ...row, url: [row.url] });
|
||||||
}
|
}
|
||||||
// 其他工具栏
|
// 其他工具栏
|
||||||
function handleToolbarClick(name: string) {
|
async function handleToolbarClick(name: string) {
|
||||||
console.log(name);
|
console.log(name);
|
||||||
|
if (name === 'sync') {
|
||||||
|
let res = await UserAPI.sync()
|
||||||
|
ElMessage.success('操作成功,数据正在后台同步中...')
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (name === "category") {
|
if (name === "category") {
|
||||||
router.push({ path: "/inventory/classification" });
|
router.push({ path: "/inventory/classification" });
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,15 @@ const contentConfig: IContentConfig = {
|
|||||||
return Api.edit(data);
|
return Api.edit(data);
|
||||||
},
|
},
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: ["add"],
|
toolbar: [
|
||||||
|
{
|
||||||
|
icon: "plus",
|
||||||
|
text: "新增",
|
||||||
|
type: "primary",
|
||||||
|
name: "add",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
|
],
|
||||||
defaultToolbar: ["refresh", "filter", "search"],
|
defaultToolbar: ["refresh", "filter", "search"],
|
||||||
cols: [
|
cols: [
|
||||||
// { type: "selection", width: 50, align: "center" },
|
// { type: "selection", width: 50, align: "center" },
|
||||||
@@ -71,7 +79,7 @@ const contentConfig: IContentConfig = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: ["edit", "delete"],
|
operat: [{ text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ import contentConfig from "./config/content";
|
|||||||
import editModalConfig from "./config/edit";
|
import editModalConfig from "./config/edit";
|
||||||
import searchConfig from "./config/search";
|
import searchConfig from "./config/search";
|
||||||
import { returnOptionsLabel } from "./config/config";
|
import { returnOptionsLabel } from "./config/config";
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
@@ -87,6 +88,16 @@ const {
|
|||||||
handleFilterChange,
|
handleFilterChange,
|
||||||
} = usePage();
|
} = 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() {
|
async function handleAddClick() {
|
||||||
addModalRef.value?.setModalVisible();
|
addModalRef.value?.setModalVisible();
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ function handleLogin() {
|
|||||||
setDouyinToken(checkInfo.userInfo.token);
|
setDouyinToken(checkInfo.userInfo.token);
|
||||||
});
|
});
|
||||||
localStorage.removeItem("shopName")
|
localStorage.removeItem("shopName")
|
||||||
|
let resData = await $API_login.getPermission()
|
||||||
|
localStorage.setItem("permission",JSON.stringify(resData))
|
||||||
|
|
||||||
const { path, queryParams } = parseRedirect();
|
const { path, queryParams } = parseRedirect();
|
||||||
console.log(path, queryParams);
|
console.log(path, queryParams);
|
||||||
|
|||||||
@@ -176,6 +176,8 @@ import searchConfig from "./goodsGroupconfig/search";
|
|||||||
import searchConfig2 from "./goodsGroupconfig/search2";
|
import searchConfig2 from "./goodsGroupconfig/search2";
|
||||||
import myDialog from '@/components/mycomponents/myDialog.vue'
|
import myDialog from '@/components/mycomponents/myDialog.vue'
|
||||||
import selectGoodslist from "./goodsGroupconfig/selectGoodslist.vue"
|
import selectGoodslist from "./goodsGroupconfig/selectGoodslist.vue"
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
searchRefs,
|
searchRefs,
|
||||||
@@ -194,6 +196,18 @@ const {
|
|||||||
handleFilterChange,
|
handleFilterChange,
|
||||||
} = usePage();
|
} = 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
|
||||||
|
contentConfig.cols[3].templet = "custom"
|
||||||
|
} else {
|
||||||
|
contentConfig.toolbar[0].hidden = false
|
||||||
|
contentConfig.cols[3].templet = "switch"
|
||||||
|
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = false
|
||||||
|
contentConfig.cols[contentConfig.cols.length - 1].operat[1].hidden = false
|
||||||
|
}
|
||||||
|
|
||||||
let switchref = ref(false)
|
let switchref = ref(false)
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: ["edit", "delete"],
|
operat: [{ text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ import contentConfig from "./categoryconfig/content";
|
|||||||
import contentConfig2 from "./categoryconfig/content2";
|
import contentConfig2 from "./categoryconfig/content2";
|
||||||
import editModalConfig from "./categoryconfig/edit";
|
import editModalConfig from "./categoryconfig/edit";
|
||||||
import searchConfig from "./categoryconfig/search";
|
import searchConfig from "./categoryconfig/search";
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
@@ -111,6 +112,17 @@ const {
|
|||||||
handleFilterChange,
|
handleFilterChange,
|
||||||
} = usePage();
|
} = 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
|
||||||
|
contentConfig.cols[2].templet = "custom"
|
||||||
|
} else {
|
||||||
|
contentConfig.toolbar[0].hidden = false
|
||||||
|
contentConfig.cols[2].templet = "switch"
|
||||||
|
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = false
|
||||||
|
contentConfig.cols[contentConfig.cols.length - 1].operat[1].hidden = false
|
||||||
|
}
|
||||||
// 新增
|
// 新增
|
||||||
async function handleAddClick() {
|
async function handleAddClick() {
|
||||||
addModalRef.value?.setModalVisible();
|
addModalRef.value?.setModalVisible();
|
||||||
|
|||||||
@@ -44,7 +44,15 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
// return res.list;
|
// return res.list;
|
||||||
// },
|
// },
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: ["add"],
|
toolbar: [
|
||||||
|
{
|
||||||
|
icon: "plus",
|
||||||
|
text: "新增",
|
||||||
|
type: "primary",
|
||||||
|
name: "add",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
|
],
|
||||||
cols: [
|
cols: [
|
||||||
// { type: "selection", width: 50, align: "center" },
|
// { type: "selection", width: 50, align: "center" },
|
||||||
{ label: "分类名称", align: "center", prop: "name" },
|
{ label: "分类名称", align: "center", prop: "name" },
|
||||||
@@ -68,7 +76,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: ["edit", "delete"],
|
operat: [{ text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -200,17 +200,15 @@ let datas = reactive({
|
|||||||
remark: "",
|
remark: "",
|
||||||
images: []
|
images: []
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isSyncStatus()) {
|
if (isSyncStatus()) {
|
||||||
if( JSON.stringify(contentConfig.toolbar)?.indexOf("add") != -1){
|
contentConfig.toolbar[0].hidden = true
|
||||||
contentConfig.toolbar?.splice(0, 1)
|
contentConfig.toolbar[1].hidden = false
|
||||||
}
|
contentConfig.cols[contentConfig.cols.length - 1].operat[2].hidden = true
|
||||||
if( JSON.stringify(contentConfig.cols[contentConfig.cols.length-1].operat)?.indexOf("delete") != -1){
|
} else {
|
||||||
contentConfig.cols[contentConfig.cols.length-1].operat?.splice(2, 1)
|
contentConfig.toolbar[0].hidden = false
|
||||||
}
|
contentConfig.toolbar[1].hidden = true
|
||||||
}else {
|
contentConfig.cols[contentConfig.cols.length - 1].operat[2].hidden = false
|
||||||
if( JSON.stringify(contentConfig.toolbar)?.indexOf("custom2") != -1){
|
|
||||||
contentConfig.toolbar?.splice(1, 1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -220,7 +218,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
// 获取耗材列表
|
// 获取耗材列表
|
||||||
gethaocaiList()
|
gethaocaiList()
|
||||||
|
|
||||||
});
|
});
|
||||||
function newHandleQueryClick(e: IObject | undefined) {
|
function newHandleQueryClick(e: IObject | undefined) {
|
||||||
const filterParams = contentRef.value?.getFilterParams();
|
const filterParams = contentRef.value?.getFilterParams();
|
||||||
@@ -324,14 +322,13 @@ async function handleEditClick(row: IObject) {
|
|||||||
// 其他工具栏
|
// 其他工具栏
|
||||||
async function handleToolbarClick(name: string) {
|
async function handleToolbarClick(name: string) {
|
||||||
console.log(name);
|
console.log(name);
|
||||||
if ( name === "custom1" ) {
|
if (name === "custom1") {
|
||||||
// ElMessage.success("点击了自定义1按钮");
|
// ElMessage.success("点击了自定义1按钮");
|
||||||
myDialogRef.value.open();
|
myDialogRef.value.open();
|
||||||
}
|
}
|
||||||
if ( name === "custom2" ) { //商品同步
|
if (name === "sync") { //商品同步
|
||||||
let res = await UserAPI.sync()
|
let res = await UserAPI.sync()
|
||||||
ElMessage.success('操作成功,数据正在后台同步中...')
|
ElMessage.success('操作成功,数据正在后台同步中...')
|
||||||
console.log(res)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function confirm() {
|
async function confirm() {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number size="default" v-model="scope.row.salePrice" @change="priceFormat(scope.row, 'salePrice')"
|
<el-input-number size="default" v-model="scope.row.salePrice" @change="priceFormat(scope.row, 'salePrice')"
|
||||||
@blur="priceFormat(scope.row, 'salePrice')" controls-position="right"></el-input-number>
|
@blur="priceFormat(scope.row, 'salePrice')" controls-position="right" :disabled="isSyncStatus()"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="originPrice">
|
<el-table-column prop="originPrice">
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number @change="priceFormat(scope.row, 'originPrice')" v-model="scope.row.originPrice"
|
<el-input-number @change="priceFormat(scope.row, 'originPrice')" v-model="scope.row.originPrice"
|
||||||
@blur="priceFormat(scope.row, 'originPrice')" controls-position="right"></el-input-number>
|
@blur="priceFormat(scope.row, 'originPrice')" controls-position="right" :disabled="isSyncStatus()"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="costPrice">
|
<el-table-column prop="costPrice">
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number @change="priceFormat(scope.row, 'costPrice')" v-model="scope.row.costPrice"
|
<el-input-number @change="priceFormat(scope.row, 'costPrice')" v-model="scope.row.costPrice"
|
||||||
@blur="priceFormat(scope.row, 'costPrice')" controls-position="right"></el-input-number>
|
@blur="priceFormat(scope.row, 'costPrice')" controls-position="right" :disabled="isSyncStatus()"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number @change="priceFormat(scope.row, 'memberPrice')" v-model="scope.row.memberPrice"
|
<el-input-number @change="priceFormat(scope.row, 'memberPrice')" v-model="scope.row.memberPrice"
|
||||||
@blur="priceFormat(scope.row, 'memberPrice')" controls-position="right"></el-input-number>
|
@blur="priceFormat(scope.row, 'memberPrice')" controls-position="right" :disabled="isSyncStatus()"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="起售数量" prop="suitNum">
|
<el-table-column label="起售数量" prop="suitNum">
|
||||||
@@ -64,9 +64,9 @@
|
|||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number @change="priceFormat(scope.row, 'suitNum')" v-model="scope.row.suitNum"
|
<el-input-number @change="priceFormat(scope.row, 'suitNum')" v-model="scope.row.suitNum"
|
||||||
@blur="priceFormat(scope.row, 'suitNum')" :min="0" controls-position="right"
|
@blur="priceFormat(scope.row, 'suitNum')" :min="0" controls-position="right"
|
||||||
v-if="props.info.type == 'weigh'"></el-input-number>
|
v-if="props.info.type == 'weigh'" :disabled="isSyncStatus()"></el-input-number>
|
||||||
<el-input-number @change="priceFormat(scope.row, 'suitNum')" v-model="scope.row.suitNum"
|
<el-input-number @change="priceFormat(scope.row, 'suitNum')" v-model="scope.row.suitNum"
|
||||||
@blur="priceFormat(scope.row, 'suitNum')" :min="1" controls-position="right" v-else></el-input-number>
|
@blur="priceFormat(scope.row, 'suitNum')" :min="1" controls-position="right" :disabled="isSyncStatus()" v-else></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input-number @change="priceFormat(batchNumberForm, 'batchNumber')"
|
<el-input-number @change="priceFormat(batchNumberForm, 'batchNumber')"
|
||||||
@blur="priceFormat(batchNumberForm, 'batchNumber')" v-model="batchNumberForm.batchNumber"
|
@blur="priceFormat(batchNumberForm, 'batchNumber')" v-model="batchNumberForm.batchNumber"
|
||||||
controls-position="right" style="width: 100%"></el-input-number>
|
controls-position="right" style="width: 100%" :disabled="isSyncStatus()"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -93,6 +93,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const ruleFormRef = ref(null)
|
const ruleFormRef = ref(null)
|
||||||
let batchNumberKey = ref(null)
|
let batchNumberKey = ref(null)
|
||||||
let batchNumberForm = reactive({
|
let batchNumberForm = reactive({
|
||||||
@@ -193,4 +195,4 @@ const formatPrice = (price, min = -Infinity, max = 100000000, returnIsArea = fal
|
|||||||
return newval
|
return newval
|
||||||
}
|
}
|
||||||
defineExpose({ getdata })
|
defineExpose({ getdata })
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,21 +4,21 @@
|
|||||||
<el-form-item label="商品名称" required>
|
<el-form-item label="商品名称" required>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item prop="name">
|
<el-form-item prop="name">
|
||||||
<el-input v-model="ruleForm.name" placeholder="请输入商品名称" />
|
<el-input v-model="ruleForm.name" placeholder="请输入商品名称" :disabled="isSyncStatus()"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品介绍">
|
<el-form-item label="商品介绍">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="ruleForm.shortTitle" type="textarea" placeholder="请输入商品介绍" />
|
<el-input v-model="ruleForm.shortTitle" type="textarea" placeholder="请输入商品介绍" :disabled="isSyncStatus()"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单位" required>
|
<el-form-item label="单位" required>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item prop="unitId">
|
<el-form-item prop="unitId">
|
||||||
<el-select v-model="ruleForm.unitId" placeholder="请选择单位">
|
<el-select v-model="ruleForm.unitId" placeholder="请选择单位" :disabled="isSyncStatus()">
|
||||||
<el-option :label="item.name" :value="item.id" v-for="item in datas.Company" :key="item.id" />
|
<el-option :label="item.name" :value="item.id" v-for="item in datas.Company" :key="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<el-form-item label="商品分类" required>
|
<el-form-item label="商品分类" required>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item prop="region">
|
<el-form-item prop="region">
|
||||||
<el-select v-model="ruleForm.categoryId" placeholder="请选择商品分类">
|
<el-select v-model="ruleForm.categoryId" placeholder="请选择商品分类" :disabled="isSyncStatus()">
|
||||||
<el-option :label="item.name" :value="item.id" v-for="item in datas.classification" :key="item.id" />
|
<el-option :label="item.name" :value="item.id" v-for="item in datas.classification" :key="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<AddImg ref="addImg" @successEvent="successEvent"></AddImg>
|
<AddImg ref="addImg" @successEvent="successEvent"></AddImg>
|
||||||
|
|
||||||
<el-form-item label="商品类型">
|
<el-form-item label="商品类型">
|
||||||
<el-radio-group v-model="ruleForm.type" @change="changeTypeEnum(ruleForm.type)">
|
<el-radio-group v-model="ruleForm.type" @change="changeTypeEnum(ruleForm.type)" :disabled="isSyncStatus()">
|
||||||
<el-radio value="single">单规格商品</el-radio>
|
<el-radio value="single">单规格商品</el-radio>
|
||||||
<el-radio value="sku">多规格商品</el-radio>
|
<el-radio value="sku">多规格商品</el-radio>
|
||||||
<el-radio value="package">套餐商品</el-radio>
|
<el-radio value="package">套餐商品</el-radio>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<el-form-item label="套餐商品" v-if="ruleForm.type == 'package'">
|
<el-form-item label="套餐商品" v-if="ruleForm.type == 'package'">
|
||||||
<div style="display: block;width: 100%;">
|
<div style="display: block;width: 100%;">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-radio-group v-model="ruleForm.groupType" @change="typeChange">
|
<el-radio-group v-model="ruleForm.groupType" @change="typeChange" :disabled="isSyncStatus()">
|
||||||
<el-radio-button label="0">固定套餐</el-radio-button>
|
<el-radio-button label="0">固定套餐</el-radio-button>
|
||||||
<el-radio-button label="1">可选套餐</el-radio-button>
|
<el-radio-button label="1">可选套餐</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@@ -82,13 +82,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="150">
|
<el-table-column width="150">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button type="primary" @click="addgoods(-1)">添加商品</el-button>
|
<el-button type="primary" @click="addgoods(-1)" :disabled="isSyncStatus()">添加商品</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="text" :disabled="scope.row.type != 'sku'"
|
<el-button type="text" :disabled="scope.row.type != 'sku'&&isSyncStatus()"
|
||||||
@click="showSelectSkuHandle(scope.row, scope.$index, index)">设置规格</el-button>
|
@click="showSelectSkuHandle(scope.row, scope.$index, index)">设置规格</el-button>
|
||||||
<el-button type="text"
|
<el-button type="text"
|
||||||
@click="ruleForm.proGroupVo[index].goods.splice(scope.$index, 1)">删除</el-button>
|
@click="ruleForm.proGroupVo[index].goods.splice(scope.$index, 1)" >删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -97,13 +97,13 @@
|
|||||||
<div class="group_wrap" v-for="(item, index) in ruleForm.proGroupVo" :key="index">
|
<div class="group_wrap" v-for="(item, index) in ruleForm.proGroupVo" :key="index">
|
||||||
<el-form inline :model="item">
|
<el-form inline :model="item">
|
||||||
<el-form-item label="规格组名">
|
<el-form-item label="规格组名">
|
||||||
<el-input v-model="item.title" />
|
<el-input v-model="item.title" :disabled="isSyncStatus()"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="`本组菜品${item.goods.length}选`">
|
<el-form-item :label="`本组菜品${item.goods.length}选`">
|
||||||
<el-input v-model="item.number" />
|
<el-input v-model="item.number" :disabled="isSyncStatus()"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="ruleForm.proGroupVo.splice(index, 1)">删除</el-button>
|
<el-button @click="ruleForm.proGroupVo.splice(index, 1)" :disabled="isSyncStatus()">删除</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
@@ -113,29 +113,29 @@
|
|||||||
<el-table-column label="价格" prop="price"></el-table-column>
|
<el-table-column label="价格" prop="price"></el-table-column>
|
||||||
<el-table-column label="数量" prop="number">
|
<el-table-column label="数量" prop="number">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number v-model="scope.row.number" :min="0" />
|
<el-input-number v-model="scope.row.number" :min="0" :disabled="isSyncStatus()"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="150">
|
<el-table-column width="150">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button type="primary" @click="addgoods(index);">添加商品</el-button>
|
<el-button type="primary" @click="addgoods(index);" :disabled="isSyncStatus()">添加商品</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="text" :disabled="scope.row.type != 'sku'"
|
<el-button type="text" :disabled="scope.row.type != 'sku'&&isSyncStatus()"
|
||||||
@click="showSelectSkuHandle(scope.row, scope.$index, index)">设置规格</el-button>
|
@click="showSelectSkuHandle(scope.row, scope.$index, index)">设置规格</el-button>
|
||||||
<el-button type="text"
|
<el-button type="text"
|
||||||
@click="ruleForm.proGroupVo[index].goods.splice(scope.$index, 1)">删除</el-button>
|
@click="ruleForm.proGroupVo[index].goods.splice(scope.$index, 1)" :disabled="isSyncStatus()">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" @click="addtaocan">添加套餐组</el-button>
|
<el-button type="primary" @click="addtaocan" :disabled="isSyncStatus()">添加套餐组</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="选择规格" v-if="ruleForm.type == 'sku'">
|
<el-form-item label="选择规格" v-if="ruleForm.type == 'sku'">
|
||||||
<el-select v-model="ruleForm.specId" placeholder="请选择规格" style="width: 500px" @change="selectSpecHandle">
|
<el-select v-model="ruleForm.specId" placeholder="请选择规格" style="width: 500px" @change="selectSpecHandle" :disabled="isSyncStatus()">
|
||||||
<el-option :label="item.name" :value="item.id" v-for="item in datas.specificationsconfig"
|
<el-option :label="item.name" :value="item.id" v-for="item in datas.specificationsconfig"
|
||||||
:key="item.id"></el-option>
|
:key="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
<el-form-item label="重量">
|
<el-form-item label="重量">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div style="display: block;">
|
<div style="display: block;">
|
||||||
<el-input v-model="ruleForm.weight" placeholder="">
|
<el-input v-model="ruleForm.weight" placeholder="" :disabled="isSyncStatus()">
|
||||||
<template #append>千克</template>
|
<template #append>千克</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<!-- <div style="color: #999;">用于快递或配送运费计重</div> -->
|
<!-- <div style="color: #999;">用于快递或配送运费计重</div> -->
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否允许临时改价">
|
<el-form-item label="是否允许临时改价">
|
||||||
<el-radio-group v-model="ruleForm.isAllowTempModifyPrice">
|
<el-radio-group v-model="ruleForm.isAllowTempModifyPrice" :disabled="isSyncStatus()">
|
||||||
<el-radio :value="1">允许</el-radio>
|
<el-radio :value="1">允许</el-radio>
|
||||||
<el-radio :value="0">不允许</el-radio>
|
<el-radio :value="0">不允许</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="库存开关">
|
<el-form-item label="库存开关">
|
||||||
<div style="display: block;">
|
<div style="display: block;">
|
||||||
<el-switch v-model="ruleForm.isStock" :active-value="1" :inactive-value="0" />
|
<el-switch v-model="ruleForm.isStock" :active-value="1" :inactive-value="0" :disabled="isSyncStatus()"/>
|
||||||
<div style="color: #999;">注:关闭则不计算出入库数据</div>
|
<div style="color: #999;">注:关闭则不计算出入库数据</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
|
|
||||||
<el-form-item label="打包费" prop="delivery">
|
<el-form-item label="打包费" prop="delivery">
|
||||||
<div style="display: block;">
|
<div style="display: block;">
|
||||||
<el-input-number v-model="ruleForm.packFee" controls-position="right"></el-input-number>
|
<el-input-number v-model="ruleForm.packFee" controls-position="right" :disabled="isSyncStatus()"></el-input-number>
|
||||||
<div style="color: #999;">单份商品打包费。注:店铺开启外卖模式下该数据才生效</div>
|
<div style="color: #999;">单份商品打包费。注:店铺开启外卖模式下该数据才生效</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -251,6 +251,7 @@ import { reactive, ref } from 'vue'
|
|||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
// 规格属性
|
// 规格属性
|
||||||
import SpecificationAttribute from './SpecificationAttribute.vue'
|
import SpecificationAttribute from './SpecificationAttribute.vue'
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
import UserAPI from "@/api/product/productclassification";
|
import UserAPI from "@/api/product/productclassification";
|
||||||
import UserAPI2 from "@/api/product/commonUnits";
|
import UserAPI2 from "@/api/product/commonUnits";
|
||||||
import UserAPI3 from "@/api/product/index";
|
import UserAPI3 from "@/api/product/index";
|
||||||
@@ -492,6 +493,10 @@ function selectSkuHandle(item: any, index: number) {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
function addimgEvent() {
|
function addimgEvent() {
|
||||||
|
if( isSyncStatus() ){
|
||||||
|
ElMessage.error('当前同步启用状态下不可修改')
|
||||||
|
return
|
||||||
|
}
|
||||||
(addImg.value as any)?.show()
|
(addImg.value as any)?.show()
|
||||||
}
|
}
|
||||||
// 确认套餐商品设置规格
|
// 确认套餐商品设置规格
|
||||||
@@ -521,6 +526,10 @@ function addgoods(index: number = -1) {
|
|||||||
(shopListRef.value as any)?.opens()
|
(shopListRef.value as any)?.opens()
|
||||||
}
|
}
|
||||||
function deleteEvent(d: any) {
|
function deleteEvent(d: any) {
|
||||||
|
if( isSyncStatus() ){
|
||||||
|
ElMessage.error('当前同步启用状态下不可修改')
|
||||||
|
return
|
||||||
|
}
|
||||||
let index = ruleForm.images.findIndex((ele) => ele == d);
|
let index = ruleForm.images.findIndex((ele) => ele == d);
|
||||||
ruleForm.images.splice(index, 1);
|
ruleForm.images.splice(index, 1);
|
||||||
}
|
}
|
||||||
@@ -915,4 +924,4 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|||||||
top: -10px;
|
top: -10px;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -58,12 +58,18 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
},
|
},
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: [
|
toolbar: [
|
||||||
"add",
|
{
|
||||||
|
icon: "plus",
|
||||||
|
text: "新增",
|
||||||
|
type: "primary",
|
||||||
|
name: "add",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: "refresh",
|
icon: "refresh",
|
||||||
text: "同步",
|
text: "同步",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
name: "custom2",
|
name: "sync",
|
||||||
auth: "import",
|
auth: "import",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -114,7 +120,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: [{ text: "报损" }, "edit", "delete"],
|
operat: [{ text: "报损", name: ''}, { text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,10 +29,10 @@
|
|||||||
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||||
</template>
|
</template>
|
||||||
<template #operates="scope">
|
<template #operates="scope">
|
||||||
<el-button type="text" size="small" v-if="scope.row.level < 3"
|
<el-button type="text" size="small" v-if="scope.row.level < 3&&!isSyncStatus()"
|
||||||
@click="addlowerLevel(scope.row)">添加下一级</el-button>
|
@click="addlowerLevel(scope.row)">添加下一级</el-button>
|
||||||
<el-button type="text" size="small" @click="handleEditClick(scope.row)">编辑</el-button>
|
<el-button type="text" size="small" v-if="!isSyncStatus()" @click="handleEditClick(scope.row)">编辑</el-button>
|
||||||
<el-button type="text" size="small" @click="deleteClick(scope.row)">删除</el-button>
|
<el-button type="text" size="small" v-if="!isSyncStatus()" @click="deleteClick(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
<!-- 添加下一级-编辑 -->
|
<!-- 添加下一级-编辑 -->
|
||||||
@@ -123,6 +123,8 @@ import contentConfig2 from "./specificationsconfig/content2";
|
|||||||
import editModalConfig from "./specificationsconfig/edit";
|
import editModalConfig from "./specificationsconfig/edit";
|
||||||
import searchConfig from "./specificationsconfig/search";
|
import searchConfig from "./specificationsconfig/search";
|
||||||
import { pid } from "process";
|
import { pid } from "process";
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const validateSku1 = (rule, value, callback) => {
|
const validateSku1 = (rule, value, callback) => {
|
||||||
if (!datas.skuForm.label) {
|
if (!datas.skuForm.label) {
|
||||||
callback(new Error(' '))
|
callback(new Error(' '))
|
||||||
@@ -190,6 +192,12 @@ let datas = reactive({
|
|||||||
addchilderinfo: {}
|
addchilderinfo: {}
|
||||||
})
|
})
|
||||||
let myDialogRef = ref(null)
|
let myDialogRef = ref(null)
|
||||||
|
if (isSyncStatus()) {
|
||||||
|
contentConfig.toolbar[0].hidden = true
|
||||||
|
} else {
|
||||||
|
contentConfig.toolbar[0].hidden = false
|
||||||
|
}
|
||||||
|
|
||||||
function subitgood() {
|
function subitgood() {
|
||||||
skuForm.value.validate(async valid => {
|
skuForm.value.validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -381,4 +389,4 @@ const isA = ref(true);
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -41,7 +41,13 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
// },
|
// },
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: [
|
toolbar: [
|
||||||
"add",
|
{
|
||||||
|
icon: "plus",
|
||||||
|
text: "新增",
|
||||||
|
type: "primary",
|
||||||
|
name: "add",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
cols: [
|
cols: [
|
||||||
// { type: "selection", width: 50, align: "center" },
|
// { type: "selection", width: 50, align: "center" },
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ import contentConfig from "./unitconfig/content";
|
|||||||
import contentConfig2 from "./unitconfig/content2";
|
import contentConfig2 from "./unitconfig/content2";
|
||||||
import editModalConfig from "./unitconfig/edit";
|
import editModalConfig from "./unitconfig/edit";
|
||||||
import searchConfig from "./unitconfig/search";
|
import searchConfig from "./unitconfig/search";
|
||||||
|
import { isSyncStatus } from "@/utils/index";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
@@ -77,6 +78,16 @@ const {
|
|||||||
handleFilterChange,
|
handleFilterChange,
|
||||||
} = usePage();
|
} = 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() {
|
async function handleAddClick() {
|
||||||
addModalRef.value?.setModalVisible();
|
addModalRef.value?.setModalVisible();
|
||||||
|
|||||||
@@ -38,7 +38,13 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
},
|
},
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: [
|
toolbar: [
|
||||||
"add",
|
{
|
||||||
|
icon: "plus",
|
||||||
|
text: "新增",
|
||||||
|
type: "primary",
|
||||||
|
name: "add",
|
||||||
|
auth: "import",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
cols: [
|
cols: [
|
||||||
// { type: "selection", width: 50, align: "center" },
|
// { type: "selection", width: 50, align: "center" },
|
||||||
@@ -50,7 +56,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: ["edit", "delete"],
|
operat: [{ text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user