From 2a6e0dcdcd7131d79d9e2afa5cacd76d5e42269f Mon Sep 17 00:00:00 2001 From: ChenQiuYu Date: Mon, 28 Apr 2025 10:47:56 +0800 Subject: [PATCH 1/2] dev --- src/components/common/Mask.vue | 79 ++-- .../inventory/purchase/AddOrder.vue | 394 ++++++++++-------- .../inventory/purchase/EditOrder.vue | 2 +- src/components/manger/Auth.vue | 15 +- src/views/Login.vue | 2 +- src/views/inventory/inventory.vue | 19 +- 6 files changed, 292 insertions(+), 219 deletions(-) diff --git a/src/components/common/Mask.vue b/src/components/common/Mask.vue index 37b01fa..5025730 100644 --- a/src/components/common/Mask.vue +++ b/src/components/common/Mask.vue @@ -6,9 +6,18 @@ let _width = ref(0); let _height = ref(0); let _isShow = ref(false); let _close = ref(true); -const {width, height, isShow, title, close} = defineProps(['width', 'height', 'isShow', 'title', 'close']); +let _showFooter = ref(false); +const { + width, + height, + isShow, + title, + close, + showFooter +} = defineProps(['width', 'height', 'isShow', 'title', 'close', 'showFooter']); _isShow.value = isShow == null ? false : isShow; +_showFooter.value = showFooter == null ? false : showFooter; _width.value = width == null ? 1200 : width; _height.value = height == null ? 800 : height; _close.value = close == null ? true : close; @@ -29,17 +38,22 @@ const closeBtn = () => {
- -
-
{{ title }}
-
- - - -
+
+
{{ title }}
+
+ + +
- - +
+
+ + + +
+
@@ -61,44 +75,59 @@ const closeBtn = () => { align-items: center; .mask-wrapper { - position: relative; background-color: #FFF; border-radius: 6px; - padding: 0 20px 20px 20px; overflow: hidden; max-height: 90vh; z-index: 1999; + display: flex; + flex-direction: column; .header { - position: relative; height: 72px; - padding: 0 4px; + display: flex; + justify-content: space-between; + padding: 0 24px; border-bottom: 1px solid #EAEAEC; + align-items: center; .title { - position: absolute; - top: 50%; - left: 0; font-weight: 800; font-size: 20px; color: #333333; font-style: normal; - transform: translateY(-50%); } .close { - position: absolute; - top: 50%; - right: 0; - color: #6e6e6e; - font-size: 32px; - transform: translateY(-50%); + width: 32px; + height: 32px; + background: #EBECED; + border-radius: 16px; + line-height: 32px; + text-align: center; + + .close-icon { + color: #6e6e6e; + font-size: 12px; + } &:hover { color: #409eff; } } } + + .content { + flex: 1; + min-height: 0; + } + + .footer { + height: 86px; + background: #FFFFFF; + border-top: 1px solid #EAEAEC; + border-radius: 0 0 8px 8px; + } } } diff --git a/src/components/inventory/purchase/AddOrder.vue b/src/components/inventory/purchase/AddOrder.vue index e492403..a979884 100644 --- a/src/components/inventory/purchase/AddOrder.vue +++ b/src/components/inventory/purchase/AddOrder.vue @@ -1,158 +1,162 @@ @@ -230,6 +234,21 @@ const getTotalPrice = () => { } const emit = defineEmits(['close']) let exit = () => { + isShow.value = false + inventory_order_data.value = { + code: null, + purchaseDate: getFormattedDate(), + userId: null, + supplierId: null, + remark: null, + managerUserId: null, + kindConut: 0, + totalPrice: 0, + shippingCode: null, + invoiceCode: null, + inventoryOrderGoodsList: [] + } + table_list.value = [] emit('close') } const table_list: any = ref([]) @@ -272,10 +291,10 @@ let confirm = async () => { inventoryOrder: JSON.parse(JSON.stringify(inventory_order_data.value)), inventoryOrderGoodsList: JSON.parse(JSON.stringify(table_list.value)) } - + isLoading.value = true post("inventory/order/create", data).then((res: any) => { + isLoading.value = false exit() - isLoading.value = true }) } catch (error) { @@ -304,7 +323,7 @@ const removeItem = (row: any) => { } } -const is_add = ref(false) +const isShow = ref(false) const editRef = ref>(); const supplier_list: any = ref([]) const getSupplierList = () => { @@ -313,14 +332,9 @@ const getSupplierList = () => { } post("inventory/supplier/list", {query: query}).then((res: any) => { supplier_list.value = res.list - supplier_list.value = res.list }) } -const userInfo = ref({ - id: null, - name: null, - username: null, -}) +const userInfo = ref({}) const getUserInfo = () => { post("manager/user/verify", null).then((res: any) => { userInfo.value = res @@ -333,10 +347,12 @@ const removeTableRow = (row: any) => { table_list.value.splice(index, 1); } } -onMounted(() => { +const init = () => { + isShow.value = true getSupplierList() getUserInfo() -}) +} +defineExpose({init}) \ No newline at end of file diff --git a/src/components/inventory/purchase/EditOrder.vue b/src/components/inventory/purchase/EditOrder.vue index 2bf360c..db76321 100644 --- a/src/components/inventory/purchase/EditOrder.vue +++ b/src/components/inventory/purchase/EditOrder.vue @@ -205,7 +205,7 @@ import CloseBtn from "@/components/CloseBtn.vue"; let props = defineProps({ code: { type: String, - default: null + default: "" } }) const isLoading = ref(false) diff --git a/src/components/manger/Auth.vue b/src/components/manger/Auth.vue index a411976..c87e782 100644 --- a/src/components/manger/Auth.vue +++ b/src/components/manger/Auth.vue @@ -34,6 +34,18 @@ > {{ formatDate(decryptedText.expiryDate) }} + + {{ decryptedText.rule == 1 ? "禁用医保" : decryptedText.rule == 2 ? "全部开放" : "" }} + + + {{ decryptedText.fixmedinsCode}} +
@@ -65,7 +77,8 @@ onMounted(async () => { \ No newline at end of file diff --git a/src/components/manger/Auth.vue b/src/components/manger/Auth.vue index c87e782..479d51c 100644 --- a/src/components/manger/Auth.vue +++ b/src/components/manger/Auth.vue @@ -15,13 +15,6 @@ - - - - - - - - {{ decryptedText.rule == 1 ? "禁用医保" : decryptedText.rule == 2 ? "全部开放" : "" }} + {{ decryptedText.rule == 1 ? "禁用医保" : decryptedText.rule == 2 ? "全部开放" : "暂无" }} - {{ decryptedText.fixmedinsCode}} + {{ decryptedText.fixmedinsCode||'无'}} diff --git a/src/views/inventory/inventory.vue b/src/views/inventory/inventory.vue index 17526af..787e447 100644 --- a/src/views/inventory/inventory.vue +++ b/src/views/inventory/inventory.vue @@ -47,10 +47,7 @@ - - - + @@ -76,9 +73,11 @@ const openAdd = () => { addOrderRef.value.init() }) } +const editOrderRef = ref('') let open_edit = (row: any) => { - is_edit.value = true - open_code.value = row.code + nextTick(() => { + editOrderRef.value.init(row.code) + }) }