Compare commits
2 Commits
106d0cb1e7
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d688fcaafc | |||
| 9208c29952 |
4
.vscode/settings.json
vendored
@@ -89,9 +89,5 @@
|
|||||||
},
|
},
|
||||||
"[jsonc]": {
|
"[jsonc]": {
|
||||||
"editor.defaultFormatter": "vscode.json-language-features"
|
"editor.defaultFormatter": "vscode.json-language-features"
|
||||||
},
|
|
||||||
"files.associations": {
|
|
||||||
"*.ttml": "xml",
|
|
||||||
"*.ttss": "css"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## 正式宝塔
|
## 正式宝塔
|
||||||
|
|
||||||
<https://121.40.128.145:38279/mianban/>
|
<https://121.40.128.145:38279/>
|
||||||
chaozg
|
chaozg
|
||||||
chaozg123
|
chaozg123
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="locale" :size="size">
|
<el-config-provider :locale="locale" :size="size">
|
||||||
<!-- 开启水印 -->
|
<!-- 开启水印 -->
|
||||||
<el-watermark :font="{ color: fontColor }" :content="watermarkEnabled ? defaultSettings.watermarkContent : ''"
|
<el-watermark
|
||||||
:z-index="9999" class="wh-full">
|
:font="{ color: fontColor }"
|
||||||
|
:content="watermarkEnabled ? defaultSettings.watermarkContent : ''"
|
||||||
|
:z-index="9999"
|
||||||
|
class="wh-full"
|
||||||
|
>
|
||||||
<router-view />
|
<router-view />
|
||||||
</el-watermark>
|
</el-watermark>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// test
|
|
||||||
import { useAppStore, useSettingsStore } from "@/store";
|
import { useAppStore, useSettingsStore } from "@/store";
|
||||||
import defaultSettings from "@/settings";
|
import defaultSettings from "@/settings";
|
||||||
import { ThemeEnum } from "@/enums/ThemeEnum";
|
import { ThemeEnum } from "@/enums/ThemeEnum";
|
||||||
|
|||||||
@@ -9,12 +9,6 @@ const MenuApi = {
|
|||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getCashMenus() {
|
|
||||||
return request<any, CashMenu[]>({
|
|
||||||
url: `${baseURL}/list/cash`,
|
|
||||||
method: "get",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**获取所有菜单 */
|
/**获取所有菜单 */
|
||||||
getList(data: getListRequest) {
|
getList(data: getListRequest) {
|
||||||
return request<any, MenuVO[]>({
|
return request<any, MenuVO[]>({
|
||||||
@@ -54,13 +48,6 @@ const MenuApi = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default MenuApi;
|
export default MenuApi;
|
||||||
export interface CashMenu {
|
|
||||||
component?: null | string;
|
|
||||||
menuId: number;
|
|
||||||
name: null | string;
|
|
||||||
path?: null | string;
|
|
||||||
[property: string]: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** RouteVO,路由对象 */
|
/** RouteVO,路由对象 */
|
||||||
export interface RouteVO {
|
export interface RouteVO {
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ const RoleApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取角色对应的菜单id
|
// 获取角色对应的菜单id
|
||||||
getMenu(id: number, type: number = 0) {
|
getMenu(id: number) {
|
||||||
return request<any, any[]>({
|
return request<any, any[]>({
|
||||||
url: `${baseURL}/menu`,
|
url: `${baseURL}/menu`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: { id, type },
|
params: { id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,19 +10,6 @@ const ShopApi = {
|
|||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getBranchList(params: PageQuery) {
|
|
||||||
return request<any, ShopInfoEditDTO[]>({
|
|
||||||
url: `${baseURL}/branchList`,
|
|
||||||
method: "get",
|
|
||||||
params: params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getBranchChange(id: PageQuery) {
|
|
||||||
return request<any, ShopInfoEditDTO[]>({
|
|
||||||
url: `${baseURL}/change/${id}`,
|
|
||||||
method: "post",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
add(data: ShopInfoEditDTO) {
|
add(data: ShopInfoEditDTO) {
|
||||||
return request<any, ShopInfoEditDTO>({
|
return request<any, ShopInfoEditDTO>({
|
||||||
url: `${baseURL}`,
|
url: `${baseURL}`,
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
import request from "@/utils/request";
|
|
||||||
import { Account_BaseUrl } from "@/api/config";
|
|
||||||
const baseURL = Account_BaseUrl + "/admin/shop/branch";
|
|
||||||
|
|
||||||
const ShopBranchApi = {
|
|
||||||
getList(params: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/page`,
|
|
||||||
method: "get",
|
|
||||||
params
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getDataSync(params: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/get/dataSyncMethod`,
|
|
||||||
method: "get",
|
|
||||||
params
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setDataSync(id: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/setting/dataSyncMethod?dataSyncMethod=${id}`,
|
|
||||||
method: "post",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
dataSync(id: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/data/sync/enable?branchShopId=${id}`,
|
|
||||||
method: "post",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
enable(id: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/account/enable?branchShopId=${id}`,
|
|
||||||
method: "post",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
disable(id: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/account/disable?branchShopId=${id}`,
|
|
||||||
method: "post",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export interface Responseres {
|
|
||||||
code?: number | null;
|
|
||||||
data?: any;
|
|
||||||
msg?: null | string;
|
|
||||||
[property: string]: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ShopBranchApi;
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import request from "@/utils/request";
|
|
||||||
import { Account_BaseUrl } from "@/api/config";
|
|
||||||
const baseURL = Account_BaseUrl + "/admin";
|
|
||||||
// 供应商
|
|
||||||
const Api = {
|
|
||||||
/** 通知消息列表*/
|
|
||||||
getList(params: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/syncNotice`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 全部*/
|
|
||||||
getAllList(params: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/list`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
get(id: string | number) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/` + id,
|
|
||||||
method: "get",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
add(data: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}`,
|
|
||||||
method: "post",
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
edit(data: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/syncNotice/read`,
|
|
||||||
method: "put",
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
delete(id: string | number) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/syncNotice?id=` + id,
|
|
||||||
method: "delete",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 清空已读
|
|
||||||
syncNoticeclear() {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/syncNotice/clear`,
|
|
||||||
method: "delete",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Api;
|
|
||||||
@@ -55,7 +55,7 @@ const AuthAPI = {
|
|||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 同步
|
// 退款退回
|
||||||
refundToStock(data: any) {
|
refundToStock(data: any) {
|
||||||
return request<any, Responseres>({
|
return request<any, Responseres>({
|
||||||
url: `${baseURL}/refundToStock`,
|
url: `${baseURL}/refundToStock`,
|
||||||
@@ -63,14 +63,6 @@ const AuthAPI = {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 退款退回
|
|
||||||
sync(data: any) {
|
|
||||||
return request<any, Responseres>({
|
|
||||||
url: `${baseURL}/sync`,
|
|
||||||
method: "post",
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 耗材列表
|
// 耗材列表
|
||||||
productcons(params: any) {
|
productcons(params: any) {
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
import request from "@/utils/request";
|
|
||||||
import { Product_BaseUrl } from "@/api/config";
|
|
||||||
const baseURL = Product_BaseUrl + "/admin/product";
|
|
||||||
// 供应商
|
|
||||||
const Api = {
|
|
||||||
/** 耗材库存变动记录*/
|
|
||||||
getList(params: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/stock/flow`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 全部*/
|
|
||||||
getAllList(params: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/list`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
get(id: string | number) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/` + id,
|
|
||||||
method: "get",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
add(data: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}`,
|
|
||||||
method: "post",
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
edit(data: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}`,
|
|
||||||
method: "put",
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
delete(id: string | number) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/` + id,
|
|
||||||
method: "delete",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Api;
|
|
||||||
@@ -8,7 +8,7 @@ const Api = {
|
|||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}/in`,
|
url: `${baseURL}/in`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data,
|
data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//出库
|
//出库
|
||||||
@@ -16,7 +16,7 @@ const Api = {
|
|||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}/out`,
|
url: `${baseURL}/out`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data,
|
data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 库存盘点记录
|
// 库存盘点记录
|
||||||
@@ -24,7 +24,7 @@ const Api = {
|
|||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}/checkRecord`,
|
url: `${baseURL}/checkRecord`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//库存盘点
|
//库存盘点
|
||||||
@@ -32,7 +32,7 @@ const Api = {
|
|||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}/check`,
|
url: `${baseURL}/check`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data,
|
data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//耗材报损
|
//耗材报损
|
||||||
@@ -41,7 +41,7 @@ const Api = {
|
|||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}/reportDamage`,
|
url: `${baseURL}/reportDamage`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data,
|
data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//耗材库存变动记录
|
//耗材库存变动记录
|
||||||
@@ -49,17 +49,11 @@ const Api = {
|
|||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}/flow`,
|
url: `${baseURL}/flow`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
|
||||||
},
|
|
||||||
//耗材库存变动记录
|
|
||||||
reportinglosses(data: any) {
|
|
||||||
return request<any>({
|
|
||||||
url: `${baseURL}/reportDamage`,
|
|
||||||
method: "POST",
|
|
||||||
data,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default Api;
|
export default Api;
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
import request from "@/utils/request";
|
|
||||||
const baseURL = "/product/admin/product/vendor";
|
|
||||||
|
|
||||||
// 供应商账单
|
|
||||||
|
|
||||||
const AuthAPI = {
|
|
||||||
/** 供应商账单统计*/
|
|
||||||
getSummary(params: any) {
|
|
||||||
return request<any, Responseres>({
|
|
||||||
url: `${baseURL}/summary`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 分页*/
|
|
||||||
getPage(params: any) {
|
|
||||||
return request<any, Responseres>({
|
|
||||||
url: `${baseURL}/bill`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 账单记录
|
|
||||||
getRecordList(params: any) {
|
|
||||||
return request<any, Responseres>({
|
|
||||||
url: `${baseURL}/bill/record`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 账单付款记录
|
|
||||||
getPayRecordList(params: any) {
|
|
||||||
return request<any, Responseres>({
|
|
||||||
url: `${baseURL}/bill/pay/record`,
|
|
||||||
method: "get",
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 账单付款
|
|
||||||
billPay(data: any) {
|
|
||||||
return request<any, Responseres>({
|
|
||||||
url: `${baseURL}/bill/pay`,
|
|
||||||
method: "post",
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface Responseres {
|
|
||||||
code?: number | null;
|
|
||||||
data?: any;
|
|
||||||
msg?: null | string;
|
|
||||||
[property: string]: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default AuthAPI;
|
|
||||||
@@ -246,7 +246,6 @@ export interface UserInfo {
|
|||||||
* 用户分页查询对象
|
* 用户分页查询对象
|
||||||
*/
|
*/
|
||||||
export interface UserPageQuery extends PageQuery {
|
export interface UserPageQuery extends PageQuery {
|
||||||
times: any;
|
|
||||||
/** 搜索关键字 */
|
/** 搜索关键字 */
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 900 B |
|
Before Width: | Height: | Size: 957 B |
|
Before Width: | Height: | Size: 805 B |
|
Before Width: | Height: | Size: 943 B |
|
Before Width: | Height: | Size: 895 B |
|
Before Width: | Height: | Size: 947 B |
|
Before Width: | Height: | Size: 945 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 1018 B |
|
Before Width: | Height: | Size: 857 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 962 B |
|
Before Width: | Height: | Size: 930 B |
|
Before Width: | Height: | Size: 930 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 792 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 777 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 857 B |
|
Before Width: | Height: | Size: 896 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 857 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 774 B |
|
Before Width: | Height: | Size: 935 B |
|
Before Width: | Height: | Size: 918 B |
@@ -10,6 +10,8 @@ defineOptions({
|
|||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { isExternal } from "@/utils/index";
|
import { isExternal } from "@/utils/index";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -515,7 +515,6 @@ import {
|
|||||||
import ExcelJS from "exceljs";
|
import ExcelJS from "exceljs";
|
||||||
import { reactive, ref } from "vue";
|
import { reactive, ref } from "vue";
|
||||||
import type { IContentConfig, IObject, IOperatData } from "./types";
|
import type { IContentConfig, IObject, IOperatData } from "./types";
|
||||||
import { el } from "element-plus/es/locale";
|
|
||||||
|
|
||||||
// 定义接收的属性
|
// 定义接收的属性
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -593,45 +592,6 @@ const selectionData = ref<IObject[]>([]);
|
|||||||
// 删除ID集合 用于批量删除
|
// 删除ID集合 用于批量删除
|
||||||
const removeIds = ref<(number | string)[]>([]);
|
const removeIds = ref<(number | string)[]>([]);
|
||||||
function handleSelectionChange(selection: any[]) {
|
function handleSelectionChange(selection: any[]) {
|
||||||
console.log("selectionData.value", selectionData.value);
|
|
||||||
|
|
||||||
// if(selection.length==0){
|
|
||||||
// selectionData.value=selectionData.value.filter((item) => {
|
|
||||||
// return pageData.value.find(v=>v[pk]===item[pk])!=undefined
|
|
||||||
// });
|
|
||||||
// }else{
|
|
||||||
// selectionData.value=selectionData.value.filter((item) => {
|
|
||||||
// return pageData.value.find(v=>v[pk]===item[pk])==undefined
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
//之前有选中,现在置空
|
|
||||||
if (selection.length == 0 && selectionData.value.length > 0) {
|
|
||||||
defaultSelData.value = defaultSelData.value.filter((item) => {
|
|
||||||
return pageData.value.find((v) => v[pk] === item[pk]) != undefined;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//之前没有选中,现在有
|
|
||||||
if (selection.length > 0 && selectionData.value.length == 0) {
|
|
||||||
defaultSelData.value = selection;
|
|
||||||
}
|
|
||||||
//之前有选中,现在有
|
|
||||||
if (selection.length > 0 && selectionData.value.length > 0) {
|
|
||||||
defaultSelData.value = defaultSelData.value.filter((item) => {
|
|
||||||
const isNowPageData = pageData.value.find((v) => v[pk] === item[pk]);
|
|
||||||
if (isNowPageData) {
|
|
||||||
return selection.find((v) => v[pk] === item[pk]) != undefined;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
for (let i of selection) {
|
|
||||||
if (defaultSelData.value.find((v) => v[pk] === i[pk]) == undefined) {
|
|
||||||
defaultSelData.value.push(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log("defaultSelData.value", defaultSelData.value);
|
|
||||||
selectionData.value = selection;
|
selectionData.value = selection;
|
||||||
removeIds.value = selection.map((item) => item[pk]);
|
removeIds.value = selection.map((item) => item[pk]);
|
||||||
}
|
}
|
||||||
@@ -1030,9 +990,6 @@ function fetchPageData(formData: IObject = {}, isRestart = false) {
|
|||||||
} else {
|
} else {
|
||||||
pageData.value = data;
|
pageData.value = data;
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
|
||||||
setSelectTable(defaultSelData.value);
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -1073,42 +1030,14 @@ function saveXlsx(fileData: BlobPart, fileName: string) {
|
|||||||
document.body.removeChild(downloadLink);
|
document.body.removeChild(downloadLink);
|
||||||
window.URL.revokeObjectURL(downloadUrl);
|
window.URL.revokeObjectURL(downloadUrl);
|
||||||
}
|
}
|
||||||
function test(rows: any[]) {}
|
function test(rows: any[]) {
|
||||||
|
console.log(tableRef, "tioshi222222222222222222222");
|
||||||
const defaultSelData = ref<IObject[]>([]);
|
// rows.forEach((row) => {
|
||||||
// 设置默认选择
|
// tableRef.value!.toggleRowSelection(row, undefined)
|
||||||
function setSelectTable(rows: any[]) {
|
// })
|
||||||
selectionData.value = rows;
|
|
||||||
defaultSelData.value = rows;
|
|
||||||
pageData.value.forEach((element: IObject) => {
|
|
||||||
rows.forEach((row) => {
|
|
||||||
if (element.id == row.id) {
|
|
||||||
console.log("selected", element);
|
|
||||||
tableRef.value!.toggleRowSelection(element, true);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//清除选中
|
|
||||||
function clearSelectTable() {
|
|
||||||
selectionData.value = [];
|
|
||||||
defaultSelData.value = [];
|
|
||||||
pageData.value.forEach((element: IObject) => {
|
|
||||||
tableRef.value!.toggleRowSelection(element, false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 暴露的属性和方法
|
// 暴露的属性和方法
|
||||||
defineExpose({
|
defineExpose({ fetchPageData, exportPageData, getFilterParams, getselectTable, pagination, test });
|
||||||
clearSelectTable,
|
|
||||||
fetchPageData,
|
|
||||||
exportPageData,
|
|
||||||
getFilterParams,
|
|
||||||
getselectTable,
|
|
||||||
pagination,
|
|
||||||
test,
|
|
||||||
setSelectTable,
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1,44 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" :title="props.title" :width="props.width" @close="close">
|
<el-dialog v-model="dialogVisible" :title="props.title" :width="props.width">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="close">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="Confirm">确定</el-button>
|
<el-button type="primary" @click="Confirm">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue'
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
let props = defineProps({
|
let props = defineProps({
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "Dialog",
|
default: 'Dialog'
|
||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "30%",
|
default: '30%'
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
const emit = defineEmits(["confirm", "close"]);
|
const emit = defineEmits(['confirm'])
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false)
|
||||||
|
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function Confirm() {
|
function Confirm() {
|
||||||
emit("confirm");
|
emit('confirm')
|
||||||
}
|
}
|
||||||
function close() {
|
function close() {
|
||||||
dialogVisible.value = false;
|
dialogVisible.value = false
|
||||||
emit("close");
|
|
||||||
}
|
}
|
||||||
defineExpose({ open, close });
|
defineExpose({ open, close })
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.dialog-footer button:first-child {
|
.dialog-footer button:first-child {
|
||||||
|
|||||||
@@ -1,98 +0,0 @@
|
|||||||
//收银机菜单列表
|
|
||||||
export const casher_windows_menus = [
|
|
||||||
{
|
|
||||||
title: '销售汇总',
|
|
||||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
|
||||||
pageUrl: 'PAGES_SALES_SUMMARY'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '代客下单',
|
|
||||||
icon: '/static/indexImg/icon-substitute-ordering.svg',
|
|
||||||
pageUrl: 'PAGES_CREATE_ORDER',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '桌台',
|
|
||||||
icon: '/static/indexImg/icon-table.svg',
|
|
||||||
pageUrl: 'PAGES_TABLE'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '商品管理',
|
|
||||||
icon: '/static/indexImg/icon-product-control.svg',
|
|
||||||
pageUrl: 'PAGES_PRODUCT'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '分组管理',
|
|
||||||
icon: '/static/indexImg/goods-group.svg',
|
|
||||||
pageUrl: 'PAGES_GOODS_GROUP'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '分类管理',
|
|
||||||
icon: '/static/indexImg/icon-category.svg',
|
|
||||||
pageUrl: 'PAGES_CATEGORY'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '会员管理',
|
|
||||||
icon: '/static/indexImg/icon-user.svg',
|
|
||||||
pageUrl: 'PAGES_USER_CONTROL'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '员工管理',
|
|
||||||
icon: '/static/indexImg/icon-staff.svg',
|
|
||||||
pageUrl: 'PAGES_STAFF'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '耗材管理',
|
|
||||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
|
||||||
pageUrl: 'PAGES_SALES_CONSUMABLES'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '订单管理',
|
|
||||||
icon: '/static/indexImg/icon-order.svg',
|
|
||||||
pageUrl: 'PAGES_ORDER_INDEX'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '设备管理',
|
|
||||||
icon: '/static/indexImg/icon-printer.svg',
|
|
||||||
pageUrl: 'PAGES_PRINTER_INDEX'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '交班',
|
|
||||||
icon: '/static/indexImg/icon-work.svg',
|
|
||||||
pageUrl: 'PAGES_WORK_INDEX'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '排队',
|
|
||||||
icon: '/static/indexImg/icon-line-up.svg',
|
|
||||||
pageUrl: 'PAGES_LINE_UP'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '霸王餐',
|
|
||||||
icon: '/static/indexImg/icon-bwc.svg',
|
|
||||||
pageUrl: 'PAGES_BWC'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '优惠券',
|
|
||||||
icon: '/static/coupon/icon_coupon.svg',
|
|
||||||
pageUrl: 'PAGES_COUPON_INDEX'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '订阅通知',
|
|
||||||
icon: '/static/indexImg/icon-notification.svg',
|
|
||||||
pageUrl: 'PAGES_NOTIFICATION_INDEX'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '挂账管理',
|
|
||||||
icon: '/static/indexImg/icon_credit.svg',
|
|
||||||
pageUrl: 'PAGES_CREDIT_BUYER_INDEX'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '核销管理',
|
|
||||||
icon: '/static/indexImg/pagewriteoff.svg',
|
|
||||||
pageUrl: 'PAGES_WEITEOFF'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '退出登录',
|
|
||||||
icon: '/static/indexImg/icon-login-out.svg',
|
|
||||||
pageUrl: 'PAGES_LOGIN',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,70 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="logo wh-full flex-center">
|
<div class="logo">
|
||||||
<!-- <transition name="el-fade-in-linear" mode="out-in"> -->
|
<transition name="el-fade-in-linear" mode="out-in">
|
||||||
<!-- <router-link :key="+collapse" class="wh-full flex-center" to="/"> -->
|
<router-link :key="+collapse" class="wh-full flex-center" to="/">
|
||||||
<img :src="state.userInfo.logo" class="w20px h20px" />
|
<img :src="userStore.userInfo.logo" class="w20px h20px" />
|
||||||
<!-- <span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span> -->
|
<span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span>
|
||||||
<el-dropdown trigger="click" @command="handleCommand">
|
</router-link>
|
||||||
<div class="el-dropdown-link" style="display: flex;">
|
</transition>
|
||||||
<div v-if="!collapse" class="title">{{ state.shopName }}</div>
|
|
||||||
<el-icon class="el-icon--right" v-if="loginType == 0">
|
|
||||||
<arrow-down />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
|
||||||
<template #dropdown>
|
|
||||||
<el-dropdown-menu v-if="loginType == 0">
|
|
||||||
<el-dropdown-item :command="item.shopId" v-for="(item, index) in state.branchList" :key="index"> {{
|
|
||||||
item.shopName }}</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</template>
|
|
||||||
</el-dropdown>
|
|
||||||
<!-- </router-link> -->
|
|
||||||
<!-- </transition> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script lang="ts" setup>
|
||||||
import defaultSettings from "@/settings";
|
import defaultSettings from "@/settings";
|
||||||
import { useUserStore } from "@/store";
|
import { useUserStore } from "@/store";
|
||||||
import ShopApi from "@/api/account/shop";
|
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const state = reactive({
|
|
||||||
branchList: [],
|
|
||||||
userInfo: useUserStore().userInfo,
|
|
||||||
shopName: useUserStore().userInfo.shopName
|
|
||||||
});
|
|
||||||
const loginType = ref(localStorage.getItem("loginType"))
|
|
||||||
onMounted(() => {
|
|
||||||
geiShopList()
|
|
||||||
});
|
|
||||||
async function geiShopList() {
|
|
||||||
let res = await ShopApi.getBranchList()
|
|
||||||
state.branchList = res;
|
|
||||||
if (!localStorage.getItem("shopName")) {
|
|
||||||
state.shopName = state.branchList[0].shopName
|
|
||||||
localStorage.setItem("branch_shopId", state.branchList[0].id)
|
|
||||||
localStorage.setItem("shopName", state.branchList[0].shopName)
|
|
||||||
} else {
|
|
||||||
state.shopName = localStorage.getItem("shopName")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
async function handleCommand(command) {
|
|
||||||
console.log(command)
|
|
||||||
let res = state.branchList.filter(v => v.shopId == command)[0]
|
|
||||||
// localStorage.getItem("shopId")
|
|
||||||
if (localStorage.getItem("shopId") == command) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
await ShopApi.getBranchChange(res.shopId)
|
|
||||||
// localStorage.setItem("branch_shopId", res.shopId)
|
|
||||||
localStorage.setItem("shopName", res.shopName)
|
|
||||||
state.shopName = res.shopName
|
|
||||||
location.reload()
|
|
||||||
console.log(res)
|
|
||||||
console.log(command)
|
|
||||||
}
|
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
collapse: {
|
collapse: {
|
||||||
@@ -79,18 +28,16 @@ defineProps({
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: $navbar-height;
|
height: $navbar-height;
|
||||||
background-color: $sidebar-logo-background;
|
background-color: $sidebar-logo-background;
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0; /* 防止容器在空间不足时缩小 */
|
||||||
/* 防止容器在空间不足时缩小 */
|
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #5a5e66;
|
color: #5a5e66;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
max-width: 100px;
|
max-width: 150px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,31 +29,13 @@
|
|||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</AppLink>
|
</AppLink>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.children && hasOneShowingChild(item.children, item)">
|
|
||||||
<AppLink
|
|
||||||
v-if="onlyOneChild.meta"
|
|
||||||
:to="{
|
|
||||||
path: resolvePath(onlyOneChild.path),
|
|
||||||
query: onlyOneChild.meta.params,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<el-menu-item
|
|
||||||
:index="resolvePath(onlyOneChild.path)"
|
|
||||||
:class="{ 'one-menu submenu-title-noDropdown': !isNest }"
|
|
||||||
>
|
|
||||||
<SidebarMenuItemTitle
|
|
||||||
:icon="onlyOneChild.meta.icon || item.meta?.icon"
|
|
||||||
:title="onlyOneChild.meta.title"
|
|
||||||
/>
|
|
||||||
</el-menu-item>
|
|
||||||
</AppLink>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!--【非叶子节点】显示含多个子节点的父菜单,或始终显示的单子节点 -->
|
<!--【非叶子节点】显示含多个子节点的父菜单,或始终显示的单子节点 -->
|
||||||
<el-sub-menu v-else :index="resolvePath(item.path)" teleported>
|
<el-sub-menu v-else :index="resolvePath(item.path)" teleported>
|
||||||
<template #title>
|
<template #title>
|
||||||
<SidebarMenuItemTitle v-if="item.meta" :icon="item.meta.icon" :title="item.meta.title" />
|
<SidebarMenuItemTitle v-if="item.meta" :icon="item.meta.icon" :title="item.meta.title" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<SidebarMenuItem
|
<SidebarMenuItem
|
||||||
v-for="child in item.children"
|
v-for="child in item.children"
|
||||||
:key="child.path"
|
:key="child.path"
|
||||||
@@ -113,10 +95,6 @@ const onlyOneChild = ref();
|
|||||||
* @returns 是否仅有一个可见子节点
|
* @returns 是否仅有一个可见子节点
|
||||||
*/
|
*/
|
||||||
function hasOneShowingChild(children: RouteRecordRaw[] = [], parent: RouteRecordRaw) {
|
function hasOneShowingChild(children: RouteRecordRaw[] = [], parent: RouteRecordRaw) {
|
||||||
if (parent.name == "marketing_center") {
|
|
||||||
console.log(children);
|
|
||||||
console.log(parent);
|
|
||||||
}
|
|
||||||
// 过滤出可见子节点
|
// 过滤出可见子节点
|
||||||
const showingChildren = children.filter((route: RouteRecordRaw) => {
|
const showingChildren = children.filter((route: RouteRecordRaw) => {
|
||||||
if (!route.meta?.hidden) {
|
if (!route.meta?.hidden) {
|
||||||
@@ -223,7 +201,4 @@ function resolvePath(routePath: string) {
|
|||||||
.el-menu-item {
|
.el-menu-item {
|
||||||
color: rgb(153, 153, 153);
|
color: rgb(153, 153, 153);
|
||||||
}
|
}
|
||||||
.one-menu {
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import NavbarRight from "../NavBar/components/NavbarRight.vue";
|
|||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
const permissionStore = usePermissionStore();
|
const permissionStore = usePermissionStore();
|
||||||
console.log(permissionStore.routes);
|
|
||||||
const sidebarLogo = computed(() => settingsStore.sidebarLogo);
|
const sidebarLogo = computed(() => settingsStore.sidebarLogo);
|
||||||
const layout = computed(() => settingsStore.layout);
|
const layout = computed(() => settingsStore.layout);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { App } from "vue";
|
import type { App } from "vue";
|
||||||
import { createRouter, createWebHashHistory, createWebHistory, type RouteRecordRaw } from "vue-router";
|
import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
|
||||||
|
|
||||||
export const Layout = () => import("@/layout/index.vue");
|
export const Layout = () => import("@/layout/index.vue");
|
||||||
|
|
||||||
@@ -63,6 +63,38 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "credit",
|
||||||
|
name: "",
|
||||||
|
component: () => import("@/views/data/credit/index.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "挂账管理",
|
||||||
|
affix: false,
|
||||||
|
keepAlive: true,
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "credit-detail",
|
||||||
|
name: "",
|
||||||
|
component: () => import("@/views/data/credit/detail.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "挂账明细",
|
||||||
|
affix: false,
|
||||||
|
keepAlive: true,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "work",
|
||||||
|
name: "",
|
||||||
|
component: () => import("@/views/data/work.vue"),
|
||||||
|
meta: {
|
||||||
|
title: "交班记录",
|
||||||
|
affix: false,
|
||||||
|
keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "401",
|
path: "401",
|
||||||
component: () => import("@/views/error/401.vue"),
|
component: () => import("@/views/error/401.vue"),
|
||||||
@@ -441,6 +473,7 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
|
|
||||||
// /**列表end */
|
// /**列表end */
|
||||||
|
|
||||||
|
|
||||||
// ],
|
// ],
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
@@ -676,7 +709,7 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
* 创建路由
|
* 创建路由
|
||||||
*/
|
*/
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHashHistory(),
|
||||||
routes: constantRoutes,
|
routes: constantRoutes,
|
||||||
// 刷新时,滚动条位置还原
|
// 刷新时,滚动条位置还原
|
||||||
scrollBehavior: () => ({ left: 0, top: 0 }),
|
scrollBehavior: () => ({ left: 0, top: 0 }),
|
||||||
|
|||||||
@@ -22,11 +22,6 @@ export const useCartsStore = defineStore("carts", () => {
|
|||||||
let dinnerType = ref<string>('dine-in');
|
let dinnerType = ref<string>('dine-in');
|
||||||
|
|
||||||
|
|
||||||
//就餐模式 先付 后付
|
|
||||||
const isPayBefore = computed(() => {
|
|
||||||
return shopUser.userInfo.registerType == 'before' ? true : false;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//是否启用会员价
|
//是否启用会员价
|
||||||
const useVipPrice = computed(() => {
|
const useVipPrice = computed(() => {
|
||||||
@@ -781,7 +776,7 @@ export const useCartsStore = defineStore("carts", () => {
|
|||||||
changeTable,
|
changeTable,
|
||||||
rotTable,
|
rotTable,
|
||||||
getGoods,
|
getGoods,
|
||||||
setGoodsMap, isPayBefore
|
setGoodsMap
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -31,14 +31,13 @@ export const useUserStore = defineStore("user", () => {
|
|||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
AuthAPI.login(loginRequest)
|
AuthAPI.login(loginRequest)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
||||||
isShopAdmin.value = data.loginType == 0 ? true : false;
|
isShopAdmin.value = data.loginType == 0 ? true : false;
|
||||||
Object.assign(userInfo.value, { ...data.shopInfo, shopId: data.shopInfo.id });
|
Object.assign(userInfo.value, { ...data.shopInfo, shopId: data.shopInfo.id });
|
||||||
promissionList.value = data.promissionList;
|
promissionList.value = data.promissionList;
|
||||||
const token = data.tokenInfo.tokenValue;
|
const token = data.tokenInfo.tokenValue;
|
||||||
setToken(token);
|
setToken(token);
|
||||||
setRefreshToken(token);
|
setRefreshToken(token);
|
||||||
localStorage.setItem("shopId", "" + data.shopInfo.id);
|
|
||||||
localStorage.setItem("branch_shopId", data.shopInfo.id)
|
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -52,18 +51,16 @@ export const useUserStore = defineStore("user", () => {
|
|||||||
*
|
*
|
||||||
* @returns {UserInfo} 用户信息
|
* @returns {UserInfo} 用户信息
|
||||||
*/
|
*/
|
||||||
function getUserInfo(shopId?: string | number) {
|
function getUserInfo() {
|
||||||
return new Promise<UserInfo>((resolve, reject) => {
|
return new Promise<UserInfo>((resolve, reject) => {
|
||||||
ShopApi.get({ id: shopId || userInfo.value.shopId })
|
ShopApi.get({ id: userInfo.value.shopId })
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
reject("Verification failed, please Login again.");
|
reject("Verification failed, please Login again.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(userInfo)
|
localStorage.setItem("shopId", "" + userInfo.value.shopId);
|
||||||
console.log(data)
|
Object.assign(userInfo.value, { ...data, roles: [], promissionList: [], shopId: userInfo.value.shopId });
|
||||||
localStorage.setItem("shopId", "" + data.id);
|
|
||||||
Object.assign(userInfo.value, { ...data, roles: [], promissionList: [], shopId: data.id });
|
|
||||||
resolve(userInfo.value);
|
resolve(userInfo.value);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -117,28 +117,3 @@ export function downloadFile(obj: BlobPart, name: string, suffix: string, useUni
|
|||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断主店同步是否启用
|
|
||||||
*/
|
|
||||||
export function isSyncStatus() {
|
|
||||||
let userInfo = ref(JSON.parse(localStorage.getItem('userInfo') || '{}'))
|
|
||||||
if (userInfo.value.isHeadShop == 0 && userInfo.value.isEnableProdSync == 1 && userInfo.value.isEnableVipSync == 1 && userInfo.value.isEnableConsSync == 1) {
|
|
||||||
return true
|
|
||||||
}else {
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ service.interceptors.request.use(
|
|||||||
} else {
|
} else {
|
||||||
delete config.headers.token;
|
delete config.headers.token;
|
||||||
}
|
}
|
||||||
// config.headers.shopId = config.headers.shopId || localStorage.getItem("branch_shopId");
|
|
||||||
config.headers.shopId = config.headers.shopId || useUserStoreHook().userInfo.id;
|
config.headers.shopId = config.headers.shopId || useUserStoreHook().userInfo.id;
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
}"
|
}"
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
>
|
>
|
||||||
<el-table-column label="菜单名称" min-width="140">
|
<el-table-column label="菜单名称" min-width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.title }}
|
{{ scope.row.title }}
|
||||||
</template>
|
</template>
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
<el-radio :value="2">接口</el-radio>
|
<el-radio :value="2">接口</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否外链" >
|
<el-form-item label="是否外链" prop="path">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="formData.iFrame"
|
v-model="formData.iFrame"
|
||||||
:active-value="1"
|
:active-value="1"
|
||||||
@@ -233,49 +233,6 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="小程序路径" prop="miniPath">
|
|
||||||
<el-input v-model="formData.miniPath" placeholder="pages/index/index" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="小程序组件" prop="miniComponent">
|
|
||||||
<el-input v-model="formData.miniComponent" placeholder="小程序组件名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="小程序图标">
|
|
||||||
<single-image-upload
|
|
||||||
style="width: 100px; height: 100px"
|
|
||||||
v-model="formData.miniIcon"
|
|
||||||
></single-image-upload>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="接口路径" prop="miniPage">
|
|
||||||
<div class="w-full">
|
|
||||||
<div>
|
|
||||||
<el-button @click="apiInfoPush" icon="plus" type="primary">添加</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="u-flex u-m-t-10" v-for="(item, index) in formData.apiInfo" :key="index">
|
|
||||||
<el-form-item label="请求方式" label-position="left">
|
|
||||||
<el-select v-model="item.method" style="width: 100px">
|
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in apiMethodOptions"
|
|
||||||
:key="index"
|
|
||||||
:value="item.value"
|
|
||||||
>
|
|
||||||
{{ item.label }}
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="接口地址" style="flex: 1">
|
|
||||||
<el-input v-model="item.url" placeholder="支持通配符*和?" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-icon
|
|
||||||
style="margin-left: 10px"
|
|
||||||
size="20"
|
|
||||||
color="#F56c6c"
|
|
||||||
@click="formData.apiInfo.splice(index, 1)"
|
|
||||||
>
|
|
||||||
<RemoveFilled />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="formData.type !== MenuTypeEnum.BUTTON" prop="hidden" label="显示状态">
|
<el-form-item v-if="formData.type !== MenuTypeEnum.BUTTON" prop="hidden" label="显示状态">
|
||||||
<el-radio-group v-model="formData.hidden">
|
<el-radio-group v-model="formData.hidden">
|
||||||
<el-radio :value="1">隐藏</el-radio>
|
<el-radio :value="1">隐藏</el-radio>
|
||||||
@@ -345,19 +302,7 @@ const dialog = reactive({
|
|||||||
title: "新增菜单",
|
title: "新增菜单",
|
||||||
visible: false,
|
visible: false,
|
||||||
});
|
});
|
||||||
const apiMethodOptions = ref([
|
|
||||||
{ value: "All", label: "All" },
|
|
||||||
{ value: "GET", label: "GET" },
|
|
||||||
{ value: "POST", label: "POST" },
|
|
||||||
{ value: "PUT", label: "PUT" },
|
|
||||||
{ value: "DELETE", label: "DELETE" },
|
|
||||||
]);
|
|
||||||
function apiInfoPush() {
|
|
||||||
if (!formData.value.apiInfo) {
|
|
||||||
formData.value.apiInfo = [];
|
|
||||||
}
|
|
||||||
formData.value.apiInfo.push({ method: "All", url: "" });
|
|
||||||
}
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
const queryParams = reactive<getListRequest>({});
|
const queryParams = reactive<getListRequest>({});
|
||||||
// 菜单表格数据
|
// 菜单表格数据
|
||||||
@@ -381,10 +326,6 @@ const initialeditRequestData = ref<editRequest>({
|
|||||||
path: "",
|
path: "",
|
||||||
component: "",
|
component: "",
|
||||||
name: "",
|
name: "",
|
||||||
miniPath: "",
|
|
||||||
miniComponent: "",
|
|
||||||
miniIcon: "",
|
|
||||||
apiInfo: [],
|
|
||||||
});
|
});
|
||||||
// 菜单表单数据
|
// 菜单表单数据
|
||||||
const formData = ref({ ...initialeditRequestData.value });
|
const formData = ref({ ...initialeditRequestData.value });
|
||||||
@@ -473,7 +414,6 @@ function handleOpenDialog(pid?: string, menuId?: string) {
|
|||||||
path: data.path || "", // Ensure path is always a string
|
path: data.path || "", // Ensure path is always a string
|
||||||
title: data.title || "", // Ensure title is always a string
|
title: data.title || "", // Ensure title is always a string
|
||||||
type: data.type ?? 0, // Ensure type is always a number
|
type: data.type ?? 0, // Ensure type is always a number
|
||||||
apiInfo: data.apiInfo ? JSON.parse(data.apiInfo) : [],
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -28,8 +28,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-tree ref="permTreeRef" node-key="value" show-checkbox :data="menuPermOptions"
|
<el-tree
|
||||||
:filter-node-method="handlePermFilter" :default-expand-all="true" :check-strictly="!parentChildLinked" class="mt-5">
|
ref="permTreeRef"
|
||||||
|
node-key="value"
|
||||||
|
show-checkbox
|
||||||
|
:data="menuPermOptions"
|
||||||
|
:filter-node-method="handlePermFilter"
|
||||||
|
:default-expand-all="true"
|
||||||
|
:check-strictly="!parentChildLinked"
|
||||||
|
class="mt-5"
|
||||||
|
>
|
||||||
<template #default="{ data }">
|
<template #default="{ data }">
|
||||||
{{ data.label }}
|
{{ data.label }}
|
||||||
</template>
|
</template>
|
||||||
@@ -114,6 +122,7 @@ function reset() {
|
|||||||
}
|
}
|
||||||
function setChecked(checkedMenuIds) {
|
function setChecked(checkedMenuIds) {
|
||||||
checkedMenuIds.forEach((menuId) => {
|
checkedMenuIds.forEach((menuId) => {
|
||||||
|
console.log(menuId);
|
||||||
permTreeRef.value.setChecked(menuId, true, false);
|
permTreeRef.value.setChecked(menuId, true, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,10 +108,10 @@
|
|||||||
<el-form-item label="描述" prop="description">
|
<el-form-item label="描述" prop="description">
|
||||||
<el-input type="textarea" v-model="formData.description" placeholder="描述" />
|
<el-input type="textarea" v-model="formData.description" placeholder="描述" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-alert title="角色菜单请点击角色列表的分配菜单按钮编辑" type="success" effect="dark" />
|
|
||||||
<!-- <el-form-item label="菜单分配" prop="menuIdList">
|
<el-form-item label="菜单分配" prop="menuIdList">
|
||||||
<menuSelect ref="refmenuSelect" v-model="formData.menuIdList"></menuSelect>
|
<menuSelect ref="refmenuSelect" v-model="formData.menuIdList"></menuSelect>
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -123,22 +123,11 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 分配菜单弹窗 -->
|
<!-- 分配菜单弹窗 -->
|
||||||
<el-drawer v-model="assignPermDialogVisible" size="500">
|
<el-drawer
|
||||||
<template #header>
|
v-model="assignPermDialogVisible"
|
||||||
<div>
|
:title="'【' + checkedRole.name + '】菜单分配'"
|
||||||
<div>
|
size="500"
|
||||||
<h3>
|
>
|
||||||
{{ "【" + checkedRole.name + "】菜单分配" }}
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-form-item label="平台类型">
|
|
||||||
<el-radio-group v-model="platformType" @change="handlePlatformTypeChange">
|
|
||||||
<el-radio :value="0">管理端</el-radio>
|
|
||||||
<el-radio :value="1">收银机</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<div class="flex-x-between">
|
<div class="flex-x-between">
|
||||||
<el-input v-model="permKeywords" clearable class="w-[150px]" placeholder="菜单菜单名称">
|
<el-input v-model="permKeywords" clearable class="w-[150px]" placeholder="菜单菜单名称">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
@@ -171,15 +160,12 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="u-relative" style="overflow-x: hidden">
|
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="permTreeRef"
|
ref="permTreeRef"
|
||||||
node-key="value"
|
node-key="value"
|
||||||
show-checkbox
|
show-checkbox
|
||||||
:data="menuPermOptions"
|
:data="menuPermOptions"
|
||||||
:default-checked-keys="adminMenuIdList"
|
|
||||||
:filter-node-method="handlePermFilter"
|
:filter-node-method="handlePermFilter"
|
||||||
:default-expand-all="true"
|
:default-expand-all="true"
|
||||||
:check-strictly="!parentChildLinked"
|
:check-strictly="!parentChildLinked"
|
||||||
@@ -189,24 +175,6 @@
|
|||||||
{{ data.label }}
|
{{ data.label }}
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
<div
|
|
||||||
class="cashMenuIdList"
|
|
||||||
:style="{
|
|
||||||
transform: `translateX(${(platformType == 1 ? 0 : 1) * 100}%)`,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<el-checkbox-group v-model="cashMenuIdList">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="(item, index) in casher_windows_menus"
|
|
||||||
:key="index"
|
|
||||||
:value="item.menuId"
|
|
||||||
>
|
|
||||||
{{ item.name }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" @click="handleAssignPermSubmit">确 定</el-button>
|
<el-button type="primary" @click="handleAssignPermSubmit">确 定</el-button>
|
||||||
@@ -223,11 +191,11 @@ defineOptions({
|
|||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
});
|
});
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
// import { casher_windows_menus } from "@/data/menus";
|
|
||||||
const shopUser = useUserStore();
|
const shopUser = useUserStore();
|
||||||
import menuSelect from "./components/menus.vue";
|
import menuSelect from "./components/menus.vue";
|
||||||
import RoleApi, { SysRole, addRequest, getListRequest } from "@/api/account/role";
|
import RoleApi, { SysRole, addRequest, getListRequest } from "@/api/account/role";
|
||||||
import MenuAPI, { type RouteVO, CashMenu } from "@/api/account/menu";
|
import MenuAPI, { type RouteVO } from "@/api/account/menu";
|
||||||
|
|
||||||
const queryFormRef = ref();
|
const queryFormRef = ref();
|
||||||
const addRequestRef = ref();
|
const addRequestRef = ref();
|
||||||
@@ -253,7 +221,6 @@ const menuPermOptions = ref<RouteVO[]>([]);
|
|||||||
const dialog = reactive({
|
const dialog = reactive({
|
||||||
title: "",
|
title: "",
|
||||||
visible: false,
|
visible: false,
|
||||||
row: {},
|
|
||||||
});
|
});
|
||||||
// 角色表单
|
// 角色表单
|
||||||
const formData = reactive<addRequest>({
|
const formData = reactive<addRequest>({
|
||||||
@@ -265,7 +232,7 @@ const formData = reactive<addRequest>({
|
|||||||
menuIdList: [],
|
menuIdList: [],
|
||||||
description: "",
|
description: "",
|
||||||
});
|
});
|
||||||
const cashMenuIdList = ref<number[]>([]);
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
|
name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
|
||||||
level: [{ required: false, message: "请输入角色等级", trigger: "blur" }],
|
level: [{ required: false, message: "请输入角色等级", trigger: "blur" }],
|
||||||
@@ -284,14 +251,6 @@ const isExpanded = ref(true);
|
|||||||
|
|
||||||
const parentChildLinked = ref(false);
|
const parentChildLinked = ref(false);
|
||||||
|
|
||||||
const platformType = ref(0);
|
|
||||||
function handlePlatformTypeChange(e: string | number | boolean | undefined) {
|
|
||||||
const value = Number(e); // Ensure the value is cast to a number
|
|
||||||
console.log("handlePlatformTypeChange");
|
|
||||||
platformType.value = value;
|
|
||||||
handleOpenAssignPermDialog(dialog.row);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询
|
// 查询
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -322,16 +281,15 @@ function handleSelectionChange(selection: any) {
|
|||||||
// 打开角色弹窗
|
// 打开角色弹窗
|
||||||
async function handleOpenDialog(row: SysRole) {
|
async function handleOpenDialog(row: SysRole) {
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
dialog.row = row;
|
|
||||||
if (row && row.id) {
|
if (row && row.id) {
|
||||||
dialog.title = "修改角色";
|
dialog.title = "修改角色";
|
||||||
//获取角色菜单列表
|
//获取角色菜单列表
|
||||||
const data = await RoleApi.getMenu(row.id, platformType.value);
|
const data = await RoleApi.getMenu(row.id);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
Object.assign(formData, row);
|
Object.assign(formData, row);
|
||||||
formData.menuIdList = data;
|
formData.menuIdList = data;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// refmenuSelect.value.setChecked(data);
|
refmenuSelect.value.setChecked(data);
|
||||||
}, 300);
|
}, 300);
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
} else {
|
} else {
|
||||||
@@ -343,12 +301,11 @@ async function handleOpenDialog(row: SysRole) {
|
|||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
addRequestRef.value.validate((valid: any) => {
|
addRequestRef.value.validate((valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// const checkedMenuIds: number[] = refmenuSelect.value.getPerms();
|
const checkedMenuIds: number[] = refmenuSelect.value.getPerms();
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const roleId = formData.id;
|
const roleId = formData.id;
|
||||||
if (roleId) {
|
if (roleId) {
|
||||||
// RoleApi.update(roleId, { ...formData, menuIdList: checkedMenuIds })
|
RoleApi.update(roleId, { ...formData, menuIdList: checkedMenuIds })
|
||||||
RoleApi.update(roleId, formData)
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
ElMessage.success("修改成功");
|
ElMessage.success("修改成功");
|
||||||
handleCloseDialog();
|
handleCloseDialog();
|
||||||
@@ -372,9 +329,9 @@ function handleSubmit() {
|
|||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
function handleCloseDialog() {
|
function handleCloseDialog() {
|
||||||
addRequestRef.value?.resetFields();
|
addRequestRef.value.resetFields();
|
||||||
addRequestRef.value?.clearValidate();
|
addRequestRef.value.clearValidate();
|
||||||
refmenuSelect.value?.reset();
|
refmenuSelect.value.reset();
|
||||||
formData.id = undefined;
|
formData.id = undefined;
|
||||||
formData.sort = 1;
|
formData.sort = 1;
|
||||||
formData.status = 1;
|
formData.status = 1;
|
||||||
@@ -426,13 +383,6 @@ function returnMenu(menu) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const casher_windows_menus = ref<CashMenu[]>([]);
|
|
||||||
//获取收银机菜单
|
|
||||||
async function getCashMenus() {
|
|
||||||
const res = await MenuAPI.getCashMenus();
|
|
||||||
console.log(res);
|
|
||||||
casher_windows_menus.value = res;
|
|
||||||
}
|
|
||||||
// 获取所有的菜单
|
// 获取所有的菜单
|
||||||
async function getMenuPermOptions() {
|
async function getMenuPermOptions() {
|
||||||
let arr =
|
let arr =
|
||||||
@@ -440,43 +390,27 @@ async function getMenuPermOptions() {
|
|||||||
menuPermOptions.value = returnMenu(arr);
|
menuPermOptions.value = returnMenu(arr);
|
||||||
}
|
}
|
||||||
getMenuPermOptions();
|
getMenuPermOptions();
|
||||||
getCashMenus();
|
|
||||||
|
|
||||||
const adminMenuIdList = ref<number[]>([]);
|
|
||||||
// 打开分配菜单菜单弹窗
|
// 打开分配菜单菜单弹窗
|
||||||
async function handleOpenAssignPermDialog(row: SysRole) {
|
async function handleOpenAssignPermDialog(row: SysRole) {
|
||||||
const roleId = row.id;
|
const roleId = row.id;
|
||||||
dialog.row = row;
|
|
||||||
if (roleId) {
|
if (roleId) {
|
||||||
assignPermDialogVisible.value = true;
|
assignPermDialogVisible.value = true;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
||||||
checkedRole.value.id = roleId;
|
checkedRole.value.id = roleId;
|
||||||
checkedRole.value.name = row.name as string;
|
checkedRole.value.name = row.name as string;
|
||||||
getMenuIds(roleId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 回显角色已拥有的菜单
|
|
||||||
|
|
||||||
function getMenuIds(roleId: number) {
|
// 回显角色已拥有的菜单
|
||||||
roleId = roleId ? roleId : dialog.row.id;
|
RoleApi.getMenu(roleId)
|
||||||
if (!roleId) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RoleApi.getMenu(roleId, platformType.value)
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (platformType.value == 0) {
|
|
||||||
const checkedMenuIds = data;
|
const checkedMenuIds = data;
|
||||||
adminMenuIdList.value = data;
|
checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
||||||
// checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
|
||||||
}
|
|
||||||
if (platformType.value == 1) {
|
|
||||||
cashMenuIdList.value = data;
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 分配菜单菜单提交
|
// 分配菜单菜单提交
|
||||||
function handleAssignPermSubmit() {
|
function handleAssignPermSubmit() {
|
||||||
@@ -488,13 +422,7 @@ function handleAssignPermSubmit() {
|
|||||||
.map((node: any) => node.value);
|
.map((node: any) => node.value);
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
RoleApi.update(roleId, {
|
RoleApi.update(roleId, { name, menuIdList: checkedMenuIds })
|
||||||
name,
|
|
||||||
adminMenuIdList: checkedMenuIds,
|
|
||||||
cashMenuIdList: cashMenuIdList.value.filter((id) =>
|
|
||||||
casher_windows_menus.value.find((v) => v.menuId == id)
|
|
||||||
),
|
|
||||||
})
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
ElMessage.success("分配菜单成功");
|
ElMessage.success("分配菜单成功");
|
||||||
assignPermDialogVisible.value = false;
|
assignPermDialogVisible.value = false;
|
||||||
@@ -542,9 +470,6 @@ watch(
|
|||||||
(val) => {
|
(val) => {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
permTreeRef.value.setCheckedKeys([]);
|
permTreeRef.value.setCheckedKeys([]);
|
||||||
platformType.value = 0;
|
|
||||||
cashMenuIdList.value = [];
|
|
||||||
adminMenuIdList.value = [];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -568,14 +493,3 @@ onMounted(() => {
|
|||||||
handleQuery();
|
handleQuery();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
|
||||||
.cashMenuIdList {
|
|
||||||
position: absolute;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: var(--el-drawer-padding-primary);
|
|
||||||
inset: 0;
|
|
||||||
background-color: #fff;
|
|
||||||
z-index: 2;
|
|
||||||
transition: all 0.3s ease-in-out;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -81,7 +81,6 @@ 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
|
||||||
@@ -101,9 +100,6 @@ 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) {
|
||||||
|
|||||||
@@ -47,15 +47,11 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<div class="h_card_wrap">
|
<div class="h_card_wrap">
|
||||||
<div class="status_wrap">
|
<div class="status_wrap">
|
||||||
<div class="left" style="flex-shrink: 0">
|
<div class="left">
|
||||||
<div class="dot" />
|
<div class="dot" />
|
||||||
<span>营业</span>
|
<span>营业</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="u-flex" style="flex-wrap: wrap">
|
<div class="time_wrap u-flex">
|
||||||
<el-select v-if="isHeadShop == 1&&loginType == 0" v-model="shopId" placeholder="选择分店" style="width: 200px; margin-right: 10px;" @change="shopChange">
|
|
||||||
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
|
||||||
</el-select>
|
|
||||||
<div class="time_wrap u-flex" style="flex-shrink: 0">
|
|
||||||
<el-radio-group v-model="timeValue" class="m-r-5" @change="timeChange">
|
<el-radio-group v-model="timeValue" class="m-r-5" @change="timeChange">
|
||||||
<el-radio-button value="0">今天</el-radio-button>
|
<el-radio-button value="0">今天</el-radio-button>
|
||||||
<el-radio-button value="-1">昨天</el-radio-button>
|
<el-radio-button value="-1">昨天</el-radio-button>
|
||||||
@@ -66,10 +62,8 @@
|
|||||||
<el-radio-button value="custom">自定义</el-radio-button>
|
<el-radio-button value="custom">自定义</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div class="u-flex">
|
<div class="u-flex">
|
||||||
<el-date-picker v-if="timeValue == 'custom'" v-model="query.createdAt" type="daterange"
|
<el-date-picker v-if="timeValue == 'custom'" v-model="query.createdAt" type="daterange" range-separator="至"
|
||||||
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"
|
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD " @change="summarytrade" />
|
||||||
@change="summarytrade" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -338,7 +332,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import dataSummaryApi from "@/api/order/data-summary";
|
import dataSummaryApi from "@/api/order/data-summary";
|
||||||
import ShopApi from "@/api/account/shop";
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import { debounce, formatDecimal } from "@/utils/tools";
|
import { debounce, formatDecimal } from "@/utils/tools";
|
||||||
@@ -390,8 +383,6 @@ export default {
|
|||||||
saveAmount: null,
|
saveAmount: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
branchList: [],
|
|
||||||
shopId: null,
|
|
||||||
trade: {},
|
trade: {},
|
||||||
formatDecimal,
|
formatDecimal,
|
||||||
topData: "",
|
topData: "",
|
||||||
@@ -428,8 +419,6 @@ export default {
|
|||||||
},
|
},
|
||||||
tradeVip: "",
|
tradeVip: "",
|
||||||
tradeCount: "",
|
tradeCount: "",
|
||||||
isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop,
|
|
||||||
loginType: localStorage.getItem("loginType")
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -484,22 +473,9 @@ export default {
|
|||||||
// }
|
// }
|
||||||
}, 100);
|
}, 100);
|
||||||
window.addEventListener("resize", this.__resizeHandler);
|
window.addEventListener("resize", this.__resizeHandler);
|
||||||
this.geiShopList()
|
|
||||||
// this.initCardUserChart();
|
// this.initCardUserChart();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
|
||||||
* 获取分店列表
|
|
||||||
*/
|
|
||||||
async geiShopList() {
|
|
||||||
let res = await ShopApi.getBranchList()
|
|
||||||
this.branchList = res;
|
|
||||||
},
|
|
||||||
shopChange(){
|
|
||||||
this.summarytrade();
|
|
||||||
this.lineChartTypeChange(this.lineChartType)
|
|
||||||
this.dateProduct()
|
|
||||||
},
|
|
||||||
// 切换时间
|
// 切换时间
|
||||||
timeChange(e) {
|
timeChange(e) {
|
||||||
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
||||||
@@ -549,9 +525,7 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case "custom":
|
case "custom":
|
||||||
// 自定义
|
// 自定义
|
||||||
this.query.createdAt = [
|
this.query.createdAt = [];
|
||||||
dayjs().add(-30, "d").format(format[0]),
|
|
||||||
dayjs().format(format[1]),];
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -564,13 +538,9 @@ export default {
|
|||||||
async summarytrade() {
|
async summarytrade() {
|
||||||
try {
|
try {
|
||||||
this.tradeLoading = true;
|
this.tradeLoading = true;
|
||||||
if( this.query.createdAt[1] ){
|
|
||||||
this.query.createdAt.splice(1,1,this.query.createdAt[1].replace("00:00:00","23:59:59"))
|
|
||||||
}
|
|
||||||
const res = await dataSummaryApi.trade({
|
const res = await dataSummaryApi.trade({
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
shopId: this.shopId
|
|
||||||
});
|
});
|
||||||
this.trade = res;
|
this.trade = res;
|
||||||
this.tradeLoading = false;
|
this.tradeLoading = false;
|
||||||
@@ -894,7 +864,7 @@ export default {
|
|||||||
async dateAmount() {
|
async dateAmount() {
|
||||||
try {
|
try {
|
||||||
this.saleLoading = true;
|
this.saleLoading = true;
|
||||||
const res = await dataSummaryApi.dateAmount({ day: this.saleActive,shopId: this.shopId });
|
const res = await dataSummaryApi.dateAmount({ day: this.saleActive });
|
||||||
const data = res.total.map((item) => {
|
const data = res.total.map((item) => {
|
||||||
return {
|
return {
|
||||||
orderAmount: item.orderAmount,
|
orderAmount: item.orderAmount,
|
||||||
@@ -923,7 +893,6 @@ export default {
|
|||||||
day: this.saleTableActive,
|
day: this.saleTableActive,
|
||||||
page: this.saleTablePage,
|
page: this.saleTablePage,
|
||||||
size: this.saleTableSize,
|
size: this.saleTableSize,
|
||||||
shopId: this.shopId
|
|
||||||
});
|
});
|
||||||
this.saleTable = res.records;
|
this.saleTable = res.records;
|
||||||
this.saleTableTotal = res.totalRow * 1;
|
this.saleTableTotal = res.totalRow * 1;
|
||||||
@@ -939,7 +908,7 @@ export default {
|
|||||||
async datePayType() {
|
async datePayType() {
|
||||||
try {
|
try {
|
||||||
this.payChartLoading = true;
|
this.payChartLoading = true;
|
||||||
const res = await dataSummaryApi.datePayType({ day: this.saleActive,shopId: this.shopId });
|
const res = await dataSummaryApi.datePayType({ day: this.saleActive });
|
||||||
const data = res.countPayType.map((item) => {
|
const data = res.countPayType.map((item) => {
|
||||||
return {
|
return {
|
||||||
value: item.count,
|
value: item.count,
|
||||||
|
|||||||
@@ -10,18 +10,16 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input placeholder="商品名称" v-model="query.productName" />
|
<el-input placeholder="商品名称" v-model="query.productName" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
<el-form-item v-if="isHeadShop == 1&&loginType == 0">
|
<el-select v-model="query.prodCategoryId" placeholder="商品分类" style="width: 140px">
|
||||||
<el-select v-model="shopId" placeholder="选择分店" style="width: 200px; margin-right: 10px"
|
<el-option
|
||||||
@change="getCategory">
|
:label="item.name"
|
||||||
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
:value="item.id"
|
||||||
|
v-for="item in categorys"
|
||||||
|
:key="item.id"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item>
|
|
||||||
<el-select v-model="query.prodCategoryId" placeholder="商品分类" style="width: 140px">
|
|
||||||
<el-option :label="item.name" :value="item.id" v-for="item in categorys" :key="item.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
</template>
|
</template>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||||
@@ -34,9 +32,16 @@
|
|||||||
<el-radio-button value="month">本月</el-radio-button>
|
<el-radio-button value="month">本月</el-radio-button>
|
||||||
<el-radio-button value="custom">自定义</el-radio-button>
|
<el-radio-button value="custom">自定义</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-date-picker class="u-m-l-10" v-model="query.createdAt" type="daterange" range-separator="至"
|
<el-date-picker
|
||||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"
|
class="u-m-l-10"
|
||||||
v-if="timeValue == 'custom'"></el-date-picker>
|
v-model="query.createdAt"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
v-if="timeValue == 'custom'"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
@@ -52,9 +57,7 @@
|
|||||||
<div class="collect_wrap">
|
<div class="collect_wrap">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="icon_wrap" style="--bg-color: #c978ee">
|
<div class="icon_wrap" style="--bg-color: #c978ee">
|
||||||
<el-icon color="#fff">
|
<el-icon color="#fff"><Coin /></el-icon>
|
||||||
<Coin />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="m">¥{{ payCount.totalAmount || 0 }}</div>
|
<div class="m">¥{{ payCount.totalAmount || 0 }}</div>
|
||||||
@@ -63,9 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="icon_wrap" style="--bg-color: #c978ee">
|
<div class="icon_wrap" style="--bg-color: #c978ee">
|
||||||
<el-icon color="#fff">
|
<el-icon color="#fff"><Coin /></el-icon>
|
||||||
<Coin />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="m">¥{{ payCount.refundAmount || 0 }}</div>
|
<div class="m">¥{{ payCount.refundAmount || 0 }}</div>
|
||||||
@@ -74,9 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="icon_wrap" style="--bg-color: #c978ee">
|
<div class="icon_wrap" style="--bg-color: #c978ee">
|
||||||
<el-icon color="#fff">
|
<el-icon color="#fff"><ShoppingCartFull /></el-icon>
|
||||||
<ShoppingCartFull />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="m">{{ payCount.saleCount || 0 }}</div>
|
<div class="m">{{ payCount.saleCount || 0 }}</div>
|
||||||
@@ -85,9 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="icon_wrap" style="--bg-color: #c978ee">
|
<div class="icon_wrap" style="--bg-color: #c978ee">
|
||||||
<el-icon color="#fff">
|
<el-icon color="#fff"><ShoppingCart /></el-icon>
|
||||||
<ShoppingCart />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="m">{{ payCount.refundCount || 0 }}</div>
|
<div class="m">{{ payCount.refundCount || 0 }}</div>
|
||||||
@@ -148,9 +145,14 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-pagination :total="tableData.total" :current-page="tableData.page" :page-size="tableData.size"
|
<el-pagination
|
||||||
@current-change="paginationChange" @size-change="sizeChange"
|
:total="tableData.total"
|
||||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
:current-page="tableData.page"
|
||||||
|
:page-size="tableData.size"
|
||||||
|
@current-change="paginationChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
></el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -158,7 +160,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import saleSummaryApi from "@/api/order/sale-summary";
|
import saleSummaryApi from "@/api/order/sale-summary";
|
||||||
import categoryApi from "@/api/product/productclassification";
|
import categoryApi from "@/api/product/productclassification";
|
||||||
import ShopApi from "@/api/account/shop";
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { downloadFile } from "@/utils/index";
|
import { downloadFile } from "@/utils/index";
|
||||||
|
|
||||||
@@ -184,11 +185,6 @@ export default {
|
|||||||
downloadLoading: false,
|
downloadLoading: false,
|
||||||
payCount: "",
|
payCount: "",
|
||||||
payCountTotal: 0,
|
payCountTotal: 0,
|
||||||
branchList: [],
|
|
||||||
shopId: null,
|
|
||||||
isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop,
|
|
||||||
loginType: localStorage.getItem("loginType")
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
@@ -200,16 +196,8 @@ export default {
|
|||||||
this.resetQuery = { ...this.query };
|
this.resetQuery = { ...this.query };
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
this.getCategory();
|
this.getCategory();
|
||||||
this.geiShopList();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
|
||||||
* 获取分店列表
|
|
||||||
*/
|
|
||||||
async geiShopList() {
|
|
||||||
let res = await ShopApi.getBranchList()
|
|
||||||
this.branchList = res;
|
|
||||||
},
|
|
||||||
totalfilter(item, d) {
|
totalfilter(item, d) {
|
||||||
let num = item + d;
|
let num = item + d;
|
||||||
return num.toFixed(2);
|
return num.toFixed(2);
|
||||||
@@ -217,12 +205,10 @@ export default {
|
|||||||
// 获取商品分类
|
// 获取商品分类
|
||||||
async getCategory() {
|
async getCategory() {
|
||||||
try {
|
try {
|
||||||
this.query.prodCategoryId = ""
|
|
||||||
const res = await categoryApi.getList({
|
const res = await categoryApi.getList({
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 200,
|
size: 200,
|
||||||
orderBy: "name asc",
|
orderBy: "name asc",
|
||||||
shopId: this.shopId
|
|
||||||
});
|
});
|
||||||
this.categorys = res;
|
this.categorys = res;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -232,15 +218,12 @@ export default {
|
|||||||
// 获取订单汇总
|
// 获取订单汇总
|
||||||
async daycount() {
|
async daycount() {
|
||||||
try {
|
try {
|
||||||
if (this.query.createdAt[1]) {
|
|
||||||
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
|
||||||
}
|
|
||||||
const res = await saleSummaryApi.count({
|
const res = await saleSummaryApi.count({
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
prodCategoryId: this.query.prodCategoryId,
|
prodCategoryId: this.query.prodCategoryId,
|
||||||
productName: this.query.productName,
|
productName: this.query.productName,
|
||||||
shopId: this.shopId,
|
|
||||||
type: this.orderType,
|
type: this.orderType,
|
||||||
});
|
});
|
||||||
this.payCount = res;
|
this.payCount = res;
|
||||||
@@ -252,15 +235,11 @@ export default {
|
|||||||
async downloadHandle() {
|
async downloadHandle() {
|
||||||
try {
|
try {
|
||||||
this.downloadLoading = true;
|
this.downloadLoading = true;
|
||||||
if (this.query.createdAt[1]) {
|
|
||||||
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
|
||||||
}
|
|
||||||
const file = await saleSummaryApi.export({
|
const file = await saleSummaryApi.export({
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
prodCategoryId: this.query.prodCategoryId,
|
prodCategoryId: this.query.prodCategoryId,
|
||||||
productName: this.query.productName,
|
productName: this.query.productName,
|
||||||
shopId: this.shopId
|
|
||||||
});
|
});
|
||||||
downloadFile(file, "数据", "xlsx");
|
downloadFile(file, "数据", "xlsx");
|
||||||
this.downloadLoading = false;
|
this.downloadLoading = false;
|
||||||
@@ -290,9 +269,6 @@ export default {
|
|||||||
this.tableData.loading = true;
|
this.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
this.daycount();
|
this.daycount();
|
||||||
if (this.query.createdAt[1]) {
|
|
||||||
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
|
||||||
}
|
|
||||||
const res = await saleSummaryApi.page({
|
const res = await saleSummaryApi.page({
|
||||||
page: this.tableData.page,
|
page: this.tableData.page,
|
||||||
size: this.tableData.size,
|
size: this.tableData.size,
|
||||||
@@ -301,7 +277,6 @@ export default {
|
|||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
productName: this.query.productName,
|
productName: this.query.productName,
|
||||||
prodCategoryId: this.query.prodCategoryId,
|
prodCategoryId: this.query.prodCategoryId,
|
||||||
shopId: this.shopId
|
|
||||||
});
|
});
|
||||||
this.tableData.loading = false;
|
this.tableData.loading = false;
|
||||||
this.tableData.data = res.records;
|
this.tableData.data = res.records;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</el-tabs> -->
|
</el-tabs> -->
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-form :model="query" inline label-position="left">
|
<el-form :model="query" inline label-position="left">
|
||||||
<div class="u-flex gap-10" style="flex-wrap: wrap;">
|
<div class="u-flex gap-10">
|
||||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||||
<el-radio-button value="">全部</el-radio-button>
|
<el-radio-button value="">全部</el-radio-button>
|
||||||
<el-radio-button value="0">今天</el-radio-button>
|
<el-radio-button value="0">今天</el-radio-button>
|
||||||
@@ -18,14 +18,14 @@
|
|||||||
<el-radio-button value="custom">自定义</el-radio-button>
|
<el-radio-button value="custom">自定义</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div>
|
<div>
|
||||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
<el-date-picker
|
||||||
end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
v-model="query.createdAt"
|
||||||
</div>
|
type="daterange"
|
||||||
<div>
|
range-separator="至"
|
||||||
<el-select v-model="shopId" v-if="isHeadShop == 1&& loginType == 0" placeholder="选择分店"
|
start-placeholder="开始日期"
|
||||||
style="width: 200px; margin-right: 10px">
|
end-placeholder="结束日期"
|
||||||
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
value-format="YYYY-MM-DD"
|
||||||
</el-select>
|
></el-date-picker>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
@@ -100,7 +100,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tableSummaryApi from "@/api/order/table-summary";
|
import tableSummaryApi from "@/api/order/table-summary";
|
||||||
import ShopApi from "@/api/account/shop";
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { downloadFile } from "@/utils/index";
|
import { downloadFile } from "@/utils/index";
|
||||||
|
|
||||||
@@ -126,11 +125,6 @@ export default {
|
|||||||
downloadLoading: false,
|
downloadLoading: false,
|
||||||
payCountList: "",
|
payCountList: "",
|
||||||
payCountTotal: 0,
|
payCountTotal: 0,
|
||||||
shopId: null,
|
|
||||||
branchList: [],
|
|
||||||
isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop,
|
|
||||||
loginType: localStorage.getItem("loginType")
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
@@ -141,16 +135,8 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.resetQuery = { ...this.query };
|
this.resetQuery = { ...this.query };
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
this.geiShopList();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
|
||||||
* 获取分店列表
|
|
||||||
*/
|
|
||||||
async geiShopList() {
|
|
||||||
let res = await ShopApi.getBranchList()
|
|
||||||
this.branchList = res;
|
|
||||||
},
|
|
||||||
//携带table id跳转到订单列表页面
|
//携带table id跳转到订单列表页面
|
||||||
toTableOrderList(data) {
|
toTableOrderList(data) {
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
@@ -166,13 +152,9 @@ export default {
|
|||||||
async downloadHandle() {
|
async downloadHandle() {
|
||||||
try {
|
try {
|
||||||
this.downloadLoading = true;
|
this.downloadLoading = true;
|
||||||
if (this.query.createdAt[1]) {
|
|
||||||
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
|
||||||
}
|
|
||||||
const file = await tableSummaryApi.export({
|
const file = await tableSummaryApi.export({
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
shopId: this.shopId
|
|
||||||
});
|
});
|
||||||
downloadFile(file, "数据", "xlsx");
|
downloadFile(file, "数据", "xlsx");
|
||||||
this.downloadLoading = false;
|
this.downloadLoading = false;
|
||||||
@@ -201,15 +183,11 @@ export default {
|
|||||||
async getTableData() {
|
async getTableData() {
|
||||||
this.tableData.loading = true;
|
this.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
if (this.query.createdAt[1]) {
|
|
||||||
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
|
||||||
}
|
|
||||||
const res = await tableSummaryApi.list({
|
const res = await tableSummaryApi.list({
|
||||||
page: this.tableData.page,
|
page: this.tableData.page,
|
||||||
size: this.tableData.size,
|
size: this.tableData.size,
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
shopId: this.shopId
|
|
||||||
});
|
});
|
||||||
this.tableData.loading = false;
|
this.tableData.loading = false;
|
||||||
this.tableData.data = res;
|
this.tableData.data = res;
|
||||||
|
|||||||
@@ -1,171 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="head-container">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
|
|
||||||
style="margin-bottom: 15px;" />
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-input v-model="state.query.name" clearable placeholder="请输入耗材名称" style="width: 100%" class="filter-item"
|
|
||||||
@keyup.enter="getTableData" />
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
|
||||||
<el-button type="primary" @click="handlePayment('all')" plain>批量付款</el-button>
|
|
||||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:{{ state.supplierName }}</el-text>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<el-table @selection-change="handleSelectionChange" v-loading="state.tableData.loading"
|
|
||||||
:data="state.tableData.list">
|
|
||||||
<el-table-column type="selection" width="55" />
|
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
|
||||||
<el-table-column label="耗材信息">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<div>{{ scope.row.conName }}</div>
|
|
||||||
<div>单价:{{ scope.row.purchasePrice }}</div>
|
|
||||||
<div>入库数量:{{ scope.row.inOutNumber }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="amountPayable" label="账单金额" width="120" />
|
|
||||||
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="120" />
|
|
||||||
<el-table-column prop="unPaidAmount" label="未付款金额" width="120" />
|
|
||||||
<el-table-column prop="createTime" label="创建时间" width="120" />
|
|
||||||
<el-table-column prop="remark" label="备注" />
|
|
||||||
<el-table-column label="操作" width="200">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button type="primary" size="small" link @click="handlePayment(scope.row)">
|
|
||||||
付款
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" size="small" link @click="handleRecord(scope.row.id)">
|
|
||||||
付款记录
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-pagination v-model:current-page="state.tableData.page" v-model:page-size="state.tableData.size"
|
|
||||||
:total="state.tableData.total" :page-sizes="[10, 20, 30, 50, 100]"
|
|
||||||
layout="total, sizes , prev, pager ,next, jumper " @current-change="paginationChange" />
|
|
||||||
</div>
|
|
||||||
<payment ref="refPayment" @refresh="getTableData"></payment>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import AuthAPI from "@/api/supplier/index";
|
|
||||||
import payment from "./components/payment.vue";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
query: {
|
|
||||||
name: "",
|
|
||||||
vendorId: null,
|
|
||||||
},
|
|
||||||
tableData: {
|
|
||||||
list: [],
|
|
||||||
page: 1,
|
|
||||||
size: 10,
|
|
||||||
loading: false,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
supplierName: '',
|
|
||||||
flowIdList: [],
|
|
||||||
allAmount: 0
|
|
||||||
});
|
|
||||||
onMounted(() => {
|
|
||||||
if (route.query.vendorId) {
|
|
||||||
state.query.vendorId = route.query.vendorId
|
|
||||||
}
|
|
||||||
if (route.query.supplierName) {
|
|
||||||
state.supplierName = route.query.supplierName
|
|
||||||
}
|
|
||||||
getTableData();
|
|
||||||
});
|
|
||||||
// 获取账单记录列表
|
|
||||||
async function getTableData() {
|
|
||||||
state.tableData.loading = true;
|
|
||||||
try {
|
|
||||||
const res = await AuthAPI.getRecordList({
|
|
||||||
page: state.tableData.page,
|
|
||||||
size: state.tableData.size,
|
|
||||||
key: state.query.name,
|
|
||||||
vendorId: state.query.vendorId,
|
|
||||||
});
|
|
||||||
state.tableData.loading = false;
|
|
||||||
state.tableData.list = res.records;
|
|
||||||
state.tableData.total = res.totalRow * 1;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const refPayment = ref();
|
|
||||||
function handlePayment(item) {
|
|
||||||
if (item != 'all') {
|
|
||||||
state.flowIdList = [item.id]
|
|
||||||
state.allAmount = item.unPaidAmount
|
|
||||||
} else {
|
|
||||||
if( state.flowIdList.length <= 0 ){
|
|
||||||
ElMessage({ type: "error", message: "请选择付款耗材" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
refPayment.value.open({ flowIdList: state.flowIdList, supplierName: state.supplierName,allAmount:state.allAmount });
|
|
||||||
}
|
|
||||||
function handleSelectionChange(e) {
|
|
||||||
state.flowIdList = []
|
|
||||||
state.allAmount = 0
|
|
||||||
e.map(item => {
|
|
||||||
state.flowIdList.push(item.id)
|
|
||||||
state.allAmount += item.unPaidAmount
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 付款记录
|
|
||||||
function handleRecord(id) {
|
|
||||||
router.push({ name: "financePaymentRecord", query: { id: id, supplierName: state.supplierName } });
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置查询
|
|
||||||
function resetHandle() {
|
|
||||||
state.query.name = "";
|
|
||||||
getTableData();
|
|
||||||
}
|
|
||||||
// 分页回调
|
|
||||||
function paginationChange(e) {
|
|
||||||
state.tableData.page = e;
|
|
||||||
getTableData();
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.head-container {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop_info {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex: 1;
|
|
||||||
padding-left: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-link {
|
|
||||||
min-height: 23px;
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 修改和增加 -->
|
|
||||||
<el-dialog title="付款" v-model="show" width="400px" @close="reset">
|
|
||||||
<el-form :inline="false" ref="refform" label-width="90" :model="form" :rules="rules" class="demo-form-inline">
|
|
||||||
<el-form-item label="供应商">
|
|
||||||
<el-input v-model="supplierName" placeholder="请输入供应商名称" readonly></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="付款金额 " prop="amount">
|
|
||||||
<el-input-number v-model="form.amount" :readonly="form.flowIdList.length > 1" :max="maxAmount" placeholder="请输入付款金额"
|
|
||||||
style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="付款方式" prop="type">
|
|
||||||
<el-input v-model="form.type" placeholder="请输入付款方式"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item style="display: flex; justify-content: flex-end">
|
|
||||||
<el-button @click="close">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="submitForm('refform')">确 定</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import AuthAPI from "@/api/supplier/index";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
|
|
||||||
const emits = defineEmits(["refresh"]);
|
|
||||||
|
|
||||||
const rules = {
|
|
||||||
amount: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
|
|
||||||
type: [{ required: true, message: "请输入付款方式", trigger: "blur" }],
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const basicForm = {
|
|
||||||
flowIdList: [],
|
|
||||||
amount: undefined,
|
|
||||||
type: '',
|
|
||||||
remark: '',
|
|
||||||
};
|
|
||||||
const form = reactive({
|
|
||||||
...basicForm,
|
|
||||||
});
|
|
||||||
const supplierName = ref('');
|
|
||||||
const maxAmount = ref(0);
|
|
||||||
const show = ref(false);
|
|
||||||
function open(item) {
|
|
||||||
form.flowIdList = item.flowIdList
|
|
||||||
supplierName.value = item.supplierName
|
|
||||||
form.amount = item.allAmount
|
|
||||||
maxAmount.value = item.allAmount
|
|
||||||
// Object.assign(form, item);
|
|
||||||
show.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
show.value = false;
|
|
||||||
}
|
|
||||||
const refform = ref();
|
|
||||||
async function submitForm() {
|
|
||||||
refform.value.validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const res = await AuthAPI.billPay(form);
|
|
||||||
ElMessage({ type: "success", message: "付款成功" });
|
|
||||||
emits("refresh");
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
console.log("reset");
|
|
||||||
Object.assign(form, basicForm);
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
defineExpose({
|
|
||||||
open,
|
|
||||||
close,
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="head-container">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
|
|
||||||
style="margin-bottom: 15px;" />
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-input v-model="state.query.name" clearable placeholder="请输入供应商名称" style="width: 100%"
|
|
||||||
class="filter-item" @keyup.enter="getTableData" />
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<el-row :gutter="24">
|
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
|
||||||
<div>账单总金额(全部/本月)</div>
|
|
||||||
<div>{{ state.summaryData.amountPayable || 0 }} / {{ state.summaryData.mouthAmountPayable || 0 }}</div>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
|
||||||
<div>已付款总金额(全部/本月)</div>
|
|
||||||
<div>{{ state.summaryData.actualPaymentAmount || 0 }} / {{ state.summaryData.mouthActualPaymentAmount || 0 }}</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
|
||||||
<div>未付款总金额(全部/本月)</div>
|
|
||||||
<div>{{ state.summaryData.unPaidAmount || 0 }} / {{ state.summaryData.mouthUnPaidAmount || 0 }}</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
|
||||||
<el-table-column prop="name" label="供应商" width="220" />
|
|
||||||
<el-table-column prop="amountPayable" label="账单金额" width="200" />
|
|
||||||
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="200" />
|
|
||||||
<el-table-column prop="unPaidAmount" label="未付款金额" width="200" />
|
|
||||||
<el-table-column prop="remark" label="备注" />
|
|
||||||
<el-table-column label="操作" width="120">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button type="primary" size="small" link @click="handleTo(scope.row)">
|
|
||||||
账单记录
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-pagination v-model:current-page="state.tableData.page" v-model:page-size="state.tableData.size"
|
|
||||||
:total="state.tableData.total" :page-sizes="[10, 20, 30, 50, 100]"
|
|
||||||
layout="total, sizes , prev, pager ,next, jumper " @current-change="paginationChange" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import AuthAPI from "@/api/supplier/index";
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
query: {
|
|
||||||
name: "",
|
|
||||||
},
|
|
||||||
summaryData: {},
|
|
||||||
tableData: {
|
|
||||||
list: [],
|
|
||||||
page: 1,
|
|
||||||
size: 10,
|
|
||||||
loading: false,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
onMounted(() => {
|
|
||||||
getSummary();
|
|
||||||
|
|
||||||
getTableData();
|
|
||||||
});
|
|
||||||
|
|
||||||
async function getSummary() {
|
|
||||||
try {
|
|
||||||
const res = await AuthAPI.getSummary();
|
|
||||||
state.summaryData = res;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取账单列表
|
|
||||||
async function getTableData() {
|
|
||||||
state.tableData.loading = true;
|
|
||||||
try {
|
|
||||||
const res = await AuthAPI.getPage({
|
|
||||||
page: state.tableData.page,
|
|
||||||
size: state.tableData.size,
|
|
||||||
key: state.query.name,
|
|
||||||
});
|
|
||||||
state.tableData.loading = false;
|
|
||||||
state.tableData.list = res.records;
|
|
||||||
state.tableData.total = res.totalRow * 1;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function handleTo(row) {
|
|
||||||
// router.push({ path: "/finance/supplierBill/billingRecord", query: { id: e.id } });
|
|
||||||
router.push({ name: "financeBillingRecord", query: { vendorId: row.vendorId, supplierName: row.name } });
|
|
||||||
|
|
||||||
}
|
|
||||||
// 重置查询
|
|
||||||
function resetHandle() {
|
|
||||||
state.query.name = "";
|
|
||||||
getTableData();
|
|
||||||
}
|
|
||||||
// 分页回调
|
|
||||||
function paginationChange(e) {
|
|
||||||
state.tableData.page = e;
|
|
||||||
getTableData();
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.head-container {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop_info {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex: 1;
|
|
||||||
padding-left: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-link {
|
|
||||||
min-height: 23px;
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="head-container">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
|
|
||||||
style="margin-bottom: 15px;" />
|
|
||||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:{{ state.supplierName }}</el-text>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
|
||||||
<el-table-column label="耗材信息">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<div>{{ scope.row.conName }}</div>
|
|
||||||
<div>单价:{{ scope.row.purchasePrice }}</div>
|
|
||||||
<div>入库数量:{{ scope.row.inOutNumber }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="amount" label="付款金额" width="120" />
|
|
||||||
<el-table-column prop="type" label="付款方式" width="120" />
|
|
||||||
<el-table-column prop="remark" label="备注" />
|
|
||||||
<el-table-column prop="createTime" label="创建时间" />
|
|
||||||
<el-table-column label="操作人" width="200">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<div>员工名称:{{ scope.row.nickname }}</div>
|
|
||||||
<div>员工编号:{{ scope.row.code }}</div>
|
|
||||||
<div>员工账号:{{ scope.row.account }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-pagination v-model:current-page="state.tableData.page" v-model:page-size="state.tableData.size"
|
|
||||||
:total="state.tableData.total" :page-sizes="[10, 20, 30, 50, 100]"
|
|
||||||
layout="total, sizes , prev, pager ,next, jumper " @current-change="paginationChange" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import ShopApi from "@/api/account/shop";
|
|
||||||
import AuthAPI from "@/api/supplier/index";
|
|
||||||
|
|
||||||
import { ElMessageBox } from "element-plus";
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
query: {
|
|
||||||
name: "",
|
|
||||||
flowId: null,
|
|
||||||
},
|
|
||||||
tableData: {
|
|
||||||
list: [],
|
|
||||||
page: 1,
|
|
||||||
size: 10,
|
|
||||||
loading: false,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
supplierName: '',
|
|
||||||
});
|
|
||||||
onMounted(() => {
|
|
||||||
console.log(route.query);
|
|
||||||
if (route.query.id) {
|
|
||||||
state.query.flowId = route.query.id
|
|
||||||
}
|
|
||||||
if (route.query.supplierName) {
|
|
||||||
state.supplierName = route.query.supplierName
|
|
||||||
}
|
|
||||||
getTableData();
|
|
||||||
});
|
|
||||||
// 获取账单付款列表
|
|
||||||
async function getTableData() {
|
|
||||||
state.tableData.loading = true;
|
|
||||||
try {
|
|
||||||
const res = await AuthAPI.getPayRecordList({
|
|
||||||
page: state.tableData.page,
|
|
||||||
size: state.tableData.size,
|
|
||||||
flowId: state.query.flowId,
|
|
||||||
});
|
|
||||||
state.tableData.loading = false;
|
|
||||||
state.tableData.list = res.records;
|
|
||||||
state.tableData.total = res.totalRow * 1;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function handleSync(e) {
|
|
||||||
console.log(e)
|
|
||||||
ElMessageBox.confirm(`同步功能开启后不能关闭,请确认是否给${e.shopName}开启同步?`, "提示", {
|
|
||||||
confirmButtonText: "确认",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning",
|
|
||||||
}).then(async () => {
|
|
||||||
const res = await ShopApi.delete({ id: row.id });
|
|
||||||
ElMessage({
|
|
||||||
type: "success",
|
|
||||||
message: "同步成功",
|
|
||||||
});
|
|
||||||
getTableData();
|
|
||||||
}).catch(() => { });
|
|
||||||
}
|
|
||||||
// 重置查询
|
|
||||||
function resetHandle() {
|
|
||||||
state.query.name = "";
|
|
||||||
getTableData();
|
|
||||||
}
|
|
||||||
// 分页回调
|
|
||||||
function paginationChange(e) {
|
|
||||||
state.tableData.page = e;
|
|
||||||
getTableData();
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.head-container {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop_info {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex: 1;
|
|
||||||
padding-left: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-link {
|
|
||||||
min-height: 23px;
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -20,15 +20,7 @@ const contentConfig: IContentConfig = {
|
|||||||
return Api.edit(data);
|
return Api.edit(data);
|
||||||
},
|
},
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: [
|
toolbar: ["add"],
|
||||||
{
|
|
||||||
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" },
|
||||||
@@ -57,7 +49,7 @@ const contentConfig: IContentConfig = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: [{ text: "编辑", icon: 'edit', name: "edit"}],
|
operat: ["edit"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ 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,
|
||||||
@@ -88,14 +87,6 @@ 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();
|
||||||
|
|||||||
@@ -77,40 +77,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--<div style="
|
|
||||||
width: 200px;
|
<stockHistory ref="refStockHistory"></stockHistory>
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
background: #fff;
|
|
||||||
">
|
|
||||||
<div style="font-weight: bold">入库</div>
|
|
||||||
<div style="margin-top: 10px">{{ data.stockInNum || 0 }}</div>
|
|
||||||
<div style="margin-top: 10px">{{ data.totalRow || 0 }}</div>
|
|
||||||
</div>
|
|
||||||
<div style="
|
|
||||||
width: 200px;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
background: #fff;
|
|
||||||
">
|
|
||||||
<div style="font-weight: bold">出库</div>
|
|
||||||
<div style="margin-top: 10px">{{ data.stockOutNum || 0 }}</div>
|
|
||||||
<div style="margin-top: 10px">{{ data.totalRow || 0 }}</div>
|
|
||||||
</div>
|
|
||||||
<div style="
|
|
||||||
width: 200px;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
background: #fff;
|
|
||||||
">
|
|
||||||
<div style="font-weight: bold">报损</div>
|
|
||||||
<div style="margin-top: 10px">{{ data.damageNum || 0 }}</div>
|
|
||||||
<div style="margin-top: 10px">{{ data.totalRow || 0 }}</div>
|
|
||||||
</div> -->
|
|
||||||
<stockHistory ref="refStockHistory" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -129,6 +97,7 @@ function refStockHistoryShow(key) {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.DataStatistics {
|
.DataStatistics {
|
||||||
border: 1px solid #e4e7ed;
|
border: 1px solid #e4e7ed;
|
||||||
@@ -161,7 +130,6 @@ function refStockHistoryShow(key) {
|
|||||||
span {
|
span {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
&.num {
|
&.num {
|
||||||
color: #3f9eff;
|
color: #3f9eff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
197
src/views/inventory/consumables/components/add-haocai copy.vue
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 修改和增加 -->
|
||||||
|
<el-dialog :title="dialogtitle" v-model="show" width="85%">
|
||||||
|
<div v-if="dialogtitle != '编辑'">
|
||||||
|
<div v-for="(item, index) in forms" :key="index">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:ref="(el) => setFormRef(el, index)"
|
||||||
|
:model="item"
|
||||||
|
:rules="rules"
|
||||||
|
class="demo-form-inline"
|
||||||
|
>
|
||||||
|
<el-form-item label=" ">
|
||||||
|
<el-icon color="red" @click="formsReduce(index)"><Remove /></el-icon>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="耗材名称" prop="conName">
|
||||||
|
<el-input v-model="item.conName" placeholder="请输入耗材信息名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="耗材类型" prop="conTypeId">
|
||||||
|
<el-select v-model="item.conTypeId" placeholder="请选择耗材类型" style="width: 200px">
|
||||||
|
<el-option
|
||||||
|
v-for="option in consGroups"
|
||||||
|
:key="option.conTypeId"
|
||||||
|
:label="option.conTypeName"
|
||||||
|
:value="option.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="单位" prop="conUnit">
|
||||||
|
<el-input v-model="item.conUnit" placeholder="请输入单位"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="耗材价格">
|
||||||
|
<el-input v-model="item.price" placeholder="请输入耗材价格"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预警值">
|
||||||
|
<el-input v-model="item.conWarning" placeholder="请输入耗材预警值"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label=" ">
|
||||||
|
<el-icon color="green" @click="formsAdd(index)"><CirclePlus /></el-icon>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex; justify-content: flex-end">
|
||||||
|
<el-button @click="dialogshow = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForms()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-form
|
||||||
|
v-else
|
||||||
|
:inline="true"
|
||||||
|
ref="refform"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
class="demo-form-inline"
|
||||||
|
>
|
||||||
|
{{ dialogtitle }}
|
||||||
|
|
||||||
|
<el-form-item label="耗材信息名称" prop="conName">
|
||||||
|
<el-input v-model="form.conName" placeholder="请输入耗材信息名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="耗材价格">
|
||||||
|
<el-input v-model="form.price" placeholder="请输入耗材价格"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单位" prop="conUnit">
|
||||||
|
<el-input v-model="form.conUnit" placeholder="请输入单位"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预警值">
|
||||||
|
<el-input v-model="form.conWarning" placeholder="请输入耗材预警值"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" v-if="dialogtitle == '编辑'">
|
||||||
|
<el-switch v-model="form.status" active-value="1" inactive-value="0"></el-switch>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
|
||||||
|
<el-input v-model="form.surplusStock" placeholder="请输入单位耗材值"></el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item style="display: flex; justify-content: flex-end">
|
||||||
|
<el-button @click="dialogshow = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm('refform')">确 定</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import consApi from "@/api/product/cons";
|
||||||
|
import consGroupApi from "@/api/product/cons-group";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
const consGroups = ref([]);
|
||||||
|
const rules = {
|
||||||
|
conCode: [{ required: true, message: "请输入耗材信息代码", trigger: "blur" }],
|
||||||
|
conName: [{ required: true, message: "请输入耗材信息名称", trigger: "blur" }],
|
||||||
|
conTypeId: [{ required: true, message: "请选择耗材类型", trigger: "change" }],
|
||||||
|
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
|
||||||
|
conWarning: [{ required: true, message: "请输入耗材预警值", trigger: "blur" }],
|
||||||
|
conTypeId: [{ required: true, message: "请输入耗材类型id", trigger: "blur" }],
|
||||||
|
conUnit: [{ required: true, message: "请输入单位", trigger: "blur" }],
|
||||||
|
conWarning: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入单位",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
function getConsGroups() {
|
||||||
|
consGroupApi.getAllList().then((res) => {
|
||||||
|
consGroups.value = res.map((v) => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
label: v.name,
|
||||||
|
value: v.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getConsGroups();
|
||||||
|
const basicForm = {
|
||||||
|
conCode: "",
|
||||||
|
conName: "",
|
||||||
|
conTypeId: "",
|
||||||
|
price: "0",
|
||||||
|
conNames: "",
|
||||||
|
conUnit: "",
|
||||||
|
conWarning: "999",
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
status: "",
|
||||||
|
};
|
||||||
|
const forms = ref([{ ...basicForm }]);
|
||||||
|
const form = reactive({
|
||||||
|
...basicForm,
|
||||||
|
});
|
||||||
|
|
||||||
|
const show = ref(false);
|
||||||
|
let dialogtitle = ref("");
|
||||||
|
function open(item) {
|
||||||
|
dialogtitle.value = item ? "编辑" : "新增";
|
||||||
|
show.value = true;
|
||||||
|
}
|
||||||
|
function formsAdd(index) {
|
||||||
|
forms.value.push({ ...basicForm });
|
||||||
|
}
|
||||||
|
function close() {
|
||||||
|
show.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const refForms = ref([]);
|
||||||
|
function setFormRef(el, index) {
|
||||||
|
if (el) {
|
||||||
|
refForms.value[index] = el;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function returnPromise(index, prosise) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
prosise
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
resolve({ sucees: true });
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
resolve({ sucees: false });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function submitForms() {
|
||||||
|
let isAllPassForm = 0;
|
||||||
|
for (let i in this.forms) {
|
||||||
|
console.log(refForms.value[i]);
|
||||||
|
const res = await returnPromise(i, refForms.value[i].validate());
|
||||||
|
console.log(res);
|
||||||
|
isAllPassForm += res.sucees ? 1 : 0;
|
||||||
|
}
|
||||||
|
//判断验证是否通过
|
||||||
|
if (isAllPassForm === this.forms.length) {
|
||||||
|
await consApi.add(this.forms);
|
||||||
|
ElMessage({ type: "success", message: "添加成功" });
|
||||||
|
// for(let i of this.forms){
|
||||||
|
// const res=await posttbConsInfo(i)
|
||||||
|
// this.$message({ type: "success", message: "添加成功" });
|
||||||
|
// }
|
||||||
|
this.dialogshow = false;
|
||||||
|
this.resetRuleForms();
|
||||||
|
this.ruleFormLoading = false;
|
||||||
|
this.getTableData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
close,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -13,11 +13,11 @@ const contentConfig: IContentConfig = {
|
|||||||
pageSizes: [10, 20, 30, 50],
|
pageSizes: [10, 20, 30, 50],
|
||||||
},
|
},
|
||||||
indexAction: function (params) {
|
indexAction: function (params) {
|
||||||
let obj = { ...params };
|
let obj = { ...params }
|
||||||
if (obj.createAt) {
|
if (obj.createAt) {
|
||||||
obj.beginTime = obj.createAt[0];
|
obj.beginTime = obj.createAt[0]
|
||||||
obj.endTime = obj.createAt[1];
|
obj.endTime = obj.createAt[1]
|
||||||
delete obj.createAt;
|
delete obj.createAt
|
||||||
}
|
}
|
||||||
return Api.getList(obj);
|
return Api.getList(obj);
|
||||||
},
|
},
|
||||||
@@ -25,62 +25,28 @@ const contentConfig: IContentConfig = {
|
|||||||
// modifyAction: function (data) {
|
// modifyAction: function (data) {
|
||||||
// // return Api.edit(data);
|
// // return Api.edit(data);
|
||||||
// },
|
// },
|
||||||
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',
|
||||||
auth: "ruku",
|
auth: 'ruku'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "出库",
|
text: "出库",
|
||||||
name: "chuku",
|
name: 'chuku',
|
||||||
auth: "",
|
auth: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "分类管理",
|
text: "分类管理",
|
||||||
name: "category",
|
name: 'category',
|
||||||
auth: "",
|
auth: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "供应商管理",
|
text: "供应商管理",
|
||||||
name: "gongyinsahng",
|
name: 'gongyinsahng',
|
||||||
auth: "",
|
auth: ''
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "入库记录",
|
|
||||||
name: "manual-in",
|
|
||||||
auth: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "出库记录",
|
|
||||||
name: "manual-out",
|
|
||||||
auth: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "报损记录",
|
|
||||||
name: "damage-out",
|
|
||||||
auth: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "报损",
|
|
||||||
name: "reportinglosses",
|
|
||||||
auth: "",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
defaultToolbar: ["refresh", "filter", "search"],
|
defaultToolbar: ["refresh", "filter", "search"],
|
||||||
@@ -102,8 +68,8 @@ const contentConfig: IContentConfig = {
|
|||||||
{
|
{
|
||||||
label: "所属商品",
|
label: "所属商品",
|
||||||
align: "center",
|
align: "center",
|
||||||
templet: "custom",
|
templet: 'custom',
|
||||||
slotName: "goods",
|
slotName: 'goods'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "库存数量",
|
label: "库存数量",
|
||||||
@@ -128,7 +94,7 @@ const contentConfig: IContentConfig = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 150,
|
width: 150,
|
||||||
templet: "custom",
|
templet: "custom",
|
||||||
slotName: "operate",
|
slotName: 'operate'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { ISearchConfig } from "@/components/CURD/types";
|
import type { ISearchConfig } from "@/components/CURD/types";
|
||||||
import consGroupApi from "@/api/product/cons-group";
|
import consGroupApi from '@/api/product/cons-group'
|
||||||
import { statusOptions, payTypeOptions } from "./config";
|
import { statusOptions, payTypeOptions } from "./config";
|
||||||
const searchConfig: ISearchConfig = {
|
const searchConfig: ISearchConfig = {
|
||||||
pageName: "sys:user",
|
pageName: "sys:user",
|
||||||
@@ -20,14 +20,14 @@ const searchConfig: ISearchConfig = {
|
|||||||
initialValue: "",
|
initialValue: "",
|
||||||
initFn(formItem) {
|
initFn(formItem) {
|
||||||
console.log(formItem);
|
console.log(formItem);
|
||||||
consGroupApi.getAllList({}).then((res) => {
|
consGroupApi.getAllList({}).then(res => {
|
||||||
formItem.options = res.map((item: { name: any; id: any }) => {
|
formItem.options = res.map((item: { name: any; id: any; }) => {
|
||||||
return {
|
return {
|
||||||
label: item?.name,
|
label: item?.name,
|
||||||
value: item?.id,
|
value: item?.id
|
||||||
};
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -42,23 +42,22 @@ const searchConfig: ISearchConfig = {
|
|||||||
width: "200px",
|
width: "200px",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
initialValue: "",
|
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// type: "date-picker",
|
type: "date-picker",
|
||||||
// label: "创建时间",
|
label: "创建时间",
|
||||||
// prop: "createAt",
|
prop: "createAt",
|
||||||
// attrs: {
|
attrs: {
|
||||||
// type: "daterange",
|
type: "daterange",
|
||||||
// "range-separator": "~",
|
"range-separator": "~",
|
||||||
// "start-placeholder": "开始时间",
|
"start-placeholder": "开始时间",
|
||||||
// "end-placeholder": "截止时间",
|
"end-placeholder": "截止时间",
|
||||||
// "value-format": "YYYY-MM-DD",
|
"value-format": "YYYY-MM-DD",
|
||||||
// style: {
|
style: {
|
||||||
// width: "240px",
|
width: "240px",
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,26 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="newHandleQueryClick"
|
<page-search
|
||||||
@reset-click="handleResetClick" />
|
ref="searchRef"
|
||||||
|
:search-config="searchConfig"
|
||||||
|
@query-click="newHandleQueryClick"
|
||||||
|
@reset-click="handleResetClick"
|
||||||
|
/>
|
||||||
<!-- 统计 -->
|
<!-- 统计 -->
|
||||||
<data-tongji :data="gongjiData" />
|
<data-tongji :data="gongjiData"></data-tongji>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
<page-content
|
||||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
ref="contentRef"
|
||||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
:content-config="contentConfig"
|
||||||
|
@add-click="handleAddClick"
|
||||||
|
@edit-click="handleEditClick"
|
||||||
|
@export-click="handleExportClick"
|
||||||
|
@search-click="handleSearchClick"
|
||||||
|
@toolbar-click="handleToolbarClick"
|
||||||
|
@operat-click="handleOperatClick"
|
||||||
|
@filter-change="handleFilterChange"
|
||||||
|
>
|
||||||
<template #status="scope">
|
<template #status="scope">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
@@ -21,22 +33,28 @@
|
|||||||
<template #goods="scope">
|
<template #goods="scope">
|
||||||
<div class="goodslang">
|
<div class="goodslang">
|
||||||
<div class="goods-list">
|
<div class="goods-list">
|
||||||
<el-button v-for="item in scope.row.productList" :key="item.productId" type="text"
|
<el-button
|
||||||
@click="toGoods(item.id)">
|
v-for="item in scope.row.productList"
|
||||||
|
@click="toGoods(item.id)"
|
||||||
|
:key="item.productId"
|
||||||
|
type="text"
|
||||||
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<span v-if="scope.row.productList.length > 1">,</span>
|
<span v-if="scope.row.productList.length > 1">,</span>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown v-if="scope.row.productList.length > 1" trigger="click" @command="toGoods">
|
<el-dropdown trigger="click" v-if="scope.row.productList.length > 1" @command="toGoods">
|
||||||
<span class="el-dropdown-link" style="color: blue">
|
<span class="el-dropdown-link" style="color: blue">
|
||||||
<el-icon>
|
<el-icon><CaretBottom /></el-icon>
|
||||||
<CaretBottom />
|
|
||||||
</el-icon>
|
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item v-for="item in scope.row.productList" :key="item.id" class="clearfix"
|
<el-dropdown-item
|
||||||
:command="item.id">
|
class="clearfix"
|
||||||
|
v-for="item in scope.row.productList"
|
||||||
|
:key="item.id"
|
||||||
|
:command="item.id"
|
||||||
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -55,34 +73,25 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #mobile="scope">
|
<template #mobile="scope">
|
||||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
<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 #operate="scope">
|
<template #operate="scope">
|
||||||
<div style="
|
<div>
|
||||||
display: flex;
|
<el-button @click="refAddHaocaiOpen(scope.row)" type="primary" link>编辑</el-button>
|
||||||
flex-direction: column;
|
<el-button @click="refAddHaocaiTakinShow(scope.row)" link type="primary">
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
">
|
|
||||||
<el-button v-if="!isSyncStatus()" type="primary" link @click="refAddHaocaiOpen(scope.row)">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'consumables')">
|
|
||||||
耗材盘点
|
耗材盘点
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'manual-in')">
|
|
||||||
入库记录
|
|
||||||
</el-button>
|
|
||||||
<!-- <el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'delete')">
|
|
||||||
删除
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
<!-- 耗材添加编辑 -->
|
<!-- 耗材添加编辑 -->
|
||||||
<add-haocai ref="refAddHaocai" @refresh="refresh" />
|
<add-haocai ref="refAddHaocai" @refresh="refresh"></add-haocai>
|
||||||
<!-- 耗材盘点 -->
|
<!-- 耗材盘点 -->
|
||||||
<addConsTakin ref="refAddHaocaiTakin" @success="refresh" />
|
<addConsTakin ref="refAddHaocaiTakin" @success="refresh"></addConsTakin>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -91,16 +100,12 @@ 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,
|
||||||
@@ -118,24 +123,6 @@ function toGoods(id: number | string) {
|
|||||||
router.push({ path: "/product/index", query: { id: id } });
|
router.push({ path: "/product/index", query: { id: id } });
|
||||||
}
|
}
|
||||||
|
|
||||||
// 默认初始数据
|
|
||||||
const route = useRoute();
|
|
||||||
const { conName } = route.query;
|
|
||||||
if (conName) {
|
|
||||||
contentConfig.indexActionData = { conName };
|
|
||||||
if (conName) {
|
|
||||||
searchConfig.formItems[1].initialValue = 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) {
|
||||||
@@ -165,20 +152,7 @@ watch(
|
|||||||
|
|
||||||
//耗材盘点
|
//耗材盘点
|
||||||
const refAddHaocaiTakin = ref();
|
const refAddHaocaiTakin = ref();
|
||||||
function refAddHaocaiTakinShow(item: any, type: string) {
|
function refAddHaocaiTakinShow(item: any) {
|
||||||
console.log(item);
|
|
||||||
if (type === "manual-in") {
|
|
||||||
router.push({ path: "/inventory/libraryrecords", query: { inOutItem: type, conId: item.id } });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (type === "delete") {
|
|
||||||
refAddHaocaiTakin.value.show(item, type);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (type === "consumables") {
|
|
||||||
refAddHaocaiTakin.value.show(item, type);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
refAddHaocaiTakin.value.show(item);
|
refAddHaocaiTakin.value.show(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,13 +177,8 @@ async function handleEditClick(row: IObject) {
|
|||||||
editModalRef.value?.setFormData({ ...row, url: [row.url] });
|
editModalRef.value?.setFormData({ ...row, url: [row.url] });
|
||||||
}
|
}
|
||||||
// 其他工具栏
|
// 其他工具栏
|
||||||
async function handleToolbarClick(name: string) {
|
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;
|
||||||
@@ -226,14 +195,6 @@ async function handleToolbarClick(name: string) {
|
|||||||
router.push({ path: "/inventory/operation_in", query: { type: "out" } });
|
router.push({ path: "/inventory/operation_in", query: { type: "out" } });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (name == "reportinglosses") {
|
|
||||||
router.push({ path: "/inventory/operation_in", query: { type: "reportinglosses" } });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (name == "damage-out" || name == "manual-out" || name == "manual-in") {
|
|
||||||
router.push({ path: "/inventory/libraryrecords", query: { inOutItem: name } });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 其他操作列
|
// 其他操作列
|
||||||
async function handleOperatClick(data: IOperatData) {
|
async function handleOperatClick(data: IOperatData) {
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
import Api from "@/api/product/vendor";
|
|
||||||
import { returnOptions, switchAttr } from "./config";
|
|
||||||
import type { IModalConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const modalConfig: IModalConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
dialog: {
|
|
||||||
title: "添加供应商",
|
|
||||||
width: 800,
|
|
||||||
draggable: true,
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
labelWidth: 140,
|
|
||||||
},
|
|
||||||
formAction: function (data) {
|
|
||||||
return Api.add({ ...data });
|
|
||||||
},
|
|
||||||
beforeSubmit(data) {
|
|
||||||
console.log("提交之前处理", data);
|
|
||||||
},
|
|
||||||
formItems: [
|
|
||||||
|
|
||||||
{
|
|
||||||
label: "名称",
|
|
||||||
prop: "name",
|
|
||||||
rules: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入名称",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人名字",
|
|
||||||
prop: "contactName",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人电话",
|
|
||||||
prop: "telephone",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "供应商地址",
|
|
||||||
prop: "address",
|
|
||||||
rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入供应商地址",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "备注",
|
|
||||||
prop: "remark",
|
|
||||||
rules: [{ required: false, message: "请输入备注", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入备注",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "排序",
|
|
||||||
prop: "sort",
|
|
||||||
rules: [{ required: true, message: "请输入排序", trigger: "blur" }],
|
|
||||||
type: "input-number",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入排序",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出
|
|
||||||
export default reactive(modalConfig);
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
export interface options {
|
|
||||||
label: string;
|
|
||||||
value: string | number;
|
|
||||||
[property: string]: any;
|
|
||||||
}
|
|
||||||
export interface optionObject {
|
|
||||||
[property: string]: options[];
|
|
||||||
}
|
|
||||||
const options: optionObject = {
|
|
||||||
payType: [
|
|
||||||
{ label: "现金", value: "cash" },
|
|
||||||
{ label: "微信", value: "weixin" },
|
|
||||||
{ label: "银行卡", value: "bank" },
|
|
||||||
{ label: "会员支付", value: "member-account" },
|
|
||||||
{ label: "支付宝", value: "alipay" },
|
|
||||||
{ label: "刷卡", value: "deposit" },
|
|
||||||
{ label: "挂账", value: "arrears" },
|
|
||||||
{ label: "刷卡", value: "deposit" },
|
|
||||||
{ label: "储值", value: "member-account" },
|
|
||||||
{ label: "自定义", value: "virtual" },
|
|
||||||
],
|
|
||||||
isIdeal: [
|
|
||||||
{ label: "否", value: 0 },
|
|
||||||
{ label: "是", value: 1 },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export const switchAttr = {
|
|
||||||
"active-value": 1,
|
|
||||||
"inactive-value": 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
export type optionsType = string;
|
|
||||||
|
|
||||||
export function returnOptions(type: optionsType) {
|
|
||||||
return options[type];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function returnOptionsLabel(optionsType: optionsType, value: string | number) {
|
|
||||||
const options = returnOptions(optionsType);
|
|
||||||
if (!options) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
const option = options.find((item) => item.value === value);
|
|
||||||
return option ? option.label : "";
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
import Api from "@/api/product/libraryrecords";
|
|
||||||
import type { IContentConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const contentConfig: IContentConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
table: {
|
|
||||||
border: true,
|
|
||||||
highlightCurrentRow: true,
|
|
||||||
},
|
|
||||||
pagination: {
|
|
||||||
background: true,
|
|
||||||
layout: "prev,pager,next,jumper,total,sizes",
|
|
||||||
pageSize: 20,
|
|
||||||
pageSizes: [10, 20, 30, 50],
|
|
||||||
},
|
|
||||||
indexAction: function (params) {
|
|
||||||
return Api.getList(params);
|
|
||||||
},
|
|
||||||
deleteAction: function (id) {
|
|
||||||
return Api.delete(id);
|
|
||||||
},
|
|
||||||
modifyAction: function (data) {
|
|
||||||
return Api.edit(data);
|
|
||||||
},
|
|
||||||
indexActionData: {},
|
|
||||||
pk: "id",
|
|
||||||
toolbar: [
|
|
||||||
// {
|
|
||||||
// text: "入库记录",
|
|
||||||
// name: "manual-in",
|
|
||||||
// auth: "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// text: "出库记录",
|
|
||||||
// name: "manual-out",
|
|
||||||
// auth: "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// text: "报损记录",
|
|
||||||
// name: "damage-out",
|
|
||||||
// auth: "",
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
defaultToolbar: ["refresh", "filter", "search"],
|
|
||||||
cols: [
|
|
||||||
// { type: "selection", width: 50, align: "center" },
|
|
||||||
{
|
|
||||||
label: "耗材名称",
|
|
||||||
align: "center",
|
|
||||||
prop: "conName",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "单位",
|
|
||||||
align: "center",
|
|
||||||
prop: "unitName",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "供应商",
|
|
||||||
align: "center",
|
|
||||||
prop: "vendorName",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "变动原因",
|
|
||||||
align: "center",
|
|
||||||
templet: "custom",
|
|
||||||
slotName: "conUnit",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "出入库数量",
|
|
||||||
align: "center",
|
|
||||||
prop: "inOutNumber",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "变动后的库存",
|
|
||||||
align: "center",
|
|
||||||
prop: "afterNumber",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "创建时间",
|
|
||||||
align: "center",
|
|
||||||
prop: "createTime",
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// label: "操作",
|
|
||||||
// align: "center",
|
|
||||||
// fixed: "right",
|
|
||||||
// width: 280,
|
|
||||||
// templet: "tool",
|
|
||||||
// operat: ["edit", "delete"],
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default contentConfig;
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
import Api from "@/api/product/vendor";
|
|
||||||
import { returnOptions, switchAttr } from "./config";
|
|
||||||
import type { IModalConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const modalConfig: IModalConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
dialog: {
|
|
||||||
title: "编辑供应商",
|
|
||||||
width: 800,
|
|
||||||
draggable: true,
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
labelWidth: 140,
|
|
||||||
},
|
|
||||||
formAction: function (data) {
|
|
||||||
return Api.edit({ ...data });
|
|
||||||
},
|
|
||||||
beforeSubmit(data) {
|
|
||||||
console.log("提交之前处理", data);
|
|
||||||
},
|
|
||||||
formItems: [
|
|
||||||
{
|
|
||||||
label: "名称",
|
|
||||||
prop: "name",
|
|
||||||
rules: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入名称",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人名字",
|
|
||||||
prop: "contactName",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人电话",
|
|
||||||
prop: "telephone",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "供应商地址",
|
|
||||||
prop: "address",
|
|
||||||
rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入供应商地址",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "备注",
|
|
||||||
prop: "remark",
|
|
||||||
rules: [{ required: false, message: "请输入备注", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入备注",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "排序",
|
|
||||||
prop: "sort",
|
|
||||||
rules: [{ required: true, message: "请输入排序", trigger: "blur" }],
|
|
||||||
type: "input-number",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入排序",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出
|
|
||||||
export default reactive(modalConfig);
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import type { ISearchConfig } from "@/components/CURD/types";
|
|
||||||
const searchConfig: ISearchConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
isExpandable: false,
|
|
||||||
formItems: [
|
|
||||||
{
|
|
||||||
type: "select",
|
|
||||||
label: "类型",
|
|
||||||
prop: "inOutType",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请选择",
|
|
||||||
clearable: true,
|
|
||||||
style: {
|
|
||||||
width: "200px",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: "增加",
|
|
||||||
value: "in",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "减少",
|
|
||||||
value: "out",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "select",
|
|
||||||
label: "名目",
|
|
||||||
prop: "inOutItem",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请选择",
|
|
||||||
clearable: true,
|
|
||||||
style: {
|
|
||||||
width: "200px",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: "入库记录",
|
|
||||||
value: "manual-in",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "出库记录",
|
|
||||||
value: "manual-out",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "报损记录",
|
|
||||||
value: "damage-out",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
initialValue: "",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default searchConfig;
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<page-search
|
|
||||||
ref="searchRef"
|
|
||||||
:search-config="searchConfig"
|
|
||||||
@query-click="handleQueryClick"
|
|
||||||
@reset-click="handleResetClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<page-content
|
|
||||||
ref="contentRef"
|
|
||||||
:content-config="contentConfig"
|
|
||||||
@add-click="handleAddClick"
|
|
||||||
@edit-click="handleEditClick"
|
|
||||||
@export-click="handleExportClick"
|
|
||||||
@search-click="handleSearchClick"
|
|
||||||
@toolbar-click="handleToolbarClick"
|
|
||||||
@operat-click="handleOperatClick"
|
|
||||||
@filter-change="handleFilterChange"
|
|
||||||
>
|
|
||||||
<template #conUnit="scope">
|
|
||||||
<span v-if="scope.row.inOutItem == 'manual-in'">手动入库</span>
|
|
||||||
<span v-if="scope.row.inOutItem == 'manual-out'">手动出库</span>
|
|
||||||
<span v-if="scope.row.inOutItem == 'win-in'">盘盈入库</span>
|
|
||||||
<span v-if="scope.row.inOutItem == 'loss-out'">盘亏出库</span>
|
|
||||||
<span v-if="scope.row.inOutItem == 'order-in'">订单退款入库</span>
|
|
||||||
<span v-if="scope.row.inOutItem == 'order-out'">订单消费出库</span>
|
|
||||||
</template>
|
|
||||||
</page-content>
|
|
||||||
|
|
||||||
<!-- 新增 -->
|
|
||||||
<page-modal
|
|
||||||
ref="addModalRef"
|
|
||||||
:modal-config="addModalConfig"
|
|
||||||
@submit-click="handleSubmitClick"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 编辑 -->
|
|
||||||
<page-modal
|
|
||||||
ref="editModalRef"
|
|
||||||
:modal-config="editModalConfig"
|
|
||||||
@submit-click="handleSubmitClick"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import VersionApi from "@/api/system/version";
|
|
||||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
|
||||||
import usePage from "@/components/CURD/usePage";
|
|
||||||
import addModalConfig from "./config/add";
|
|
||||||
import contentConfig from "./config/content";
|
|
||||||
import editModalConfig from "./config/edit";
|
|
||||||
import searchConfig from "./config/search";
|
|
||||||
|
|
||||||
const {
|
|
||||||
searchRef,
|
|
||||||
contentRef,
|
|
||||||
addModalRef,
|
|
||||||
editModalRef,
|
|
||||||
handleQueryClick,
|
|
||||||
handleResetClick,
|
|
||||||
// handleAddClick,
|
|
||||||
// handleEditClick,
|
|
||||||
handleSubmitClick,
|
|
||||||
handleExportClick,
|
|
||||||
handleSearchClick,
|
|
||||||
handleFilterChange,
|
|
||||||
} = usePage();
|
|
||||||
|
|
||||||
// 默认初始数据
|
|
||||||
const route = useRoute();
|
|
||||||
const { inOutItem, conId } = route.query;
|
|
||||||
if (inOutItem || conId) {
|
|
||||||
contentConfig.indexActionData = { inOutItem, conId };
|
|
||||||
if (inOutItem) {
|
|
||||||
searchConfig.formItems[1].initialValue = inOutItem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增
|
|
||||||
async function handleAddClick() {
|
|
||||||
addModalRef.value?.setModalVisible();
|
|
||||||
// addModalConfig.formItems[2]!.attrs!.data =
|
|
||||||
}
|
|
||||||
// 编辑
|
|
||||||
async function handleEditClick(row: IObject) {
|
|
||||||
editModalRef.value?.handleDisabled(false);
|
|
||||||
editModalRef.value?.setModalVisible();
|
|
||||||
// 根据id获取数据进行填充
|
|
||||||
console.log(row);
|
|
||||||
editModalRef.value?.setFormData({ ...row });
|
|
||||||
}
|
|
||||||
// 其他工具栏
|
|
||||||
function handleToolbarClick(name: string) {
|
|
||||||
console.log(name);
|
|
||||||
if (name === "custom1") {
|
|
||||||
ElMessage.success("点击了自定义1按钮");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 其他操作列
|
|
||||||
async function handleOperatClick(data: IOperatData) {
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
<!-- 耗材列表 -->
|
<!-- 耗材列表 -->
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" title="选择耗材">
|
<el-dialog title="选择耗材" v-model="dialogVisible">
|
||||||
<el-form :model="searchForm" inline>
|
<el-form :model="searchForm" inline>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="searchForm.conTypeName" placeholder="耗材类型名称" @input="onInput" />
|
<el-input
|
||||||
|
v-model="searchForm.conTypeName"
|
||||||
|
placeholder="耗材类型名称"
|
||||||
|
@input="onInput"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="searchForm.conName" placeholder="耗材名称" @input="onInput" />
|
<el-input v-model="searchForm.conName" placeholder="耗材名称" @input="onInput"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
@@ -14,13 +18,21 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-table ref="table" v-loading="tableData.loading" :data="tableData.list" :row-key="getRowKey"
|
<el-table
|
||||||
@select="firstSelectChange" @selection-change="onSelectionChange">
|
ref="table"
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
:data="tableData.list"
|
||||||
<el-table-column label="耗材名称" prop="conName" />
|
v-loading="tableData.loading"
|
||||||
<el-table-column label="所属分类" prop="consGroupName" />
|
@select="firstSelectChange"
|
||||||
<el-table-column label="价格" prop="price" />
|
:row-key="getRowKey"
|
||||||
<el-table-column label="单位" prop="conUnit" />
|
@selection-change="onSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||||
|
<el-table-column label="耗材名称" prop="conName"></el-table-column>
|
||||||
|
<el-table-column label="价格" prop="price"></el-table-column>
|
||||||
|
<el-table-column label="耗材代码" prop="conCode"></el-table-column>
|
||||||
|
<el-table-column label="耗材类型名称" prop="conTypeName"></el-table-column>
|
||||||
|
<el-table-column label="单位" prop="conUnit"></el-table-column>
|
||||||
|
<el-table-column label="最近入库量" prop="lasterInStock"></el-table-column>
|
||||||
<el-table-column label="库存数量" prop="stockNumber">
|
<el-table-column label="库存数量" prop="stockNumber">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ formatDecimal(scope.row.stockNumber, 2, true) }}
|
{{ formatDecimal(scope.row.stockNumber, 2, true) }}
|
||||||
@@ -33,8 +45,14 @@
|
|||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
<el-pagination
|
||||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" @size-change="sizeChange" />
|
:total="tableData.total"
|
||||||
|
:current-page="tableData.page + 1"
|
||||||
|
:page-size="tableData.size"
|
||||||
|
@current-change="paginationChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
></el-pagination>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
|||||||
@@ -1,81 +1,128 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container bg-fff u-m-20">
|
<div class="app-container bg-fff u-m-20">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="100px">
|
<el-form
|
||||||
|
ref="queryForm"
|
||||||
|
:model="queryForm"
|
||||||
|
:rules="queryRules"
|
||||||
|
label-position="left"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item label="类型">
|
<el-form-item label="类型">
|
||||||
<el-radio-group :model-value="type" @change="tabChange">
|
<el-radio-group :model-value="type">
|
||||||
<el-radio v-if="type == 'reportinglosses'" value="reportinglosses">报损</el-radio>
|
<el-radio-button value="in">入库</el-radio-button>
|
||||||
<div v-else>
|
<el-radio-button value="out">出库</el-radio-button>
|
||||||
<el-radio value="in">入库</el-radio>
|
|
||||||
<el-radio value="out">出库</el-radio>
|
|
||||||
</div>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div v-if="type != 'reportinglosses'">
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col v-if="type == 'in'" :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="供应商">
|
<el-form-item label="供应商">
|
||||||
<el-select v-model="queryForm.vendorId" placeholder="请选择供应商" clearable style="width: 220px"
|
<el-select
|
||||||
@change="changeTypeEnum">
|
v-model="queryForm.vendorId"
|
||||||
<el-option v-for="item in purveyorList" :key="item.id" :label="item.name" :value="item.id" />
|
placeholder="请选择供应商"
|
||||||
|
clearable
|
||||||
|
style="width: 220px"
|
||||||
|
@change="changeTypeEnum"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
v-for="item in purveyorList"
|
||||||
|
:key="item.id"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
{{ queryForm.waitAmount }}
|
{{ queryForm.waitAmount }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出入库时间" prop="inOutDate">
|
<el-form-item label="出入库时间" prop="inOutDate">
|
||||||
<el-date-picker v-model="queryForm.inOutDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
<el-date-picker
|
||||||
placeholder="选择日期" style="width: 220px" disabled="false" />
|
v-model="queryForm.inOutDate"
|
||||||
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="选择日期"
|
||||||
|
style="width: 220px"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="应付金额">
|
<el-form-item label="应付金额">
|
||||||
<el-input v-model="queryForm.amountPayable" placeholder="请输入应收金额" style="width: 220px" />
|
<el-input
|
||||||
|
v-model="queryForm.amountPayable"
|
||||||
|
placeholder="请输入应收金额"
|
||||||
|
style="width: 220px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="实付金额">
|
<el-form-item label="实付金额">
|
||||||
<el-input v-model="queryForm.actualPaymentAmount" placeholder="请输入实收金额" style="width: 220px" />
|
<el-input
|
||||||
|
v-model="queryForm.actualPaymentAmount"
|
||||||
|
placeholder="请输入实收金额"
|
||||||
|
style="width: 220px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="付款时间">
|
<el-form-item label="付款时间">
|
||||||
<el-date-picker v-model="queryForm.paymentDate" type="date" format="YYYY-MM-DD"
|
<el-date-picker
|
||||||
value-format="YYYY-MM-DD" placeholder="选择日期" style="width: 220px" />
|
v-model="queryForm.paymentDate"
|
||||||
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="选择日期"
|
||||||
|
style="width: 220px"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="批号">
|
<el-form-item label="批号">
|
||||||
<el-input v-model="queryForm.batchNo" placeholder="请输入批号" style="width: 220px" />
|
<el-input
|
||||||
|
v-model="queryForm.batchNo"
|
||||||
|
placeholder="请输入批号"
|
||||||
|
style="width: 220px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col> -->
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- <el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px" />
|
<el-input
|
||||||
|
v-model="queryForm.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
style="width: 220px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row> -->
|
</el-row>
|
||||||
</div>
|
|
||||||
<el-form-item label="选择耗材">
|
<el-form-item label="选择耗材">
|
||||||
<div />
|
<div></div>
|
||||||
<el-button type="primary" @click="showHaocai">选择耗材</el-button>
|
<el-button type="primary" @click="showHaocai">选择耗材</el-button>
|
||||||
|
|
||||||
<el-autocomplete v-model="autocompletename" :fetch-suggestions="querySearchAsync" value-key="conName"
|
<el-autocomplete
|
||||||
placeholder="耗材搜索" style="width: 200px; margin-left: 20px" @select="handleSelect" />
|
v-model="autocompletename"
|
||||||
|
:fetch-suggestions="querySearchAsync"
|
||||||
|
value-key="conName"
|
||||||
|
placeholder="耗材搜索"
|
||||||
|
@select="handleSelect"
|
||||||
|
style="width: 200px; margin-left: 20px"
|
||||||
|
></el-autocomplete>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-weight: bold; font-size: 16px; color: #666">
|
<div class="head-container">
|
||||||
|
<el-button type="primary" plain>
|
||||||
共{{ tableData.list.length }}种耗材,金额合计
|
共{{ tableData.list.length }}种耗材,金额合计
|
||||||
<span style="color: red">¥{{ amountPayable }}</span>
|
<span style="color: red">¥{{ amountPayable }}</span>
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-table :data="tableData.list">
|
<el-table :data="tableData.list">
|
||||||
@@ -84,14 +131,13 @@
|
|||||||
{{ scope.row.conName }}
|
{{ scope.row.conName }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所属分类">
|
<el-table-column label="进价">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.consGroupName }}
|
<el-input-number
|
||||||
</template>
|
v-model="scope.row.price"
|
||||||
</el-table-column>
|
:min="0"
|
||||||
<el-table-column>
|
controls-position="right"
|
||||||
<template v-slot="scope">
|
></el-input-number>
|
||||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right" />
|
|
||||||
<div class="tips" style="font-size: 16px">
|
<div class="tips" style="font-size: 16px">
|
||||||
原价¥
|
原价¥
|
||||||
|
|
||||||
@@ -103,17 +149,30 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单位">
|
<el-table-column label="单位">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-select v-model="scope.row.unit" :placeholder="scope.row.unit" @change="changeUnit(scope.row)">
|
<el-select
|
||||||
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit" />
|
v-model="scope.row.unit"
|
||||||
<el-option v-if="scope.row.conUnitTwo" :label="scope.row.conUnitTwo" :value="scope.row.conUnitTwo" />
|
:placeholder="scope.row.unit"
|
||||||
|
@change="changeUnit(scope.row)"
|
||||||
|
>
|
||||||
|
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit"></el-option>
|
||||||
|
<el-option
|
||||||
|
:label="scope.row.conUnitTwo"
|
||||||
|
:value="scope.row.conUnitTwo"
|
||||||
|
v-if="scope.row.conUnitTwo"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="tips"> </div>
|
<div class="tips"> </div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="数量">
|
<el-table-column label="数量">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly
|
<el-input-number
|
||||||
controls-position="right" />
|
v-model="scope.row.stockNumber"
|
||||||
|
:min="0"
|
||||||
|
:step="1"
|
||||||
|
step-strictly
|
||||||
|
controls-position="right"
|
||||||
|
></el-input-number>
|
||||||
<div class="tips" style="font-size: 16px">
|
<div class="tips" style="font-size: 16px">
|
||||||
{{ type == "in" ? "入库" : "出库" }}前:
|
{{ type == "in" ? "入库" : "出库" }}前:
|
||||||
{{ returnStockNumber(scope.row, scope.row.number) }}
|
{{ returnStockNumber(scope.row, scope.row.number) }}
|
||||||
@@ -122,27 +181,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column v-if="type == 'reportinglosses'" label="报损数量">
|
<el-table-column label="小计">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.number }}
|
<el-input :value="xiaoji(scope.row)" readonly style="width: 100px" />
|
||||||
<div class="tips" style="font-size: 16px">
|
|
||||||
入库前:
|
|
||||||
{{ returnStockNumber(scope.row, scope.row.number) }}
|
|
||||||
|
|
||||||
{{ scope.row.unit }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<el-table-column v-if="type == 'reportinglosses'" label="上传图片">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<MultiImageUpload v-model="scope.row.imgUrls" />
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="备注">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-input v-model="textarea" stype="textarea" placeholder="" />
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<el-table-column label="操作" width="80">
|
<el-table-column label="操作" width="80">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button link @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
<el-button link @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||||
@@ -151,14 +195,21 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" :loading="queryFormLoading" @click="submitHandle">
|
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
||||||
保存并返回
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 选择耗材 -->
|
<!-- 选择耗材 -->
|
||||||
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||||
<el-dialog v-model="showResult" :show-close="false" :close-on-press-escape="false" :close-on-click-modal="false">
|
<el-dialog
|
||||||
<el-result icon="success" title="入库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
v-model="showResult"
|
||||||
|
:show-close="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-result
|
||||||
|
icon="success"
|
||||||
|
title="入库提交成功"
|
||||||
|
:subTitle="`共操作${tableData.list.length}件商品`"
|
||||||
|
>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<template>
|
<template>
|
||||||
<el-button type="primary" size="medium" @click="resetHandle">创建新的入库单</el-button>
|
<el-button type="primary" size="medium" @click="resetHandle">创建新的入库单</el-button>
|
||||||
@@ -180,8 +231,6 @@ import vendorApi from "@/api/product/vendor";
|
|||||||
import stockApi from "@/api/product/stock";
|
import stockApi from "@/api/product/stock";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import goodsList from "./components/goods-list.vue";
|
import goodsList from "./components/goods-list.vue";
|
||||||
import MultiImageUpload from "@/components/Upload/MultiImageUpload.vue";
|
|
||||||
|
|
||||||
import ConsumableList from "./components/consumableList.vue";
|
import ConsumableList from "./components/consumableList.vue";
|
||||||
import { formatDecimal } from "@/utils/tools.js";
|
import { formatDecimal } from "@/utils/tools.js";
|
||||||
export default {
|
export default {
|
||||||
@@ -199,7 +248,7 @@ export default {
|
|||||||
{
|
{
|
||||||
label: "商品入库",
|
label: "商品入库",
|
||||||
value: "goods",
|
value: "goods",
|
||||||
type: "out",
|
type: "purveyor",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "耗材入库",
|
label: "耗材入库",
|
||||||
@@ -208,6 +257,22 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
shopTypesActive: 0,
|
shopTypesActive: 0,
|
||||||
|
shopTypes: [
|
||||||
|
{
|
||||||
|
label: "供应商入库",
|
||||||
|
value: "purveyor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "其他入库",
|
||||||
|
value: "purchase",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
shopTypes2: [
|
||||||
|
{
|
||||||
|
label: "供应商入库",
|
||||||
|
value: "purveyor",
|
||||||
|
},
|
||||||
|
],
|
||||||
resetForm: "",
|
resetForm: "",
|
||||||
queryFormLoading: false,
|
queryFormLoading: false,
|
||||||
queryForm: {
|
queryForm: {
|
||||||
@@ -249,6 +314,11 @@ export default {
|
|||||||
timeout: null,
|
timeout: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.type = this.$route.query.type || "in";
|
||||||
|
this.resetForm = { ...this.queryForm };
|
||||||
|
this.tbShopPurveyorGet();
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
amountPayable() {
|
amountPayable() {
|
||||||
if (!this.tableData.list.length) return 0;
|
if (!this.tableData.list.length) return 0;
|
||||||
@@ -263,11 +333,6 @@ export default {
|
|||||||
this.queryForm.amountPayable = newval;
|
this.queryForm.amountPayable = newval;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.type = this.$route.query.type || "in";
|
|
||||||
this.resetForm = { ...this.queryForm };
|
|
||||||
this.tbShopPurveyorGet();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
changeUnit(row) {
|
changeUnit(row) {
|
||||||
row.price = this.returnPrice(row, row.originPrice);
|
row.price = this.returnPrice(row, row.originPrice);
|
||||||
@@ -328,7 +393,6 @@ export default {
|
|||||||
const price = row.price * row.stockNumber;
|
const price = row.price * row.stockNumber;
|
||||||
return price;
|
return price;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSelect(item) {
|
handleSelect(item) {
|
||||||
//选定后清空
|
//选定后清空
|
||||||
this.autocompletename = "";
|
this.autocompletename = "";
|
||||||
@@ -336,13 +400,12 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 切换入库内容
|
// 切换入库内容
|
||||||
tabChange(value) {
|
tabChange(value, type) {
|
||||||
this.shopTypesActive = value == "in" ? 0 : 1;
|
this.shopTypesActive = type == "in" ? 0 : 1;
|
||||||
this.inTabValue = value;
|
this.inTabValue = value;
|
||||||
this.type = value;
|
|
||||||
this.resetHandle();
|
this.resetHandle();
|
||||||
// this.$refs.shopList.reset(); //清除选项
|
this.$refs.shopList.reset(); //清除选项
|
||||||
// this.$refs.ConsumableList.reset(); //清除选项
|
this.$refs.ConsumableList.reset(); //清除选项
|
||||||
},
|
},
|
||||||
// 切换类型
|
// 切换类型
|
||||||
changeTypeEnum(index) {
|
changeTypeEnum(index) {
|
||||||
@@ -389,26 +452,21 @@ export default {
|
|||||||
unitName: v.conUnit,
|
unitName: v.conUnit,
|
||||||
inOutNumber,
|
inOutNumber,
|
||||||
subTotal: this.xiaoji(v),
|
subTotal: this.xiaoji(v),
|
||||||
imgUrls: v.imgUrls,
|
|
||||||
number: v.number,
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
if (this.type == "in") {
|
if (this.type == "in") {
|
||||||
await stockApi.in({ ...this.queryForm, bodyList });
|
await stockApi.in({ ...this.queryForm, bodyList });
|
||||||
} else if (this.type == "out") {
|
} else {
|
||||||
await stockApi.out({ ...this.queryForm, bodyList });
|
await stockApi.out({ ...this.queryForm, bodyList });
|
||||||
} else if (this.type == "reportinglosses") {
|
|
||||||
await stockApi.reportinglosses(bodyList);
|
|
||||||
}
|
}
|
||||||
this.queryFormLoading = false;
|
this.queryFormLoading = false;
|
||||||
// const title = this.type == "in" ? "入库" : "出库";
|
const title = this.type == "in" ? "入库" : "出库";
|
||||||
ElMessage({
|
ElMessage({
|
||||||
// message: title + "提交成功",
|
message: title + "提交成功",
|
||||||
message: "提交成功",
|
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
this.$router.push("/inventory/consumables");
|
this.resetHandle(); //初始化
|
||||||
this.showResult = true;
|
// this.showResult = true
|
||||||
// this.$refs.shopList.reset()//清除选项
|
// this.$refs.shopList.reset()//清除选项
|
||||||
// this.$refs.ConsumableList.reset()//清除选项
|
// this.$refs.ConsumableList.reset()//清除选项
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -429,7 +487,6 @@ export default {
|
|||||||
item.unit = item.defaultUnit || item.conUnit;
|
item.unit = item.defaultUnit || item.conUnit;
|
||||||
item.originPrice = item.price;
|
item.originPrice = item.price;
|
||||||
item.price = this.returnPrice(item, item.price);
|
item.price = this.returnPrice(item, item.price);
|
||||||
item.imgUrls = item.imgUrls ? item.imgUrls : [];
|
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
this.tableData.list = [...this.tableData.list, ...arr];
|
this.tableData.list = [...this.tableData.list, ...arr];
|
||||||
@@ -439,8 +496,7 @@ export default {
|
|||||||
resetHandle() {
|
resetHandle() {
|
||||||
this.showResult = false;
|
this.showResult = false;
|
||||||
this.queryForm = { ...this.resetForm };
|
this.queryForm = { ...this.resetForm };
|
||||||
console.log(this.inTabs, this.inTabValue);
|
this.queryForm.type = this.inTabs.find((item) => item.value == this.inTabValue).type;
|
||||||
this.queryForm.type = this.inTabs.find((item) => item.type == this.inTabValue).type;
|
|
||||||
this.tableData.list = [];
|
this.tableData.list = [];
|
||||||
this.$refs.queryForm.resetFields();
|
this.$refs.queryForm.resetFields();
|
||||||
},
|
},
|
||||||
@@ -468,5 +524,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-container {}
|
.app-container {
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -19,6 +19,7 @@ const modalConfig: IModalConfig = {
|
|||||||
console.log("提交之前处理", data);
|
console.log("提交之前处理", data);
|
||||||
},
|
},
|
||||||
formItems: [
|
formItems: [
|
||||||
|
|
||||||
{
|
{
|
||||||
label: "名称",
|
label: "名称",
|
||||||
prop: "name",
|
prop: "name",
|
||||||
@@ -40,7 +41,7 @@ const modalConfig: IModalConfig = {
|
|||||||
prop: "telephone",
|
prop: "telephone",
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请输入联系人电话",
|
placeholder: "请输入联系人名字",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,6 +69,7 @@ const modalConfig: IModalConfig = {
|
|||||||
placeholder: "请输入排序",
|
placeholder: "请输入排序",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,15 +23,7 @@ const contentConfig: IContentConfig = {
|
|||||||
return Api.edit(data);
|
return Api.edit(data);
|
||||||
},
|
},
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: [
|
toolbar: ["add"],
|
||||||
{
|
|
||||||
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" },
|
||||||
@@ -65,13 +57,13 @@ const contentConfig: IContentConfig = {
|
|||||||
align: "center",
|
align: "center",
|
||||||
prop: "createTime",
|
prop: "createTime",
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// label: "状态",
|
label: "状态",
|
||||||
// align: "center",
|
align: "center",
|
||||||
// prop: "status",
|
prop: "status",
|
||||||
// templet: 'custom',
|
templet: 'custom',
|
||||||
// slotName: 'switch'
|
slotName: 'switch'
|
||||||
// },
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: "操作",
|
label: "操作",
|
||||||
@@ -79,7 +71,7 @@ const contentConfig: IContentConfig = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: [{ text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
|
operat: ["edit", 'delete'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const modalConfig: IModalConfig = {
|
|||||||
console.log("提交之前处理", data);
|
console.log("提交之前处理", data);
|
||||||
},
|
},
|
||||||
formItems: [
|
formItems: [
|
||||||
|
|
||||||
{
|
{
|
||||||
label: "名称",
|
label: "名称",
|
||||||
prop: "name",
|
prop: "name",
|
||||||
@@ -40,7 +41,7 @@ const modalConfig: IModalConfig = {
|
|||||||
prop: "telephone",
|
prop: "telephone",
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请输入联系人电话",
|
placeholder: "请输入联系人名字",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,6 +69,7 @@ const modalConfig: IModalConfig = {
|
|||||||
placeholder: "请输入排序",
|
placeholder: "请输入排序",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ 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,
|
||||||
@@ -88,16 +87,6 @@ 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();
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login" :style="'background-image:url(' + Background + ');'">
|
<div class="login" :style="'background-image:url(' + Background + ');'">
|
||||||
<el-form ref="loginForm" :model="state.loginForm" :rules="state.loginRules" label-position="left" label-width="0px"
|
<el-form
|
||||||
class="login-form">
|
ref="loginForm"
|
||||||
|
:model="state.loginForm"
|
||||||
|
:rules="state.loginRules"
|
||||||
|
label-position="left"
|
||||||
|
label-width="0px"
|
||||||
|
class="login-form"
|
||||||
|
>
|
||||||
<h3 class="title">银收客后台管理</h3>
|
<h3 class="title">银收客后台管理</h3>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio-group v-model="state.loginForm.loginType">
|
<el-radio-group v-model="state.loginForm.loginType">
|
||||||
@@ -10,19 +16,39 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="state.loginForm.username" type="text" auto-complete="off" placeholder="商户号"></el-input>
|
<el-input
|
||||||
|
v-model="state.loginForm.username"
|
||||||
|
type="text"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="商户号"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="staffUserName" v-if="state.loginForm.loginType == 1">
|
<el-form-item prop="staffUserName" v-if="state.loginForm.loginType == 1">
|
||||||
<el-input v-model="state.loginForm.staffUserName" type="text" auto-complete="off" placeholder="账号"></el-input>
|
<el-input
|
||||||
|
v-model="state.loginForm.staffUserName"
|
||||||
|
type="text"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="账号"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input v-model="state.loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
<el-input
|
||||||
@keyup.enter="handleLogin"></el-input>
|
v-model="state.loginForm.password"
|
||||||
|
type="password"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="密码"
|
||||||
|
@keyup.enter="handleLogin"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code">
|
<el-form-item prop="code">
|
||||||
<div class="code_wrap">
|
<div class="code_wrap">
|
||||||
<el-input v-model="state.loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
|
<el-input
|
||||||
@keyup.enter="handleLogin"></el-input>
|
v-model="state.loginForm.code"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="验证码"
|
||||||
|
style="width: 63%"
|
||||||
|
@keyup.enter="handleLogin"
|
||||||
|
></el-input>
|
||||||
<div class="login-code">
|
<div class="login-code">
|
||||||
<img :src="state.codeUrl" @click="getCode" />
|
<img :src="state.codeUrl" @click="getCode" />
|
||||||
</div>
|
</div>
|
||||||
@@ -30,8 +56,13 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item style="width: 100%">
|
<el-form-item style="width: 100%">
|
||||||
<el-button :loading="state.loading" size="default" type="primary" style="width: 100%"
|
<el-button
|
||||||
@click.prevent="handleLogin">
|
:loading="state.loading"
|
||||||
|
size="default"
|
||||||
|
type="primary"
|
||||||
|
style="width: 100%"
|
||||||
|
@click.prevent="handleLogin"
|
||||||
|
>
|
||||||
<span v-if="!state.loading">登 录</span>
|
<span v-if="!state.loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -167,14 +198,11 @@ function handleLogin() {
|
|||||||
loginName: userStore.userInfo.phone,
|
loginName: userStore.userInfo.phone,
|
||||||
token,
|
token,
|
||||||
}).then((checkInfo) => {
|
}).then((checkInfo) => {
|
||||||
console.log("checkInfo", checkInfo);
|
console.log("checkInfo", checkInfo.userInfo);
|
||||||
userStore.meituan_douyin_info = checkInfo.userInfo;
|
userStore.meituan_douyin_info = checkInfo.userInfo;
|
||||||
setDouyinToken(checkInfo.userInfo.token);
|
setDouyinToken(checkInfo.userInfo.token);
|
||||||
});
|
});
|
||||||
localStorage.removeItem("shopName")
|
await userStore.getUserInfo();
|
||||||
let resData = await $API_login.getPermission()
|
|
||||||
localStorage.setItem("permission",JSON.stringify(resData))
|
|
||||||
localStorage.setItem("loginType",state.loginForm.loginType)
|
|
||||||
|
|
||||||
const { path, queryParams } = parseRedirect();
|
const { path, queryParams } = parseRedirect();
|
||||||
console.log(path, queryParams);
|
console.log(path, queryParams);
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<RouterView />
|
|
||||||
</template>
|
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<div class="card">
|
|
||||||
<div class="row" v-for="(item, index) in menus" :key="index">
|
|
||||||
<div class="title">
|
|
||||||
{{ item.label }}
|
|
||||||
</div>
|
|
||||||
<div class="menus_wrap">
|
|
||||||
<div class="item" v-for="(val, i) in item.list" :key="i">
|
|
||||||
<img :src="getIconPath(val.icon)" class="icon" @error="handleImageError(val)" />
|
|
||||||
<div class="info" @click="to(val)">
|
|
||||||
<div class="name">{{ val.name }}</div>
|
|
||||||
<div class="intro">
|
|
||||||
{{ val.intro }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import defaultIcon from '@/assets/logo.png';
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const to = (item) => {
|
|
||||||
if (!item.path) {
|
|
||||||
ElMessage.warning('暂未开放')
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
router.push("/application/" + item.path);
|
|
||||||
};
|
|
||||||
const menus = ref([
|
|
||||||
{
|
|
||||||
label: '营销',
|
|
||||||
list: [
|
|
||||||
{ name: "霸王餐", icon: 'bwc', path: "bwc", intro: '设置充值消费的N倍,当前订单立即免单' },
|
|
||||||
{ name: "邀请列表", icon: 'yqlb', path: "invite", intro: '邀请好友领券' },
|
|
||||||
{ name: "积分锁客", icon: 'jfsk', path: "points", intro: '设置充值消费的N倍,当前订单立即免单' },
|
|
||||||
{ name: "充值活动", icon: 'czhd', path: "", intro: '允许客户充值并使用余额支付' },
|
|
||||||
{ name: "弹窗广告", icon: 'tcgg', path: "", intro: '设置弹窗广告' },
|
|
||||||
{ name: "超级会员", icon: 'cjhy', path: "", intro: '用户会员管理设置' },
|
|
||||||
{ name: "新客立减", icon: 'xklj', path: "", intro: '首单下单减免金额' },
|
|
||||||
{ name: "智慧充值", icon: 'zhcz', path: "", intro: '允许客户充值并使用余额支付' },
|
|
||||||
{ name: "分销", icon: 'zhcz', path: "", intro: '允许客户充值并使用余额支付' },
|
|
||||||
{ name: "消费返现", icon: 'xffx', path: "", intro: '用户下单后返现一定的金额到余额,可促进复购' },
|
|
||||||
{ name: "私域引流", icon: 'syyl', path: "", intro: '可设置用户下单成功后的群二维码' },
|
|
||||||
{ name: "满减活动", icon: 'mjhd', path: "", intro: '达到指定支付金额享受减价' },
|
|
||||||
{ name: "生日有礼", icon: 'sryl', path: "", intro: '用户生日管理设置' },
|
|
||||||
{ name: "点餐智能推荐", icon: 'dczntj', path: "", intro: '进入点单页X秒未点自动推荐商品,此推荐设置启用即生效' },
|
|
||||||
{ name: "超值券包", icon: 'czqb', path: "", intro: '下单加购' },
|
|
||||||
{ name: "套餐推广", icon: 'tctg', path: "", intro: '下单通过用户邀请好友减免金额的方式裂变宣传套餐加购' },
|
|
||||||
{ name: "充值兑换码", icon: 'czdhm', path: "", intro: '兑换码直充余额,可当作礼品赠送' },
|
|
||||||
{ name: "券兑换码", icon: 'qdhm', path: "", intro: '可添加多券组合兑换' },
|
|
||||||
{ name: "限时折扣", icon: 'xszk', path: "", intro: '批量设置商品折扣' },
|
|
||||||
{ name: "商品拼团", icon: 'sppt', path: "", intro: '拼团' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '优惠券',
|
|
||||||
list: [
|
|
||||||
{ name: "满减券", icon: 'mjq', path: "coupon", intro: '用户满足指定金额后,可使用优惠券立减相应金额,如:设置满100-50券,符合要求的订单满100元后,立减50元。' },
|
|
||||||
{ name: "商品兑换券", icon: 'spdhq', path: "bwc", intro: '设置可兑换成商品的券' },
|
|
||||||
{ name: "折扣券", icon: 'zkq', path: "", intro: '下单享折扣但折扣的金额将在券中抵扣。' },
|
|
||||||
{ name: "第二件半价券", icon: 'dejbjq', path: "", intro: '设置第二件半价券' },
|
|
||||||
{ name: "消费赠券", icon: 'xfzq', path: "", intro: '达到指定消费金额赠送优惠券' },
|
|
||||||
{ name: "买一送一券", icon: 'myzy', path: "", intro: '针对营销活动买一送一设置券品' },
|
|
||||||
{ name: "固定价格券", icon: 'gdjkq', path: "", intro: '设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。' },
|
|
||||||
{ name: "免配送费券", icon: 'mfpsq', path: "", intro: '可设置一张免除订单配送费的券' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '推送功能',
|
|
||||||
list: [
|
|
||||||
{ name: "推送活动消息", icon: 'tshdxx', path: "coupon", intro: '给用户推送服务通知' },
|
|
||||||
{ name: "短信推送", icon: 'dxts', path: "bwc", intro: '给用户推送服务通知' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '扩展功能',
|
|
||||||
list: [
|
|
||||||
{ name: "微信公众号", icon: 'wxgzh', path: "coupon", intro: '授权微信公众号后,让你能够在后台查看和维护公众号的粉丝;同时你的店铺也有出现关注公众号的入口。' },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
|
|
||||||
// 动态获取PNG图标路径
|
|
||||||
const getIconPath = (iconName) => {
|
|
||||||
try {
|
|
||||||
// 直接导入对应PNG文件
|
|
||||||
return new URL(`/src/assets/applocation/${iconName}.png`, import.meta.url).href;
|
|
||||||
} catch (error) {
|
|
||||||
console.warn(`图标 ${iconName}.png 不存在`);
|
|
||||||
return defaultIcon; // 图标不存在时使用默认图标
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 处理图片加载失败
|
|
||||||
const handleImageError = (item) => {
|
|
||||||
console.error(`图标 ${item.icon}.png 加载失败`);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.app-container {
|
|
||||||
padding: 14px;
|
|
||||||
|
|
||||||
.card {
|
|
||||||
padding: 14px;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
.row {
|
|
||||||
padding-bottom: 14px;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menus_wrap {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
gap: 14px;
|
|
||||||
margin-top: 14px;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #F8F8F8;
|
|
||||||
border-radius: 4px;
|
|
||||||
transition: all 0.1s ease-in-out;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: #d5ebff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
.name {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.intro {
|
|
||||||
margin-top: 4px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #666;
|
|
||||||
line-height: 1.4em;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 1;
|
|
||||||
line-clamp: 1;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
word-break: break-all;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>超级会员管理</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
import Api from "@/api/product/vendor";
|
|
||||||
import { returnOptions, switchAttr } from "./config";
|
|
||||||
import type { IModalConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const modalConfig: IModalConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
dialog: {
|
|
||||||
title: "添加供应商",
|
|
||||||
width: 800,
|
|
||||||
draggable: true,
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
labelWidth: 140,
|
|
||||||
},
|
|
||||||
formAction: function (data) {
|
|
||||||
return Api.add({ ...data });
|
|
||||||
},
|
|
||||||
beforeSubmit(data) {
|
|
||||||
console.log("提交之前处理", data);
|
|
||||||
},
|
|
||||||
formItems: [
|
|
||||||
{
|
|
||||||
label: "名称",
|
|
||||||
prop: "name",
|
|
||||||
rules: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入名称",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人名字",
|
|
||||||
prop: "contactName",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人电话",
|
|
||||||
prop: "telephone",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "供应商地址",
|
|
||||||
prop: "address",
|
|
||||||
rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入供应商地址",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "备注",
|
|
||||||
prop: "remark",
|
|
||||||
rules: [{ required: false, message: "请输入备注", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入备注",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "排序",
|
|
||||||
prop: "sort",
|
|
||||||
rules: [{ required: true, message: "请输入排序", trigger: "blur" }],
|
|
||||||
type: "input-number",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入排序",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出
|
|
||||||
export default reactive(modalConfig);
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
export interface options {
|
|
||||||
label: string;
|
|
||||||
value: string | number;
|
|
||||||
[property: string]: any;
|
|
||||||
}
|
|
||||||
export interface optionObject {
|
|
||||||
[property: string]: options[];
|
|
||||||
}
|
|
||||||
const options: optionObject = {
|
|
||||||
payType: [
|
|
||||||
{ label: "现金", value: "cash" },
|
|
||||||
{ label: "微信", value: "weixin" },
|
|
||||||
{ label: "银行卡", value: "bank" },
|
|
||||||
{ label: "会员支付", value: "member-account" },
|
|
||||||
{ label: "支付宝", value: "alipay" },
|
|
||||||
{ label: "刷卡", value: "deposit" },
|
|
||||||
{ label: "挂账", value: "arrears" },
|
|
||||||
{ label: "刷卡", value: "deposit" },
|
|
||||||
{ label: "储值", value: "member-account" },
|
|
||||||
{ label: "自定义", value: "virtual" },
|
|
||||||
],
|
|
||||||
isIdeal: [
|
|
||||||
{ label: "否", value: 0 },
|
|
||||||
{ label: "是", value: 1 },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export const switchAttr = {
|
|
||||||
"active-value": 1,
|
|
||||||
"inactive-value": 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
export type optionsType = string;
|
|
||||||
|
|
||||||
export function returnOptions(type: optionsType) {
|
|
||||||
return options[type];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function returnOptionsLabel(optionsType: optionsType, value: string | number) {
|
|
||||||
const options = returnOptions(optionsType);
|
|
||||||
if (!options) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
const option = options.find((item) => item.value === value);
|
|
||||||
return option ? option.label : "";
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
import Api from "@/api/notifications";
|
|
||||||
import type { IContentConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const contentConfig: IContentConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
table: {
|
|
||||||
border: true,
|
|
||||||
highlightCurrentRow: true,
|
|
||||||
},
|
|
||||||
pagination: {
|
|
||||||
background: true,
|
|
||||||
layout: "prev,pager,next,jumper,total,sizes",
|
|
||||||
pageSize: 20,
|
|
||||||
pageSizes: [10, 20, 30, 50],
|
|
||||||
},
|
|
||||||
indexAction: function (params) {
|
|
||||||
return Api.getList(params);
|
|
||||||
},
|
|
||||||
deleteAction: function (id) {
|
|
||||||
return Api.delete(id);
|
|
||||||
},
|
|
||||||
modifyAction: function (data) {
|
|
||||||
return Api.edit(data);
|
|
||||||
},
|
|
||||||
indexActionData: {},
|
|
||||||
pk: "id",
|
|
||||||
toolbar: [
|
|
||||||
{
|
|
||||||
text: "全部已读",
|
|
||||||
name: "mark_all_read",
|
|
||||||
auth: "",
|
|
||||||
type: "primary",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "清空已读",
|
|
||||||
name: "Clear_Read",
|
|
||||||
auth: "",
|
|
||||||
type: "danger",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
defaultToolbar: ["refresh", "filter", "search"],
|
|
||||||
cols: [
|
|
||||||
// { type: "selection", width: 50, align: "center" },
|
|
||||||
{
|
|
||||||
label: "通知类型",
|
|
||||||
align: "center",
|
|
||||||
prop: "title",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "是否已读",
|
|
||||||
align: "center",
|
|
||||||
prop: "isRead",
|
|
||||||
slotName: "isRead",
|
|
||||||
templet: "custom",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "消息内容",
|
|
||||||
align: "center",
|
|
||||||
prop: "content",
|
|
||||||
slotName: "content",
|
|
||||||
templet: "custom",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "创建时间",
|
|
||||||
align: "center",
|
|
||||||
prop: "createTime",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "操作",
|
|
||||||
align: "center",
|
|
||||||
fixed: "right",
|
|
||||||
width: 280,
|
|
||||||
templet: "custom",
|
|
||||||
slotName: "operate",
|
|
||||||
operat: ["delete"],
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// label: "操作",
|
|
||||||
// align: "center",
|
|
||||||
// fixed: "right",
|
|
||||||
// width: 150,
|
|
||||||
// templet: "custom",
|
|
||||||
// slotName: "operate",
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default contentConfig;
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
import Api from "@/api/product/vendor";
|
|
||||||
import { returnOptions, switchAttr } from "./config";
|
|
||||||
import type { IModalConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const modalConfig: IModalConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
dialog: {
|
|
||||||
title: "编辑供应商",
|
|
||||||
width: 800,
|
|
||||||
draggable: true,
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
labelWidth: 140,
|
|
||||||
},
|
|
||||||
formAction: function (data) {
|
|
||||||
return Api.edit({ ...data });
|
|
||||||
},
|
|
||||||
beforeSubmit(data) {
|
|
||||||
console.log("提交之前处理", data);
|
|
||||||
},
|
|
||||||
formItems: [
|
|
||||||
{
|
|
||||||
label: "名称",
|
|
||||||
prop: "name",
|
|
||||||
rules: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入名称",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人名字",
|
|
||||||
prop: "contactName",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "联系人电话",
|
|
||||||
prop: "telephone",
|
|
||||||
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入联系人名字",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "供应商地址",
|
|
||||||
prop: "address",
|
|
||||||
rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入供应商地址",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "备注",
|
|
||||||
prop: "remark",
|
|
||||||
rules: [{ required: false, message: "请输入备注", trigger: "blur" }],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入备注",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "排序",
|
|
||||||
prop: "sort",
|
|
||||||
rules: [{ required: true, message: "请输入排序", trigger: "blur" }],
|
|
||||||
type: "input-number",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入排序",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出
|
|
||||||
export default reactive(modalConfig);
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import type { ISearchConfig } from "@/components/CURD/types";
|
|
||||||
const searchConfig: ISearchConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
isExpandable: false,
|
|
||||||
formItems: [
|
|
||||||
{
|
|
||||||
type: "select",
|
|
||||||
label: "通知类型 ",
|
|
||||||
prop: "type",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请选择",
|
|
||||||
clearable: true,
|
|
||||||
style: {
|
|
||||||
width: "200px",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: "数据同步",
|
|
||||||
value: "数据同步",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "数据变动",
|
|
||||||
value: "数据变动",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "库存预警",
|
|
||||||
value: "库存预警",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "select",
|
|
||||||
label: "是否已读",
|
|
||||||
prop: "isRead",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请选择",
|
|
||||||
clearable: true,
|
|
||||||
style: {
|
|
||||||
width: "200px",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: "未读",
|
|
||||||
value: "0",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "已读",
|
|
||||||
value: "1",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default searchConfig;
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
|
||||||
@reset-click="handleResetClick" />
|
|
||||||
<!-- 列表 -->
|
|
||||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
|
||||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
|
||||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
|
||||||
<!-- <template #type="scope">
|
|
||||||
<span v-if="scope.row.type == 0">商品新增</span>
|
|
||||||
<span v-if="scope.row.type == 1">商品编辑</span>
|
|
||||||
<span v-if="scope.row.type == 2">耗材新增</span>
|
|
||||||
<span v-if="scope.row.type == 3">耗材编辑</span>
|
|
||||||
</template> -->
|
|
||||||
<template #content="scope">
|
|
||||||
<span>{{ scope.row.title }}</span>
|
|
||||||
<!-- <span v-if="scope.row.type == 1">商品编辑</span>
|
|
||||||
<span v-if="scope.row.type == 2">耗材新增</span>
|
|
||||||
<span v-if="scope.row.type == 3">耗材编辑</span> -->
|
|
||||||
<div v-for="(item, index) in matchedProducts(scope.row.content)" :key="index">
|
|
||||||
<span v-for="i in item.map" :key="i.id" style="color: #6161f7" @click="handleContentClick(item, i)">
|
|
||||||
{{ i.name }},
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
请及时确认
|
|
||||||
</template>
|
|
||||||
<template #isRead="scope">
|
|
||||||
<el-tag :type="scope.row.isRead == 1 ? 'success' : 'info'">
|
|
||||||
{{ scope.row.isRead == 1 ? "已读" : "未读" }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
<template #operate="scope">
|
|
||||||
<div style="
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
">
|
|
||||||
<div v-if="scope.row.isRead != 1">
|
|
||||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, '')">
|
|
||||||
设为已读
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'delete')">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</page-content>
|
|
||||||
|
|
||||||
<!-- 新增 -->
|
|
||||||
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick" />
|
|
||||||
|
|
||||||
<!-- 编辑 -->
|
|
||||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import VersionApi from "@/api/system/version";
|
|
||||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
|
||||||
import usePage from "@/components/CURD/usePage";
|
|
||||||
import addModalConfig from "./config/add";
|
|
||||||
import contentConfig from "./config/content";
|
|
||||||
import editModalConfig from "./config/edit";
|
|
||||||
import searchConfig from "./config/search";
|
|
||||||
import Api from "@/api/notifications";
|
|
||||||
import router from "@/router";
|
|
||||||
import { log } from "console";
|
|
||||||
|
|
||||||
const {
|
|
||||||
searchRef,
|
|
||||||
contentRef,
|
|
||||||
addModalRef,
|
|
||||||
editModalRef,
|
|
||||||
handleQueryClick,
|
|
||||||
handleResetClick,
|
|
||||||
// handleAddClick,
|
|
||||||
// handleEditClick,
|
|
||||||
handleSubmitClick,
|
|
||||||
handleExportClick,
|
|
||||||
handleSearchClick,
|
|
||||||
handleFilterChange,
|
|
||||||
} = usePage();
|
|
||||||
|
|
||||||
// 新增
|
|
||||||
async function handleAddClick() {
|
|
||||||
addModalRef.value?.setModalVisible();
|
|
||||||
// addModalConfig.formItems[2]!.attrs!.data =
|
|
||||||
}
|
|
||||||
// 编辑
|
|
||||||
async function handleEditClick(row: IObject) {
|
|
||||||
editModalRef.value?.handleDisabled(false);
|
|
||||||
editModalRef.value?.setModalVisible();
|
|
||||||
// 根据id获取数据进行填充
|
|
||||||
editModalRef.value?.setFormData({ ...row });
|
|
||||||
}
|
|
||||||
// 其他工具栏
|
|
||||||
async function handleToolbarClick(name: string) {
|
|
||||||
if (name === "mark_all_read") {
|
|
||||||
await Api.edit({
|
|
||||||
noticeIdList: [],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (name == "Clear_Read") {
|
|
||||||
await Api.syncNoticeclear();
|
|
||||||
}
|
|
||||||
contentRef.value?.fetchPageData();
|
|
||||||
}
|
|
||||||
|
|
||||||
const matchedProducts = (data: string) => {
|
|
||||||
return JSON.parse(data);
|
|
||||||
};
|
|
||||||
|
|
||||||
//删除
|
|
||||||
async function refAddHaocaiTakinShow(item: any, type: string) {
|
|
||||||
if (type === "delete") {
|
|
||||||
await Api.delete(item.id);
|
|
||||||
} else {
|
|
||||||
await Api.edit({
|
|
||||||
noticeIdList: [item.id],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
contentRef.value?.fetchPageData();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 其他操作列
|
|
||||||
async function handleOperatClick(data: IOperatData) {
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
// Handle content click
|
|
||||||
function handleContentClick(scope: any, item: any) {
|
|
||||||
if (scope.type == "product") {
|
|
||||||
router.push({
|
|
||||||
path: "/product/addgoods",
|
|
||||||
query: { goods_id: item.id },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (scope.type == "consInfo") {
|
|
||||||
router.push({
|
|
||||||
path: "/inventory/consumables",
|
|
||||||
query: { conName: item.name },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -4,18 +4,11 @@
|
|||||||
<template v-if="isA">
|
<template v-if="isA">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content
|
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||||
ref="contentRef"
|
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||||
:content-config="contentConfig"
|
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||||
@add-click="handleAddClick"
|
|
||||||
@edit-click="handleEditClick"
|
|
||||||
@export-click="handleExportClick"
|
|
||||||
@search-click="handleSearchClick"
|
|
||||||
@toolbar-click="handleToolbarClick"
|
|
||||||
@operat-click="handleOperatClick"
|
|
||||||
@filter-change="handleFilterChange"
|
|
||||||
>
|
|
||||||
<template #status="scope">
|
<template #status="scope">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
@@ -29,11 +22,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #mobile="scope">
|
<template #mobile="scope">
|
||||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
<copy-button
|
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||||
v-if="scope.row[scope.prop]"
|
|
||||||
:text="scope.row[scope.prop]"
|
|
||||||
style="margin-left: 2px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
|
|
||||||
@@ -62,11 +51,7 @@
|
|||||||
</page-modal> -->
|
</page-modal> -->
|
||||||
|
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<page-modal
|
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
||||||
ref="editModalRef"
|
|
||||||
:modal-config="editModalConfig"
|
|
||||||
@submit-click="handleSubmitClick"
|
|
||||||
>
|
|
||||||
<template #gender="scope">
|
<template #gender="scope">
|
||||||
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
||||||
</template>
|
</template>
|
||||||
@@ -75,37 +60,23 @@
|
|||||||
<el-button type="primary" @click="addgoods">
|
<el-button type="primary" @click="addgoods">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<Plus />
|
<Plus />
|
||||||
</el-icon>
|
</el-icon>添加商品
|
||||||
添加商品
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 选责商品列表 -->
|
<!-- 选责商品列表 -->
|
||||||
<selectGoodslist
|
<selectGoodslist @deleteItememit="deleteItem($event)" :list="selectData"></selectGoodslist>
|
||||||
@deleteItememit="deleteItem($event)"
|
|
||||||
:list="selectData"
|
|
||||||
></selectGoodslist>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #addmanagementtime="scope">
|
<template #addmanagementtime="scope">
|
||||||
<template v-if="scope.formData.useTime == 1">
|
<template v-if="scope.formData.useTime == 1">
|
||||||
{{ scope.formData }}
|
{{ scope.formData }}
|
||||||
<el-time-picker
|
<el-time-picker value-format="HH:mm:ss" v-model="scope.formData.saleTime" is-range range-separator="到"
|
||||||
value-format="HH:mm:ss"
|
start-placeholder="开始时间" end-placeholder="结束时间" />
|
||||||
v-model="scope.formData.saleTime"
|
|
||||||
is-range
|
|
||||||
range-separator="到"
|
|
||||||
start-placeholder="开始时间"
|
|
||||||
end-placeholder="结束时间"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<page-content
|
<page-content ref="contentRef" :content-config="contentConfig2" @operat-click="handleOperatClick">
|
||||||
ref="contentRef"
|
|
||||||
:content-config="contentConfig2"
|
|
||||||
@operat-click="handleOperatClick"
|
|
||||||
>
|
|
||||||
<template #status="scope">
|
<template #status="scope">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
@@ -114,31 +85,12 @@
|
|||||||
</page-content>
|
</page-content>
|
||||||
</template>
|
</template>
|
||||||
<!-- 新增添加商品 -->
|
<!-- 新增添加商品 -->
|
||||||
<myDialog
|
<myDialog title="选择商品" width="50%" ref="myDialogRef" @Confirm="subitgood">
|
||||||
title="选择商品"
|
<page-search ref="searchRefs" :search-config="searchConfig2" @query-click="searchs"
|
||||||
width="50%"
|
@reset-click="handleResetClick" />
|
||||||
ref="myDialogRef"
|
<page-content ref="contentRefs" v-if="switchref" :content-config="contentConfig2" @add-click="handleAddClick"
|
||||||
@Confirm="subitgood"
|
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||||
@close="resetSelectData"
|
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||||
>
|
|
||||||
<page-search
|
|
||||||
ref="searchRefs"
|
|
||||||
:search-config="searchConfig2"
|
|
||||||
@query-click="searchs"
|
|
||||||
@reset-click="handleResetClick"
|
|
||||||
/>
|
|
||||||
<page-content
|
|
||||||
ref="contentRefs"
|
|
||||||
v-if="switchref"
|
|
||||||
:content-config="contentConfig2"
|
|
||||||
@add-click="handleAddClick"
|
|
||||||
@edit-click="handleEditClick"
|
|
||||||
@export-click="handleExportClick"
|
|
||||||
@search-click="handleSearchClick"
|
|
||||||
@toolbar-click="handleToolbarClick"
|
|
||||||
@operat-click="handleOperatClick"
|
|
||||||
@filter-change="handleFilterChange"
|
|
||||||
>
|
|
||||||
<template #status="scope">
|
<template #status="scope">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
@@ -152,14 +104,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #mobile="scope">
|
<template #mobile="scope">
|
||||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
<copy-button
|
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||||
v-if="scope.row[scope.prop]"
|
|
||||||
:text="scope.row[scope.prop]"
|
|
||||||
style="margin-left: 2px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <el-table :data="selectData" border style="width: 100%">
|
<!-- <el-table :data="selectData" border style="width: 100%">
|
||||||
<el-table-column prop="date" align="center" label="Date" />
|
<el-table-column prop="date" align="center" label="Date" />
|
||||||
<el-table-column prop="address" align="center" label="Address" />
|
<el-table-column prop="address" align="center" label="Address" />
|
||||||
@@ -176,10 +127,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="" v-if="selectData.length">
|
<el-form-item label="" v-if="selectData.length">
|
||||||
<!-- 选责商品列表 -->
|
<!-- 选责商品列表 -->
|
||||||
<selectGoodslist
|
<selectGoodslist @deleteItememit="deleteItem($event)" :list="selectData"></selectGoodslist>
|
||||||
@deleteItememit="deleteItem($event)"
|
|
||||||
:list="selectData"
|
|
||||||
></selectGoodslist>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分组状态">
|
<el-form-item label="分组状态">
|
||||||
<el-radio-group v-model="forms.status">
|
<el-radio-group v-model="forms.status">
|
||||||
@@ -194,14 +142,8 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="时间选择" v-if="forms.useTime == 1">
|
<el-form-item label="时间选择" v-if="forms.useTime == 1">
|
||||||
<el-time-picker
|
<el-time-picker value-format="HH:mm:ss" v-model="forms.time" is-range range-separator="到"
|
||||||
value-format="HH:mm:ss"
|
start-placeholder="开始时间" end-placeholder="结束时间" />
|
||||||
v-model="forms.time"
|
|
||||||
is-range
|
|
||||||
range-separator="到"
|
|
||||||
start-placeholder="开始时间"
|
|
||||||
end-placeholder="结束时间"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排列方式">
|
<el-form-item label="排列方式">
|
||||||
<el-radio-group v-model="forms.sortMode">
|
<el-radio-group v-model="forms.sortMode">
|
||||||
@@ -232,10 +174,8 @@ import contentConfig2 from "./goodsGroupconfig/content2";
|
|||||||
import editModalConfig from "./goodsGroupconfig/edit";
|
import editModalConfig from "./goodsGroupconfig/edit";
|
||||||
import searchConfig from "./goodsGroupconfig/search";
|
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,
|
||||||
@@ -254,57 +194,46 @@ const {
|
|||||||
handleFilterChange,
|
handleFilterChange,
|
||||||
} = usePage();
|
} = usePage();
|
||||||
|
|
||||||
if (isSyncStatus()) {
|
let switchref = ref(false)
|
||||||
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);
|
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
async function handleAddClick() {
|
async function handleAddClick() {
|
||||||
addModalRef.value?.setModalVisible();
|
addModalRef.value?.setModalVisible();
|
||||||
selectData.value = [];
|
selectData.value = []
|
||||||
// 加载上级规格下拉数据源
|
// 加载上级规格下拉数据源
|
||||||
// addModalConfig.formItems[2]!.attrs!.data = await UserAPI.getPage({ name: "" });
|
// addModalConfig.formItems[2]!.attrs!.data = await UserAPI.getPage({ name: "" });
|
||||||
// 加载角色下拉数据源
|
// 加载角色下拉数据源
|
||||||
// addModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
// addModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
||||||
}
|
}
|
||||||
const myDialogRef = ref(null);
|
const myDialogRef = ref(null)
|
||||||
const myDialogRefAdd = ref(null);
|
const myDialogRefAdd = ref(null)
|
||||||
const elFormref = ref(null);
|
const elFormref = ref(null)
|
||||||
let title = ref("新增分组");
|
let title = ref("新增分组")
|
||||||
// 选中的商品数据
|
// 选中的商品数据
|
||||||
let selectData = ref([]);
|
let selectData = ref([])
|
||||||
let forms = reactive({
|
let forms = reactive({
|
||||||
name: "",
|
name: "",
|
||||||
status: 1,
|
status: 1,
|
||||||
useTime: 0,
|
useTime: 0,
|
||||||
sortMode: "0",
|
sortMode: '0',
|
||||||
sort: 1,
|
sort: 1,
|
||||||
time: "",
|
time: ""
|
||||||
});
|
})
|
||||||
|
|
||||||
// 添加商品
|
// 添加商品
|
||||||
async function addgoods() {
|
function addgoods() {
|
||||||
// console.log(selectData.value, '编辑时候有的数据')
|
// console.log(selectData.value, '编辑时候有的数据')
|
||||||
switchref.value = true;
|
switchref.value = true
|
||||||
myDialogRef.value.open();
|
myDialogRef.value.open()
|
||||||
await nextTick();
|
|
||||||
contentRefs.value.setSelectTable(selectData.value);
|
|
||||||
}
|
}
|
||||||
const rules = reactive<FormRules<RuleForm>>({
|
const rules = reactive<FormRules<RuleForm>>({
|
||||||
name: [{ required: true, message: "请输入分组名称", trigger: "blur" }],
|
name: [
|
||||||
});
|
{ required: true, message: '请输入分组名称', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
})
|
||||||
interface RuleForm {
|
interface RuleForm {
|
||||||
name: string;
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加编辑商品分组
|
// 添加编辑商品分组
|
||||||
@@ -314,71 +243,76 @@ async function addConfirm() {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
let obj = {
|
let obj = {
|
||||||
...forms,
|
...forms,
|
||||||
selectgoods: selectData.value,
|
selectgoods: selectData.value
|
||||||
};
|
}
|
||||||
// 商品选择的合集
|
// 商品选择的合集
|
||||||
if (selectData.value.length) {
|
if (selectData.value.length) {
|
||||||
let arr = [];
|
let arr = []
|
||||||
selectData.value.forEach((item, index) => {
|
selectData.value.forEach((item, index) => {
|
||||||
arr.push(item.id);
|
arr.push(item.id)
|
||||||
});
|
})
|
||||||
obj.productIds = arr;
|
obj.productIds = arr
|
||||||
}
|
}
|
||||||
console.log(obj, "商品分组的参数");
|
console.log(obj, '商品分组的参数')
|
||||||
if (obj.time && obj.time.length) {
|
if (obj.time && obj.time.length) {
|
||||||
obj.saleStartTime = obj.time[0];
|
obj.saleStartTime = obj.time[0]
|
||||||
obj.saleEndTime = obj.time[1];
|
obj.saleEndTime = obj.time[1]
|
||||||
}
|
}
|
||||||
if (title.value == "新增分组") {
|
if (title.value == "新增分组") {
|
||||||
let res = await UserAPI.addunit(obj);
|
let res = await UserAPI.addunit(obj)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
ElMessage.success("添加成功");
|
ElMessage.success("添加成功");
|
||||||
myDialogRefAdd.value.close();
|
myDialogRefAdd.value.close()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (obj.useTime == 0) {
|
if (obj.useTime == 0) {
|
||||||
obj.saleStartTime = null;
|
obj.saleStartTime = null
|
||||||
obj.saleEndTime = null;
|
obj.saleEndTime = null
|
||||||
}
|
}
|
||||||
let res = await UserAPI.update(obj);
|
let res = await UserAPI.update(obj)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
ElMessage.success("编辑成功");
|
ElMessage.success("编辑成功");
|
||||||
myDialogRefAdd.value.close();
|
myDialogRefAdd.value.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// contentConfig.indexAction()
|
// contentConfig.indexAction()
|
||||||
handleQueryClick();
|
handleQueryClick()
|
||||||
} else {
|
} else {
|
||||||
console.log("error submit!", fields);
|
console.log('error submit!', fields)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 添加商品的回调
|
// 添加商品的回调
|
||||||
function subitgood() {
|
function subitgood() {
|
||||||
|
|
||||||
if (title.value == "编辑分组") {
|
if (title.value == "编辑分组") {
|
||||||
let arr = selectData.value;
|
let arr = selectData.value
|
||||||
contentRefs.value.getselectTable().forEach((item: any) => {
|
contentRefs.value.getselectTable().forEach((item: any) => {
|
||||||
let selectdata = selectData.value.find((ele) => ele.id == item.id);
|
let selectdata = selectData.value.find(ele => ele.id == item.id)
|
||||||
if (!selectdata) {
|
if (!selectdata) {
|
||||||
arr.push(item);
|
arr.push(item)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
selectData.value = arr;
|
selectData.value = arr
|
||||||
} else {
|
} else {
|
||||||
selectData.value = contentRefs.value.getselectTable();
|
selectData.value = contentRefs.value.getselectTable()
|
||||||
}
|
}
|
||||||
switchref.value = false;
|
switchref.value = false
|
||||||
myDialogRef.value.close();
|
myDialogRef.value.close()
|
||||||
}
|
}
|
||||||
// 删除商品
|
// 删除商品
|
||||||
function deleteItem(data: any) {
|
function deleteItem(data: any) {
|
||||||
selectData.value = data;
|
selectData.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
async function handleEditClick(row: IObject) {
|
async function handleEditClick(row: IObject) {
|
||||||
editModalRef.value?.handleDisabled(false);
|
editModalRef.value?.handleDisabled(false);
|
||||||
title.value = "编辑分组";
|
title.value = "编辑分组"
|
||||||
// 加载部门下拉数据源
|
// 加载部门下拉数据源
|
||||||
// editModalConfig.formItems[2]!.attrs!.data = await UserAPI.getPage({ name: "" });
|
// editModalConfig.formItems[2]!.attrs!.data = await UserAPI.getPage({ name: "" });
|
||||||
// editModalConfig.formItems[2]!.attrs!.data = await DeptAPI.getOptions();
|
// editModalConfig.formItems[2]!.attrs!.data = await DeptAPI.getOptions();
|
||||||
@@ -386,13 +320,13 @@ async function handleEditClick(row: IObject) {
|
|||||||
// editModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
// editModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
||||||
// 根据id获取数据进行填充
|
// 根据id获取数据进行填充
|
||||||
const data = await UserAPI.getunitinfo(row.id);
|
const data = await UserAPI.getunitinfo(row.id);
|
||||||
let obj = { ...data };
|
let obj = { ...data }
|
||||||
selectData.value = data.productList;
|
selectData.value = data.productList
|
||||||
obj.time = [obj.saleStartTime, obj.saleEndTime];
|
obj.time = [obj.saleStartTime, obj.saleEndTime]
|
||||||
for (let key in obj) {
|
for (let key in obj) {
|
||||||
forms[key] = obj[key];
|
forms[key] = obj[key]
|
||||||
}
|
}
|
||||||
myDialogRefAdd.value.open();
|
myDialogRefAdd.value.open()
|
||||||
// editModalRef.value?.setFormData(obj);
|
// editModalRef.value?.setFormData(obj);
|
||||||
// editModalRef.value?.setModalVisible();
|
// editModalRef.value?.setModalVisible();
|
||||||
}
|
}
|
||||||
@@ -404,15 +338,15 @@ function handleToolbarClick(name: string) {
|
|||||||
name: "",
|
name: "",
|
||||||
status: 1,
|
status: 1,
|
||||||
useTime: 0,
|
useTime: 0,
|
||||||
sortMode: "0",
|
sortMode: '0',
|
||||||
sort: 1,
|
sort: 1,
|
||||||
time: "",
|
time: ""
|
||||||
});
|
})
|
||||||
selectData.value = [];
|
selectData.value = []
|
||||||
title.value = "新增分组";
|
title.value = "新增分组"
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
myDialogRefAdd.value.open();
|
myDialogRefAdd.value.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 其他操作列
|
// 其他操作列
|
||||||
@@ -450,12 +384,6 @@ async function handleOperatClick(data: IOperatData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//清除选择商品弹窗表单选中和
|
|
||||||
function resetSelectData() {
|
|
||||||
contentRefs.value?.clearSelectTable();
|
|
||||||
switchref.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换示例
|
// 切换示例
|
||||||
const isA = ref(true);
|
const isA = ref(true);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 280,
|
width: 280,
|
||||||
templet: "tool",
|
templet: "tool",
|
||||||
operat: [{ text: "编辑", icon: 'edit', name: "edit"}, { text: "删除", icon: 'delete', type: 'danger', name: "delete"}],
|
operat: ["edit", "delete"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||