feat: 数据更改
This commit is contained in:
@@ -34,7 +34,7 @@ const Api = {
|
|||||||
},
|
},
|
||||||
edit(data: any) {
|
edit(data: any) {
|
||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}`,
|
url: `${baseURL}/read`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
@@ -42,7 +42,7 @@ const Api = {
|
|||||||
|
|
||||||
delete(id: string | number) {
|
delete(id: string | number) {
|
||||||
return request<any>({
|
return request<any>({
|
||||||
url: `${baseURL}/` + id,
|
url: `${baseURL}/syncNotice/` + id,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,41 +11,41 @@ const Api = {
|
|||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// /** 全部*/
|
/** 全部*/
|
||||||
// getAllList(params: any) {
|
getAllList(params: any) {
|
||||||
// return request<any>({
|
return request<any>({
|
||||||
// url: `${baseURL}/list`,
|
url: `${baseURL}/list`,
|
||||||
// method: "get",
|
method: "get",
|
||||||
// params,
|
params,
|
||||||
// });
|
});
|
||||||
// },
|
},
|
||||||
// get(id: string | number) {
|
get(id: string | number) {
|
||||||
// return request<any>({
|
return request<any>({
|
||||||
// url: `${baseURL}/` + id,
|
url: `${baseURL}/` + id,
|
||||||
// method: "get",
|
method: "get",
|
||||||
// });
|
});
|
||||||
// },
|
},
|
||||||
// add(data: any) {
|
add(data: any) {
|
||||||
// return request<any>({
|
return request<any>({
|
||||||
// url: `${baseURL}`,
|
url: `${baseURL}`,
|
||||||
// method: "post",
|
method: "post",
|
||||||
// data,
|
data,
|
||||||
// });
|
});
|
||||||
// },
|
},
|
||||||
// edit(data: any) {
|
edit(data: any) {
|
||||||
// return request<any>({
|
return request<any>({
|
||||||
// url: `${baseURL}`,
|
url: `${baseURL}`,
|
||||||
// method: "put",
|
method: "put",
|
||||||
// data,
|
data,
|
||||||
// });
|
});
|
||||||
// },
|
},
|
||||||
|
|
||||||
// delete(id: string | number) {
|
delete(id: string | number) {
|
||||||
// return request<any>({
|
return request<any>({
|
||||||
// url: `${baseURL}/` + id,
|
url: `${baseURL}/` + id,
|
||||||
// method: "delete",
|
method: "delete",
|
||||||
// });
|
});
|
||||||
// },
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Api;
|
export default Api;
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ const refAddHaocaiTakin = ref();
|
|||||||
function refAddHaocaiTakinShow(item: any, type: string) {
|
function refAddHaocaiTakinShow(item: any, type: string) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
if (type === "manual-in") {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (type === "delete") {
|
if (type === "delete") {
|
||||||
@@ -222,7 +222,7 @@ function handleToolbarClick(name: string) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (name == "damage-out" || name == "manual-out" || name == "manual-in") {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,9 +67,8 @@ const contentConfig: IContentConfig = {
|
|||||||
{
|
{
|
||||||
label: "变动原因",
|
label: "变动原因",
|
||||||
align: "center",
|
align: "center",
|
||||||
prop: "inOutItem",
|
templet: "custom",
|
||||||
template: "custom",
|
slotName: "conUnit",
|
||||||
slotName: "inOutItem",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "变动前的库存",
|
label: "变动前的库存",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const searchConfig: ISearchConfig = {
|
|||||||
{
|
{
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "类型",
|
label: "类型",
|
||||||
prop: "inOutItem",
|
prop: "inOutType",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请选择",
|
placeholder: "请选择",
|
||||||
clearable: true,
|
clearable: true,
|
||||||
@@ -28,7 +28,7 @@ const searchConfig: ISearchConfig = {
|
|||||||
{
|
{
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "名目",
|
label: "名目",
|
||||||
prop: "inOutType",
|
prop: "inOutItem",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请选择",
|
placeholder: "请选择",
|
||||||
clearable: true,
|
clearable: true,
|
||||||
|
|||||||
@@ -19,29 +19,13 @@
|
|||||||
@operat-click="handleOperatClick"
|
@operat-click="handleOperatClick"
|
||||||
@filter-change="handleFilterChange"
|
@filter-change="handleFilterChange"
|
||||||
>
|
>
|
||||||
<template #inOutItem="scope">
|
<template #conUnit="scope">
|
||||||
<text v-if="scope.row.inOutItem == 'manual-in'">手动入库</text>
|
<span v-if="scope.row.inOutItem == 'manual-in'">手动入库</span>
|
||||||
<text v-if="scope.row.inOutItem == 'manual-out'">手动出库</text>
|
<span v-if="scope.row.inOutItem == 'manual-out'">手动出库</span>
|
||||||
<text v-if="scope.row.inOutItem == 'win-in'">盘盈入库</text>
|
<span v-if="scope.row.inOutItem == 'win-in'">盘盈入库</span>
|
||||||
<text v-if="scope.row.inOutItem == 'loss-out'">盘亏出库</text>
|
<span v-if="scope.row.inOutItem == 'loss-out'">盘亏出库</span>
|
||||||
<text v-if="scope.row.inOutItem == 'order-in'">订单退款入库</text>
|
<span v-if="scope.row.inOutItem == 'order-in'">订单退款入库</span>
|
||||||
<text v-if="scope.row.inOutItem == 'order-out'">订单消费出库</text>
|
<span v-if="scope.row.inOutItem == 'order-out'">订单消费出库</span>
|
||||||
</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>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
|
|
||||||
@@ -87,11 +71,11 @@ const {
|
|||||||
|
|
||||||
// 默认初始数据
|
// 默认初始数据
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { inOutType, conId } = route.query;
|
const { inOutItem, conId } = route.query;
|
||||||
if (inOutType || conId) {
|
if (inOutItem || conId) {
|
||||||
contentConfig.indexActionData = { inOutType, conId };
|
contentConfig.indexActionData = { inOutItem, conId };
|
||||||
if (inOutType) {
|
if (inOutItem) {
|
||||||
searchConfig.formItems[1].initialValue = inOutType;
|
searchConfig.formItems[1].initialValue = inOutItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col v-if="type == 'in'" :span="8">
|
||||||
<el-form-item label="供应商">
|
<el-form-item label="供应商">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryForm.vendorId"
|
v-model="queryForm.vendorId"
|
||||||
@@ -83,11 +83,11 @@
|
|||||||
/>
|
/>
|
||||||
</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-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">
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ const contentConfig: IContentConfig = {
|
|||||||
label: "通知类型",
|
label: "通知类型",
|
||||||
align: "center",
|
align: "center",
|
||||||
prop: "type",
|
prop: "type",
|
||||||
|
slotName: "type",
|
||||||
|
templet: "custom",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "是否已读",
|
label: "是否已读",
|
||||||
@@ -63,23 +65,27 @@ const contentConfig: IContentConfig = {
|
|||||||
slotName: "content",
|
slotName: "content",
|
||||||
templet: "list",
|
templet: "list",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: "商品/耗材",
|
|
||||||
align: "center",
|
|
||||||
prop: "extraJson",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
align: "center",
|
align: "center",
|
||||||
prop: "createTime",
|
prop: "createTime",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "操作",
|
||||||
|
align: "center",
|
||||||
|
fixed: "right",
|
||||||
|
width: 280,
|
||||||
|
templet: "custom",
|
||||||
|
slotName: "operate",
|
||||||
|
operat: ["delete"],
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// label: "操作",
|
// label: "操作",
|
||||||
// align: "center",
|
// align: "center",
|
||||||
// fixed: "right",
|
// fixed: "right",
|
||||||
// width: 280,
|
// width: 150,
|
||||||
// templet: "tool",
|
// templet: "custom",
|
||||||
// operat: ["edit", "delete"],
|
// slotName: "operate",
|
||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,44 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<page-search
|
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
||||||
ref="searchRef"
|
@reset-click="handleResetClick" />
|
||||||
:search-config="searchConfig"
|
|
||||||
@query-click="handleQueryClick"
|
|
||||||
@reset-click="handleResetClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<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"
|
<template #type="scope">
|
||||||
@edit-click="handleEditClick"
|
{{ scope.row.type == 1 ? "耗材变动" : "商品变动 " }}
|
||||||
@export-click="handleExportClick"
|
</template>
|
||||||
@search-click="handleSearchClick"
|
|
||||||
@toolbar-click="handleToolbarClick"
|
|
||||||
@operat-click="handleOperatClick"
|
|
||||||
@filter-change="handleFilterChange"
|
|
||||||
>
|
|
||||||
<template #isRead="scope">
|
<template #isRead="scope">
|
||||||
<el-tag :type="scope.row.isRead == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row.isRead == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row.isRead == 1 ? "已读" : "未读" }}
|
{{ scope.row.isRead == 1 ? "已读" : "未读" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</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-content>
|
||||||
|
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<page-modal
|
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick" />
|
||||||
ref="addModalRef"
|
|
||||||
:modal-config="addModalConfig"
|
|
||||||
@submit-click="handleSubmitClick"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<page-modal
|
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick" />
|
||||||
ref="editModalRef"
|
|
||||||
:modal-config="editModalConfig"
|
|
||||||
@submit-click="handleSubmitClick"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -50,6 +48,7 @@ import addModalConfig from "./config/add";
|
|||||||
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 Api from "@/api/notifications";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
@@ -87,6 +86,17 @@ function handleToolbarClick(name: string) {
|
|||||||
ElMessage.success("点击了自定义1按钮");
|
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) {
|
async function handleOperatClick(data: IOperatData) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user