This commit is contained in:
ChenQiuYu 2025-04-28 10:47:56 +08:00
parent 38d8aa9090
commit 2a6e0dcdcd
6 changed files with 292 additions and 219 deletions

View File

@ -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,18 +38,23 @@ const closeBtn = () => {
<transition name="el-fade-in">
<div class="mask" v-if="_isShow">
<div class="mask-wrapper" :style="{ width: _width + 'px', height: _height + 'px' }" v-if="_isShow">
<el-scrollbar height="100%">
<div class="header">
<div class="title">{{ title }}</div>
<div class="close" @click="closeBtn" v-if="_close">
<el-icon>
<el-icon class="close-icon">
<CloseBold/>
</el-icon>
</div>
</div>
<div class="content" >
<el-scrollbar style="height:100%;margin-top: 0">
<slot></slot>
</el-scrollbar>
</div>
<div class="footer" v-if="_showFooter">
<slot name="footer"></slot>
</div>
</div>
</div>
</transition>
</teleport>
@ -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;
width: 32px;
height: 32px;
background: #EBECED;
border-radius: 16px;
line-height: 32px;
text-align: center;
.close-icon {
color: #6e6e6e;
font-size: 32px;
transform: translateY(-50%);
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;
}
}
}
</style>

View File

@ -1,5 +1,7 @@
<template>
<div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......">
<Mask :width="1200" :top="100" :is-show="isShow" @close="exit"
title="新增" :height="760" :show-footer="true">
<div class="add-panel" v-loading="isLoading" element-loading-text="正在保存......">
<div class="top">
<el-form :model="inventory_order_data" label-position="top" :rules="formRules" ref="orderForm">
<el-row>
@ -65,7 +67,7 @@
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
</div>
</div>
<el-table :data="table_list" style="width: 100%" height="300" max-height="550">
<el-table :data="table_list" style="width: 100%;flex: 1">
<el-table-column prop="name" label="药品名称" width="180" show-overflow-tooltip/>
<el-table-column label="售价" prop="unitPrice" width="80">
</el-table-column>
@ -136,23 +138,25 @@
<el-button size="small" @click="removeTableRow(scope.row)" type="danger" plain>移除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<template #footer>
<div class="bottom">
<div class="totalPrice">
订单总金额<span style="color: #FF282E;font-size: 12px"></span><span style="color: #FF282E">{{ inventory_order_data.totalPrice.toFixed(2) }}</span>
订单总金额<span style="color: #FF282E;font-size: 12px"></span><span
style="color: #FF282E">{{ inventory_order_data.totalPrice.toFixed(2) }}</span>
</div>
<div class="btn">
<el-button type="primary" @click="confirm">确认</el-button>
<el-button type="primary" @click="exit">关闭</el-button>
</div>
</div>
</div>
<Mask :is-show="is_add" :top="100">
<Edit ref="editRef" @close="is_add = false;"/>
</template>
</Mask>
<!-- <Mask :is-show="is_add" :top="100">-->
<!-- <Edit ref="editRef" @close="is_add = false;"/>-->
<!-- </Mask>-->
</template>
@ -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))
}
post("inventory/order/create", data).then((res: any) => {
exit()
isLoading.value = true
post("inventory/order/create", data).then((res: any) => {
isLoading.value = false
exit()
})
} catch (error) {
@ -304,7 +323,7 @@ const removeItem = (row: any) => {
}
}
const is_add = ref(false)
const isShow = ref(false)
const editRef = ref<InstanceType<typeof Edit>>();
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<any>({})
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})
</script>
<style scoped lang="scss">
.link {
@ -378,29 +394,24 @@ onMounted(() => {
background-color: red;
}
.bottom {
height: 86px;
.add-panel {
height: 602px;
padding: 24px 24px 0;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 400;
font-size: 22px;
color: #333333;
font-style: normal;
background: #fff;
box-shadow: 0px -2 4px 0px rgba(0,0,0,0.1);
border-radius: 0 0 8px 8px;
flex-direction: column;
.top {
height: 180px;
}
.error {
background-color: #F00;
}
.edit-panel{
margin-top: 24px;
}
.table_content {
flex: 1;
margin-top: 24px;
display: flex;
flex-direction: column;
.add_goods {
height: 90px;
display: flex;
justify-content: space-between;
align-items: center;
@ -408,9 +419,28 @@ onMounted(() => {
font-size: 18px;
color: #333333;
font-style: normal;
.search {
width: 50%;
}
}
}
}
.bottom {
padding: 0 24px;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 400;
font-size: 22px;
color: #333333;
font-style: normal;
}
.error {
background-color: #F00;
}
</style>

View File

@ -205,7 +205,7 @@ import CloseBtn from "@/components/CloseBtn.vue";
let props = defineProps({
code: {
type: String,
default: null
default: ""
}
})
const isLoading = ref(false)

View File

@ -34,6 +34,18 @@
>
{{ formatDate(decryptedText.expiryDate) }}
</el-descriptions-item>
<el-descriptions-item
align="center"
label="权限"
>
{{ decryptedText.rule == 1 ? "禁用医保" : decryptedText.rule == 2 ? "全部开放" : "" }}
</el-descriptions-item>
<el-descriptions-item
align="center"
label="定点机构编码"
>
{{ decryptedText.fixmedinsCode}}
</el-descriptions-item>
</el-descriptions>
</div>
</template>
@ -65,7 +77,8 @@ onMounted(async () => {
</script>
<style scoped lang="scss">
.auth {
margin: 0 auto;
margin: 24px auto;
padding: 0 24px;
.btn {
margin: 24px 0;

View File

@ -132,7 +132,7 @@ const showAuth = () => {
</div>
</div>
</div>
<Mask :is-show="isShowAuth" @close="isShowAuth=false" :width="600" :height="450" title="授权">
<Mask :is-show="isShowAuth" @close="isShowAuth=false" :width="600" :height="500" title="授权">
<Auth></Auth>
</Mask>
</template>

View File

@ -2,7 +2,7 @@
<div class="container-wrapper">
<div class="top">
<el-dropdown>
<el-button type="primary" :icon="Plus" @click="is_add = true">新增采购</el-button>
<el-button type="primary" :icon="Plus" @click="openAdd">新增采购</el-button>
</el-dropdown>
</div>
<div class="content_list">
@ -46,11 +46,8 @@
/>
</div>
</div>
<Mask v-if="!open_code" :width="1200" :top="100" :is-show="is_add" @close="closeAddOrder"
title="新增" :height="760">
<AddOrder @close="closeAddOrder"/>
</Mask>
<Mask v-else :width="1200" :top="100" :is-show="is_edit" @close="closeEditOrder"
<AddOrder ref="addOrderRef" @close="closeAddOrder"/>
<Mask :width="1200" :top="100" :is-show="is_edit" @close="closeEditOrder"
title="编辑" :height="720">
<EditOrder :code="open_code" @close="closeEditOrder" @updateOrderDetail="init"/>
</Mask>
@ -58,7 +55,7 @@
</template>
<script lang="ts" setup>
import {onMounted, ref, watch} from "vue";
import {nextTick, onMounted, ref, watch} from "vue";
import {post} from "@/utils/request.ts";
import {useRoute} from "vue-router";
import AddOrder from "@/components/inventory/purchase/AddOrder.vue";
@ -67,13 +64,18 @@ import EditOrder from "@/components/inventory/purchase/EditOrder.vue";
import {Plus} from "@element-plus/icons-vue";
let tableData = ref([])
let is_add = ref(false)
let is_edit = ref(false)
const route = useRoute()
let open_code = ref(null)
onMounted(() => {
init()
})
const addOrderRef = ref<any>('')
const openAdd = () => {
nextTick(() => {
addOrderRef.value.init()
})
}
let open_edit = (row: any) => {
is_edit.value = true
open_code.value = row.code
@ -91,7 +93,6 @@ let init = () => {
}
const closeAddOrder = () => {
is_add.value = false
init()
}
const closeEditOrder = () => {