Merge branch 'multi-store' of https://e.coding.net/g-cphe0354/cashier/cashier-web into gaohao
This commit is contained in:
commit
6b5290d355
|
|
@ -89,5 +89,9 @@
|
||||||
},
|
},
|
||||||
"[jsonc]": {
|
"[jsonc]": {
|
||||||
"editor.defaultFormatter": "vscode.json-language-features"
|
"editor.defaultFormatter": "vscode.json-language-features"
|
||||||
|
},
|
||||||
|
"files.associations": {
|
||||||
|
"*.ttml": "xml",
|
||||||
|
"*.ttss": "css"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
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}`,
|
||||||
|
method: "put",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
delete(id: string | number) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/` + id,
|
||||||
|
method: "delete",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Api;
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
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);
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
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 : "";
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
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: "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: "type",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "是否已读",
|
||||||
|
align: "center",
|
||||||
|
prop: "isRead",
|
||||||
|
slotName: "isRead",
|
||||||
|
templet: "custom",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "消息内容",
|
||||||
|
align: "center",
|
||||||
|
prop: "content",
|
||||||
|
slotName: "content",
|
||||||
|
templet: "list",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "商品/耗材",
|
||||||
|
align: "center",
|
||||||
|
prop: "extraJson",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "创建时间",
|
||||||
|
align: "center",
|
||||||
|
prop: "createTime",
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: "操作",
|
||||||
|
// align: "center",
|
||||||
|
// fixed: "right",
|
||||||
|
// width: 280,
|
||||||
|
// templet: "tool",
|
||||||
|
// operat: ["edit", "delete"],
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default contentConfig;
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
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);
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
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: "0",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "耗材",
|
||||||
|
value: "1",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "是否已读",
|
||||||
|
prop: "isRead",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: "未读",
|
||||||
|
value: "0",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "已读",
|
||||||
|
value: "1",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default searchConfig;
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
<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 #isRead="scope">
|
||||||
|
<el-tag :type="scope.row.isRead == 1 ? 'success' : 'info'">
|
||||||
|
{{ scope.row.isRead == 1 ? "已读" : "未读" }}
|
||||||
|
</el-tag>
|
||||||
|
</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();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
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 });
|
||||||
|
}
|
||||||
|
1;
|
||||||
|
// 其他工具栏
|
||||||
|
function handleToolbarClick(name: string) {
|
||||||
|
console.log(name);
|
||||||
|
if (name === "custom1") {
|
||||||
|
ElMessage.success("点击了自定义1按钮");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 其他操作列
|
||||||
|
async function handleOperatClick(data: IOperatData) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -100,17 +100,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div>支付方式:{{ returnPayType(detail.payType) }}</div>
|
||||||
<div>
|
<div>
|
||||||
退款金额:¥{{ detail.refundAmount }}
|
退款金额:¥{{ detail.refundAmount }}
|
||||||
<span
|
<!-- <span
|
||||||
style="color: #ff9731; cursor: pointer"
|
style="color: #ff9731; cursor: pointer"
|
||||||
v-if="detail.isRefund"
|
v-if="detail.isRefund"
|
||||||
@click="type = '3'"
|
@click="type = '3'"
|
||||||
>
|
>
|
||||||
退款详情>
|
退款详情>
|
||||||
</span>
|
</span> -->
|
||||||
</div>
|
</div>
|
||||||
<div>支付方式:{{ returnPayType(detail.payType) }}</div>
|
<div class="color-red">退款方式:{{ detail.refundType }}</div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue