feat: 数据更改

This commit is contained in:
wwz
2025-04-09 16:26:02 +08:00
parent d6a576f729
commit 0b81b8355e
9 changed files with 108 additions and 109 deletions

View File

@@ -34,7 +34,7 @@ const Api = {
},
edit(data: any) {
return request<any>({
url: `${baseURL}`,
url: `${baseURL}/read`,
method: "put",
data,
});
@@ -42,7 +42,7 @@ const Api = {
delete(id: string | number) {
return request<any>({
url: `${baseURL}/` + id,
url: `${baseURL}/syncNotice/` + id,
method: "delete",
});
},

View File

@@ -11,41 +11,41 @@ const Api = {
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,
// });
// },
/** 全部*/
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",
// });
// },
delete(id: string | number) {
return request<any>({
url: `${baseURL}/` + id,
method: "delete",
});
},
};
export default Api;

View File

@@ -168,7 +168,7 @@ const refAddHaocaiTakin = ref();
function refAddHaocaiTakinShow(item: any, type: string) {
console.log(item);
if (type === "manual-in") {
router.push({ path: "/inventory/libraryrecords", query: { inOutType: type, conId: item.id } });
router.push({ path: "/inventory/libraryrecords", query: { inOutItem: type, conId: item.id } });
return;
}
if (type === "delete") {
@@ -222,7 +222,7 @@ function handleToolbarClick(name: string) {
return;
}
if (name == "damage-out" || name == "manual-out" || name == "manual-in") {
router.push({ path: "/inventory/libraryrecords", query: { inOutType: name } });
router.push({ path: "/inventory/libraryrecords", query: { inOutItem: name } });
return;
}
}

View File

@@ -67,9 +67,8 @@ const contentConfig: IContentConfig = {
{
label: "变动原因",
align: "center",
prop: "inOutItem",
template: "custom",
slotName: "inOutItem",
templet: "custom",
slotName: "conUnit",
},
{
label: "变动前的库存",

View File

@@ -6,7 +6,7 @@ const searchConfig: ISearchConfig = {
{
type: "select",
label: "类型",
prop: "inOutItem",
prop: "inOutType",
attrs: {
placeholder: "请选择",
clearable: true,
@@ -28,7 +28,7 @@ const searchConfig: ISearchConfig = {
{
type: "select",
label: "名目",
prop: "inOutType",
prop: "inOutItem",
attrs: {
placeholder: "请选择",
clearable: true,

View File

@@ -19,29 +19,13 @@
@operat-click="handleOperatClick"
@filter-change="handleFilterChange"
>
<template #inOutItem="scope">
<text v-if="scope.row.inOutItem == 'manual-in'">手动入库</text>
<text v-if="scope.row.inOutItem == 'manual-out'">手动出库</text>
<text v-if="scope.row.inOutItem == 'win-in'">盘盈入库</text>
<text v-if="scope.row.inOutItem == 'loss-out'">盘亏出库</text>
<text v-if="scope.row.inOutItem == 'order-in'">订单退款入库</text>
<text v-if="scope.row.inOutItem == 'order-out'">订单消费出库</text>
</template>
<template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
</el-tag>
</template>
<template #switch="scope">
<el-switch v-model="scope.row[scope.prop]" disabled :active-value="1" :inactive-value="0" />
</template>
<template #mobile="scope">
<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"
/>
<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>
@@ -87,11 +71,11 @@ const {
// 默认初始数据
const route = useRoute();
const { inOutType, conId } = route.query;
if (inOutType || conId) {
contentConfig.indexActionData = { inOutType, conId };
if (inOutType) {
searchConfig.formItems[1].initialValue = inOutType;
const { inOutItem, conId } = route.query;
if (inOutItem || conId) {
contentConfig.indexActionData = { inOutItem, conId };
if (inOutItem) {
searchConfig.formItems[1].initialValue = inOutItem;
}
}

View File

@@ -17,7 +17,7 @@
</el-form-item>
</el-row>
<el-row>
<el-col :span="8">
<el-col v-if="type == 'in'" :span="8">
<el-form-item label="供应商">
<el-select
v-model="queryForm.vendorId"
@@ -83,11 +83,11 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="批号">
<el-input v-model="queryForm.batchNo" placeholder="请输入批号" style="width: 220px" />
</el-form-item>
</el-col>
</el-col> -->
</el-row>
<el-row>
<el-col :span="8">

View File

@@ -48,6 +48,8 @@ const contentConfig: IContentConfig = {
label: "通知类型",
align: "center",
prop: "type",
slotName: "type",
templet: "custom",
},
{
label: "是否已读",
@@ -63,23 +65,27 @@ const contentConfig: IContentConfig = {
slotName: "content",
templet: "list",
},
{
label: "商品/耗材",
align: "center",
prop: "extraJson",
},
{
label: "创建时间",
align: "center",
prop: "createTime",
},
{
label: "操作",
align: "center",
fixed: "right",
width: 280,
templet: "custom",
slotName: "operate",
operat: ["delete"],
},
// {
// label: "操作",
// align: "center",
// fixed: "right",
// width: 280,
// templet: "tool",
// operat: ["edit", "delete"],
// width: 150,
// templet: "custom",
// slotName: "operate",
// },
],
};

View File

@@ -1,44 +1,42 @@
<template>
<div class="app-container">
<!-- 搜索 -->
<page-search
ref="searchRef"
:search-config="searchConfig"
@query-click="handleQueryClick"
@reset-click="handleResetClick"
/>
<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"
>
<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">
{{ scope.row.type == 1 ? "耗材变动" : "商品变动 " }}
</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;
">
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, '')">
设为已读
</el-button>
<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="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick" />
<!-- 编辑 -->
<page-modal
ref="editModalRef"
:modal-config="editModalConfig"
@submit-click="handleSubmitClick"
/>
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick" />
</div>
</template>
@@ -50,6 +48,7 @@ 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";
const {
searchRef,
@@ -87,6 +86,17 @@ function handleToolbarClick(name: string) {
ElMessage.success("点击了自定义1按钮");
}
}
//删除
function refAddHaocaiTakinShow(item: any, type: string) {
console.log(item);
if (type === "delete") {
Api.delete(item.id);
} else {
Api.edit(item.id);
}
}
// 其他操作列
async function handleOperatClick(data: IOperatData) {
console.log(data);