From cd479360c1a1ec72431b41538725627737a8f926 Mon Sep 17 00:00:00 2001 From: dayezi <1372755472@qq.com> Date: Sun, 2 Jun 2024 11:42:59 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=F0=9F=93=83=20docs(welcomedocs):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=AF=E5=8A=A8=E6=AC=A2=E8=BF=8E=E8=AF=AD?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=96=87=E6=A1=A3=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/build/info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/build/info.ts b/frontend/build/info.ts index 2ca6aee..4843e79 100644 --- a/frontend/build/info.ts +++ b/frontend/build/info.ts @@ -7,7 +7,7 @@ import boxen, { type Options as BoxenOptions } from "boxen"; dayjs.extend(duration); const welcomeMessage = gradientString("cyan", "magenta").multiline( - `您好! 欢迎使用 pure-admin 开源项目\n我们为您精心准备了下面两个贴心的保姆级文档\nhttps://yiming_chang.gitee.io/pure-admin-doc\nhttps://pure-admin-utils.netlify.app` + `您好! 欢迎使用 pure-admin 开源项目\n我们为您精心准备了下面两个贴心的保姆级文档\nhttps://pure-admin.github.io/pure-admin-doc/\nhttps://pure-admin-utils.netlify.app` ); const boxenOptions: BoxenOptions = { From 3fa53df09fe3f07338e90410d1c70a009e2c7bc2 Mon Sep 17 00:00:00 2001 From: dayezi <1372755472@qq.com> Date: Mon, 3 Jun 2024 09:40:25 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=F0=9F=90=9E=20fix(bug):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=80=E4=BA=9B=E5=B7=B2=E7=9F=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复获取refreshToken时的时间判断问题 2. 修改部分报错问题 3. 修改前端物资交接时的物资显示数据字段以及正确的判断逻辑 --- backend/app/api/v1/base/base.py | 2 + frontend/src/types/base.ts | 1 + frontend/src/views/admin/MaterialMeta.vue | 2 + frontend/src/views/admin/OperationLogs.vue | 6 +- frontend/src/views/glb/material.vue | 64 +++++++++------------- 5 files changed, 34 insertions(+), 41 deletions(-) diff --git a/backend/app/api/v1/base/base.py b/backend/app/api/v1/base/base.py index a7f4b87..1f9e7a2 100644 --- a/backend/app/api/v1/base/base.py +++ b/backend/app/api/v1/base/base.py @@ -65,6 +65,8 @@ async def login_access_token(credentials: CredentialsSchema): async def refresh_token(refreshToken: refreshTokenSchema): try: payload = decode_access_token(refreshToken.refreshToken) + if payload.exp < datetime.now(): + raise ExpiredSignatureError except ExpiredSignatureError: return FailAuth(msg="refreshToken已过期") access_token_expires = timedelta(minutes=settings.JWT_ACCESS_TOKEN_EXPIRE_MINUTES) diff --git a/frontend/src/types/base.ts b/frontend/src/types/base.ts index 40bcf24..6c0e5c3 100644 --- a/frontend/src/types/base.ts +++ b/frontend/src/types/base.ts @@ -10,6 +10,7 @@ export type MaterialItem = { depart?: string; position: string; number: number; + nowNumber?: number; checking?: number; borrowing?: number; borrowed?: number; diff --git a/frontend/src/views/admin/MaterialMeta.vue b/frontend/src/views/admin/MaterialMeta.vue index 121377c..a8512b9 100644 --- a/frontend/src/views/admin/MaterialMeta.vue +++ b/frontend/src/views/admin/MaterialMeta.vue @@ -104,6 +104,8 @@ const columns: TableColumnList = [ { label: "名称", prop: "name" }, { label: "型号", prop: "model", width: "200" }, { label: "数量", prop: "number", width: "100" }, + { label: "借出数量", prop: "borrowed", width: "100" }, + { label: "送检数量", prop: "checking", width: "100" }, { label: "操作", prop: "modify", diff --git a/frontend/src/views/admin/OperationLogs.vue b/frontend/src/views/admin/OperationLogs.vue index 5b1f88f..a796af4 100644 --- a/frontend/src/views/admin/OperationLogs.vue +++ b/frontend/src/views/admin/OperationLogs.vue @@ -117,7 +117,7 @@ const columns: TableColumnList = [ size={props.size} style={tagStyle.value(row.number == row.nowNumber ? 1 : 0)} > - {row.number === row.nowNumber ? "正确" : "错误"} + {row.number === row.nowNumber ? "正常" : "异常"} ) }, @@ -237,8 +237,8 @@ function handleSelectionChange(val) { clearable class="!w-[150px]" > - - + + diff --git a/frontend/src/views/glb/material.vue b/frontend/src/views/glb/material.vue index eba3a84..9277c7e 100644 --- a/frontend/src/views/glb/material.vue +++ b/frontend/src/views/glb/material.vue @@ -2,7 +2,6 @@ import { ref, reactive, computed, onMounted } from "vue"; import { getMaterialMeta, - getGlbAttentionList, getGlbDutyInfo, dutyOver, getLatestNote @@ -11,6 +10,8 @@ import { useUserStoreHook } from "@/store/modules/user"; import { successNotification, errorNotification } from "@/utils/notification"; import formatCurrentTime from "@/utils/formatDatetime"; import { getDutyOverList } from "@/api/admin"; +import PureTable from "@pureadmin/table"; +import type { MaterialItem } from "@/types/base"; defineOptions({ name: "GlbMaterial" @@ -24,22 +25,8 @@ enum StepStatus { Warning = "warning", Error = "error" } -interface tableDataRow { - id?: number; - uuid?: string; - name: string; - model: string; - position: string; - number: string; - nowNumber?: number; - created_at?: string; - updated_at?: string; - dutyPerson?: string; - dutyPersonDepart?: string; - depart?: string; - dutyDate?: string; -} -interface tableData extends Array {} + +interface tableData extends Array {} const columns: TableColumnList = [ { label: "序号", type: "index", width: "60" }, @@ -47,18 +34,14 @@ const columns: TableColumnList = [ { label: "名称", prop: "name" }, { label: "型号", prop: "model", width: "200" }, { label: "数量", prop: "number", width: "100" }, + { label: "外借数量", prop: "borrowed", width: "100" }, + { label: "送检数量", prop: "checking", width: "100" }, { label: "当前数量", width: "150", prop: "nowNumber", cellRenderer: ({ row }) => ( - <> - - + ) }, { @@ -66,16 +49,14 @@ const columns: TableColumnList = [ prop: "confirm", width: "100", cellRenderer: ({ row }) => ( - <> - handleConfirm(row)} - plain - > - 确认 - - + handleConfirm(row)} + plain + > + 确认 + ) } ]; @@ -117,19 +98,26 @@ const confirmedData: tableData = reactive([]); const step1Init = ref(true); const step1Status = computed(() => { - return confirmedData.every(item => item.nowNumber === Number(item.number)) + return confirmedData.every( + item => item.nowNumber === item.number - item.borrowed - item.checking + ) ? StepStatus.Success : StepStatus.Error; }); const handleConfirm = row => { - row.nowNumber = Number(row.number); + row.nowNumber = Number(row.number) - row.borrowed - row.checking; step1Init.value = false; }; +const confirmBtnStatus = (row): "success" | "warning" => { + return row.nowNumber == row.number - row.borrowed - row.checking + ? "success" + : "warning"; +}; const handleConfirmAll = () => { // 确认所有 confirmedData.forEach(row => { - row.nowNumber = Number(row.number); + row.nowNumber = row.number - row.borrowed - row.checking; step1Init.value = false; }); }; @@ -181,7 +169,7 @@ const handoverConfirm = () => { const handover = () => { const date = formatCurrentTime(); let data = { - materialData: confirmedData.map((data: tableDataRow) => { + materialData: confirmedData.map((data: MaterialItem) => { return { name: data.name, model: data.model, From 41f6aeed2bba8df92ee9d67a45794bd331d351c9 Mon Sep 17 00:00:00 2001 From: dayezi <1372755472@qq.com> Date: Mon, 17 Jun 2024 22:33:42 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E2=9C=A8=20feat(key):=20=E9=92=A5?= =?UTF-8?q?=E5=8C=99=E7=89=A9=E8=B5=84=E7=9A=84=E5=8E=9F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=92=8C=E6=95=B0=E6=8D=AE=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/base/base.py | 2 +- backend/app/api/v1/material/material.py | 29 ++-- backend/app/controllers/area.py | 16 ++ backend/app/controllers/materialType.py | 16 ++ backend/app/models/__init__.py | 2 + backend/app/models/area.py | 18 ++ backend/app/models/borrowed.py | 1 + backend/app/models/material.py | 13 +- backend/app/models/materialType.py | 19 +++ backend/app/models/users.py | 2 + backend/app/schemas/area.py | 18 ++ backend/app/schemas/materialType.py | 19 +++ frontend/src/api/material.ts | 11 +- frontend/src/store/modules/metaArea.ts | 0 frontend/src/store/modules/metaType.ts | 0 frontend/src/types/base.ts | 3 +- frontend/src/views/admin/MaterialMeta.vue | 191 ++++++++++++++-------- frontend/src/views/admin/utils/types.ts | 5 + frontend/src/views/glb/material.vue | 2 +- frontend/src/views/welcome/index.vue | 2 +- 20 files changed, 271 insertions(+), 98 deletions(-) create mode 100644 backend/app/controllers/area.py create mode 100644 backend/app/controllers/materialType.py create mode 100644 backend/app/models/area.py create mode 100644 backend/app/models/materialType.py create mode 100644 backend/app/schemas/area.py create mode 100644 backend/app/schemas/materialType.py create mode 100644 frontend/src/store/modules/metaArea.ts create mode 100644 frontend/src/store/modules/metaType.ts diff --git a/backend/app/api/v1/base/base.py b/backend/app/api/v1/base/base.py index 1f9e7a2..a48765f 100644 --- a/backend/app/api/v1/base/base.py +++ b/backend/app/api/v1/base/base.py @@ -65,7 +65,7 @@ async def login_access_token(credentials: CredentialsSchema): async def refresh_token(refreshToken: refreshTokenSchema): try: payload = decode_access_token(refreshToken.refreshToken) - if payload.exp < datetime.now(): + if payload.exp.timestamp() < datetime.now().timestamp(): raise ExpiredSignatureError except ExpiredSignatureError: return FailAuth(msg="refreshToken已过期") diff --git a/backend/app/api/v1/material/material.py b/backend/app/api/v1/material/material.py index 8d13906..be52b39 100644 --- a/backend/app/api/v1/material/material.py +++ b/backend/app/api/v1/material/material.py @@ -34,12 +34,13 @@ async def duty_over(data: DutyOverInfo): @router.get("/meta", summary="获取物资源数据") async def get_meta( - depart: str = Query("glb", description="物资部门"), + area: str = Query("glb", description="物资区域"), + metaType: str = Query("", description="物资类型"), page: int = Query(1, description="页码"), page_size: int = Query(1000, description="每页数量"), name: str = Query("", description="物资名称"), ): - q = Q(depart__contains=depart) + q = Q(Q(area__contains=area), Q(type__contains=metaType)) if name: q &= Q(name__contains=name) @@ -49,11 +50,11 @@ async def get_meta( @router.get("/all_meta", summary="获取所有物资源数据") -async def get_all_meta(depart: str = Query("glb", description="物资部门")): - q = Q() - if depart: - q &= Q(depart__contains=depart) - +async def get_all_meta( + area: str = Query("glb", description="物资区域"), + metaType: str = Query("", description="物资类型") +): + q = Q(Q(area_contains=area), Q(type__contains=metaType)) material_objs = await materialController.all(search=q) data = [await obj.to_dict() for obj in material_objs] return Success(data=data) @@ -62,7 +63,7 @@ async def get_all_meta(depart: str = Query("glb", description="物资部门")): @router.post("/add_meta", summary="添加或修改物资源数据") async def add_meta(data: Union[MaterialCreate, MaterialUpdate]): if hasattr(data, "id"): - result: Material = await materialController.update(data.id, data.update_dict()) + result: Material = await materialController.update(data.id, data) else: data: dict = data.model_dump() data["uuid"] = generate_uuid(data["name"]) @@ -94,7 +95,7 @@ async def get_glb_duty_info(): @router.get("/glb_attention", summary="获取隔离办物资注意事项") async def get_glb_attention(): - q = Q(depart__contains="glb") + q = Q(area__contains="glb") total, note_objs = await materialAttentionController.list(page=1, page_size=100, search=q) data = [await obj.to_dict() for obj in note_objs] return Success(msg="隔离办注意事项", data=data) @@ -102,7 +103,7 @@ async def get_glb_attention(): @router.get("/glb_latest_note", summary="获取隔离办最近一条备注") async def get_glb_latest_note(): - q = Q(depart__contains="glb") + q = Q(area__contains="glb") data = await dutyNotesController.latest(search=q) if data: data = await data.to_dict() @@ -117,7 +118,7 @@ async def get_fk_list( page_size: int = Query(1000, description="每页数量"), name: str = Query("", description="物资名称") ): - q = Q(depart__contains="fk") + q = Q(area__contains="fk") if name: q &= Q(name__contains=name) @@ -132,7 +133,7 @@ async def get_fk_list( page_size: int = Query(1000, description="每页数量"), name: str = Query("", description="物资名称") ): - q = Q(depart__contains="wk") + q = Q(area__contains="wk") if name: q &= Q(name__contains=name) @@ -143,7 +144,7 @@ async def get_fk_list( @router.get("/duty_over_list/list", summary="获取接班清单") async def get_duty_over_list(area: str = Query("glb", description="部门")): - q = Q(depart__contains=area) + q = Q(area__contains=area) total, duty_over_list_objs = await dutyOverListController.list(page=1, page_size=1000, search=q) data = [await obj.to_dict() for obj in duty_over_list_objs] return SuccessExtra(msg="接班清单获取成功", data=data, total=total, page=1, pageSize=1000) @@ -155,7 +156,7 @@ async def update_duty_over_list(data: list[dict], area: str = Query("glb", descr if item.get("id"): await dutyOverListController.update(item["id"], item) else: - item["depart"] = area + item["area"] = area await dutyOverListController.create(item) return Success(msg="更新成功") diff --git a/backend/app/controllers/area.py b/backend/app/controllers/area.py new file mode 100644 index 0000000..0e87a15 --- /dev/null +++ b/backend/app/controllers/area.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# @FileName :area.py +# @Time :2024/6/9 上午9:53 +# @Author :dayezi +from app.core.crud import CRUDBase + +from app.models import MaterialArea +from app.schemas.area import MaterialAreaCreate, MaterialAreaUpdate + + +class MaterialAreaController(CRUDBase[MaterialArea, MaterialAreaCreate, MaterialAreaUpdate]): + def __init__(self): + super().__init__(model=MaterialArea) + + +areaController = MaterialAreaController() diff --git a/backend/app/controllers/materialType.py b/backend/app/controllers/materialType.py new file mode 100644 index 0000000..cd38f7f --- /dev/null +++ b/backend/app/controllers/materialType.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# @FileName :materialType.py +# @Time :2024/6/7 下午3:30 +# @Author :dayezi +from app.core.crud import CRUDBase + +from app.models import MaterialType +from app.schemas.materialType import MaterialTypeCreate, MaterialTypeUpdate + + +class MaterialTypeController(CRUDBase[MaterialType, MaterialTypeCreate, MaterialTypeUpdate]): + def __init__(self): + super().__init__(model=MaterialType) + + +materialTypeController = MaterialTypeController() diff --git a/backend/app/models/__init__.py b/backend/app/models/__init__.py index da7c5ed..441cadf 100644 --- a/backend/app/models/__init__.py +++ b/backend/app/models/__init__.py @@ -3,3 +3,5 @@ from .material import * from .dutyLog import * from .borrowed import * +from .materialType import * +from .area import * diff --git a/backend/app/models/area.py b/backend/app/models/area.py new file mode 100644 index 0000000..9d452ae --- /dev/null +++ b/backend/app/models/area.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# @FileName :area.py +# @Time :2024/6/7 下午3:25 +# @Author :dayezi +from tortoise import fields + +from .base import BaseModel, TimestampMixin, UUIDModel + + +class MaterialArea(BaseModel, TimestampMixin, UUIDModel): + key = fields.CharField(max_length=20, description="物资区域关键字") + name = fields.CharField(max_length=50, description="物资区域名称") + + class Meta: + table = "material_area" + + class PydanticMeta: + exclude = "id" diff --git a/backend/app/models/borrowed.py b/backend/app/models/borrowed.py index 92c36b7..c8dbf9c 100644 --- a/backend/app/models/borrowed.py +++ b/backend/app/models/borrowed.py @@ -13,6 +13,7 @@ class Borrowed(BaseModel, UUIDModel): uuid = fields.UUIDField(pk=False, description="借用人uuid") phone = fields.CharField(max_length=20, description="借用人手机号") userDepart = fields.CharField(max_length=20, description="借用人部门") + reason = fields.CharField(max_length=200, description="借用原因") borrowTime = fields.DatetimeField(auto_now_add=True, description="借用时间") borrowApproveStatus = fields.BooleanField(default=False, description="借用审批状态,False为未审批,True未已审批") borrowApproveWhether = fields.BooleanField(null=True, description="借用通过状态,False为驳回,True为通过") diff --git a/backend/app/models/material.py b/backend/app/models/material.py index c1b33ed..c3d6a77 100644 --- a/backend/app/models/material.py +++ b/backend/app/models/material.py @@ -1,16 +1,21 @@ from tortoise import fields from .base import BaseModel, TimestampMixin, UUIDModel +from .borrowed import Borrowed class Material(BaseModel, TimestampMixin, UUIDModel): + type = fields.CharField(max_length=20, description="物资类型") + area = fields.CharField(max_length=20, description="物资所属区域") name = fields.CharField(max_length=50, unique=True, description="物资名字") model = fields.CharField(max_length=20, null=True, description="物资型号") position = fields.CharField(max_length=50, description="物资位置") - number = fields.IntField(description="物资原数量") + number = fields.IntField(description="物资库存数量") checking = fields.IntField(default=0, description="物资送检数量") borrowed = fields.IntField(default=0, description="物资外借数量") - depart = fields.CharField(max_length=20, description="物资所属部门") + + # 物资被借的信息 + borrowedInfo: fields.ManyToManyRelation["Borrowed"] class Meta: table = "material" @@ -21,7 +26,7 @@ class PydanticMeta: class AttentionNote(BaseModel, TimestampMixin, UUIDModel): note = fields.CharField(max_length=255, description="事项") - depart = fields.CharField(max_length=20, description="所属部门") + area = fields.CharField(max_length=20, description="所属区域") class Meta: table = "attention_note" @@ -31,7 +36,7 @@ class PydanticMeta: class DutyOverList(BaseModel, TimestampMixin): - depart = fields.CharField(max_length=20, description="部门") + area = fields.CharField(max_length=20, description="部门") content = fields.CharField(max_length=255, description="交接班清单内容") class Meta: diff --git a/backend/app/models/materialType.py b/backend/app/models/materialType.py new file mode 100644 index 0000000..72b4c8e --- /dev/null +++ b/backend/app/models/materialType.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# @FileName :materialType.py +# @Time :2024/6/7 下午3:24 +# @Author :dayezi +from tortoise import fields + +from .base import BaseModel, TimestampMixin, UUIDModel + + +class MaterialType(BaseModel, TimestampMixin, UUIDModel): + key = fields.CharField(max_length=20, description="物资类型关键字") + name = fields.CharField(max_length=50, description="物资类型名称") + + class Meta: + table = "material_type" + + class PydanticMeta: + exclude = "id" + diff --git a/backend/app/models/users.py b/backend/app/models/users.py index 9ff15c4..952dbc0 100644 --- a/backend/app/models/users.py +++ b/backend/app/models/users.py @@ -2,6 +2,7 @@ from .base import BaseModel, TimestampMixin, UUIDModel from .enums import MethodType +from .borrowed import Borrowed class User(BaseModel, TimestampMixin, UUIDModel): @@ -23,6 +24,7 @@ class User(BaseModel, TimestampMixin, UUIDModel): related_name="user_depart", null=True ) + borrowed: fields.ManyToManyRelation["Borrowed"] class Meta: table = "user" diff --git a/backend/app/schemas/area.py b/backend/app/schemas/area.py new file mode 100644 index 0000000..2f708ff --- /dev/null +++ b/backend/app/schemas/area.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# @FileName :area.py +# @Time :2024/6/9 上午9:52 +# @Author :dayezi +from tortoise.contrib.pydantic import pydantic_model_creator + +from app.models import MaterialArea + + +MaterialAreaSchema = pydantic_model_creator(MaterialArea) + + +class MaterialAreaCreate(MaterialAreaSchema): + ... + + +class MaterialAreaUpdate(MaterialAreaSchema): + id: int diff --git a/backend/app/schemas/materialType.py b/backend/app/schemas/materialType.py new file mode 100644 index 0000000..a21fb93 --- /dev/null +++ b/backend/app/schemas/materialType.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# @FileName :materialType.py +# @Time :2024/6/7 下午3:27 +# @Author :dayezi +from tortoise.contrib.pydantic import pydantic_model_creator + +from app.models import MaterialType + + +MaterialTypeSchema = pydantic_model_creator(MaterialType) + + +class MaterialTypeCreate(MaterialTypeSchema): + ... + + +class MaterialTypeUpdate(MaterialTypeSchema): + id: int + diff --git a/frontend/src/api/material.ts b/frontend/src/api/material.ts index 153c9ff..e052f34 100644 --- a/frontend/src/api/material.ts +++ b/frontend/src/api/material.ts @@ -9,23 +9,26 @@ import type { import type { addResult, MaterialResult } from "@/types/admin"; export const getMaterialMeta = async ( - depart: string, + area: string, + metaType: string, page?: number, page_size?: number ) => { return http.request("get", baseUrlApi("/material/meta"), { params: { - depart, + area, + metaType, page, page_size } }); }; -export const getAllMaterialMeta = async (depart: string) => { +export const getAllMaterialMeta = async (area: string, metaType: string) => { return http.request("get", baseUrlApi("/material/all_meta"), { params: { - depart + area, + metaType } }); }; diff --git a/frontend/src/store/modules/metaArea.ts b/frontend/src/store/modules/metaArea.ts new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/store/modules/metaType.ts b/frontend/src/store/modules/metaType.ts new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/types/base.ts b/frontend/src/types/base.ts index 6c0e5c3..6a61c83 100644 --- a/frontend/src/types/base.ts +++ b/frontend/src/types/base.ts @@ -7,7 +7,8 @@ export type MaterialItem = { uuid?: string; name: string; model: string; - depart?: string; + type: string; + area: string; position: string; number: number; nowNumber?: number; diff --git a/frontend/src/views/admin/MaterialMeta.vue b/frontend/src/views/admin/MaterialMeta.vue index a8512b9..865eddb 100644 --- a/frontend/src/views/admin/MaterialMeta.vue +++ b/frontend/src/views/admin/MaterialMeta.vue @@ -1,5 +1,5 @@ - + diff --git a/frontend/src/views/glb/material.vue b/frontend/src/views/glb/material.vue index aefc68b..0b07224 100644 --- a/frontend/src/views/glb/material.vue +++ b/frontend/src/views/glb/material.vue @@ -2,9 +2,9 @@ import { ref, reactive, computed, onMounted } from "vue"; import { getMaterialMeta, - getGlbDutyInfo, dutyOver, - getLatestNote + getLatestNote, + getDutyInfo } from "@/api/material"; import { useUserStoreHook } from "@/store/modules/user"; import { successNotification, errorNotification } from "@/utils/notification"; @@ -79,10 +79,10 @@ const initGlb = () => { attention.length = 0; attention.push(...res.data); }); - getLatestNote().then(res => { + getLatestNote("glb", "tool").then(res => { lastRemark.value = res.data.note; }); - getGlbDutyInfo().then(res => { + getDutyInfo("glb", "tool").then(res => { dutyPerson.value = res.data.dutyPerson; dutyPersonDepart.value = res.data.dutyPersonDepart; }); @@ -187,12 +187,11 @@ const handover = () => { depart: "glb", dutyDate: date }, - dutyDate: date, dutyPerson: useUserStoreHook()?.username, dutyPersonDepart: useUserStoreHook()?.depart }; handleOverBtnLoading.value = true; - dutyOver(data) + dutyOver("glb", "tool", data) .then(res => { initGlb(); handleOverBtnLoading.value = false; @@ -207,8 +206,8 @@ const handover = () => {