Merge remote-tracking branch 'origin/main'

# Conflicts:
#	src/components/inventory/purchase/AddOrder.vue
This commit is contained in:
LiJianZhao 2025-04-28 11:42:17 +08:00
commit 2e844dd98e
6 changed files with 537 additions and 437 deletions

View File

@ -6,9 +6,18 @@ let _width = ref(0);
let _height = ref(0); let _height = ref(0);
let _isShow = ref(false); let _isShow = ref(false);
let _close = ref(true); 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; _isShow.value = isShow == null ? false : isShow;
_showFooter.value = showFooter == null ? false : showFooter;
_width.value = width == null ? 1200 : width; _width.value = width == null ? 1200 : width;
_height.value = height == null ? 800 : height; _height.value = height == null ? 800 : height;
_close.value = close == null ? true : close; _close.value = close == null ? true : close;
@ -28,18 +37,23 @@ const closeBtn = () => {
<transition name="el-fade-in"> <transition name="el-fade-in">
<div class="mask" v-if="_isShow"> <div class="mask" v-if="_isShow">
<div class="mask-wrapper" :style="{ width: _width + 'px', height: _height + 'px' }" 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="header">
<div class="title">{{ title }}</div> <div class="title">{{ title }}</div>
<div class="close" @click="closeBtn" v-if="_close"> <div class="close" @click="closeBtn" v-if="_close">
<el-icon> <el-icon class="close-icon">
<CloseBold/> <CloseBold/>
</el-icon> </el-icon>
</div> </div>
</div> </div>
<div class="content" >
<el-scrollbar style="height:100%;margin-top: 0">
<slot></slot> <slot></slot>
</el-scrollbar> </el-scrollbar>
</div> </div>
<div class="footer" v-if="_showFooter">
<slot name="footer"></slot>
</div>
</div>
</div> </div>
</transition> </transition>
</teleport> </teleport>
@ -60,44 +74,59 @@ const closeBtn = () => {
align-items: center; align-items: center;
.mask-wrapper { .mask-wrapper {
position: relative;
background-color: #FFF; background-color: #FFF;
border-radius: 6px; border-radius: 6px;
padding: 0 20px 20px 20px;
overflow: hidden; overflow: hidden;
max-height: 90vh; max-height: 90vh;
z-index: 1999; z-index: 1999;
display: flex;
flex-direction: column;
.header { .header {
position: relative;
height: 72px; height: 72px;
padding: 0 4px; display: flex;
justify-content: space-between;
padding: 0 24px;
border-bottom: 1px solid #EAEAEC; border-bottom: 1px solid #EAEAEC;
align-items: center;
.title { .title {
position: absolute;
top: 50%;
left: 0;
font-weight: 800; font-weight: 800;
font-size: 20px; font-size: 20px;
color: #333333; color: #333333;
font-style: normal; font-style: normal;
transform: translateY(-50%);
} }
.close { .close {
position: absolute; width: 32px;
top: 50%; height: 32px;
right: 0; background: #EBECED;
border-radius: 16px;
line-height: 32px;
text-align: center;
.close-icon {
color: #6e6e6e; color: #6e6e6e;
font-size: 32px; font-size: 12px;
transform: translateY(-50%); }
&:hover { &:hover {
color: #409eff; 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> </style>

View File

@ -1,5 +1,7 @@
<template> <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"> <div class="top">
<el-form :model="inventory_order_data" label-position="top" :rules="formRules" ref="orderForm"> <el-form :model="inventory_order_data" label-position="top" :rules="formRules" ref="orderForm">
<el-row> <el-row>
@ -65,7 +67,7 @@
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch> <GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
</div> </div>
</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 prop="name" label="药品名称" width="180" show-overflow-tooltip/>
<el-table-column label="售价" prop="unitPrice" width="80"> <el-table-column label="售价" prop="unitPrice" width="80">
</el-table-column> </el-table-column>
@ -136,23 +138,25 @@
<el-button size="small" @click="removeTableRow(scope.row)" type="danger" plain>移除</el-button> <el-button size="small" @click="removeTableRow(scope.row)" type="danger" plain>移除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div>
<template #footer>
<div class="bottom"> <div class="bottom">
<div class="totalPrice"> <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>
<div class="btn"> <div class="btn">
<el-button type="primary" @click="confirm">确认</el-button> <el-button type="primary" @click="confirm">确认</el-button>
<el-button type="primary" @click="exit">关闭</el-button> <el-button type="primary" @click="exit">关闭</el-button>
</div> </div>
</div> </div>
</div> </template>
<Mask :is-show="is_add">
<Edit ref="editRef" @close="is_add = false;"/>
</Mask> </Mask>
<!-- <Mask :is-show="is_add" :top="100">-->
<!-- <Edit ref="editRef" @close="is_add = false;"/>-->
<!-- </Mask>-->
</template> </template>
@ -230,6 +234,21 @@ const getTotalPrice = () => {
} }
const emit = defineEmits(['close']) const emit = defineEmits(['close'])
let exit = () => { 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') emit('close')
} }
const table_list: any = ref([]) const table_list: any = ref([])
@ -272,10 +291,10 @@ let confirm = async () => {
inventoryOrder: JSON.parse(JSON.stringify(inventory_order_data.value)), inventoryOrder: JSON.parse(JSON.stringify(inventory_order_data.value)),
inventoryOrderGoodsList: JSON.parse(JSON.stringify(table_list.value)) inventoryOrderGoodsList: JSON.parse(JSON.stringify(table_list.value))
} }
post("inventory/order/create", data).then((res: any) => {
exit()
isLoading.value = true isLoading.value = true
post("inventory/order/create", data).then((res: any) => {
isLoading.value = false
exit()
}) })
} catch (error) { } 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 editRef = ref<InstanceType<typeof Edit>>();
const supplier_list: any = ref([]) const supplier_list: any = ref([])
const getSupplierList = () => { const getSupplierList = () => {
@ -313,14 +332,9 @@ const getSupplierList = () => {
} }
post("inventory/supplier/list", {query: query}).then((res: any) => { post("inventory/supplier/list", {query: query}).then((res: any) => {
supplier_list.value = res.list supplier_list.value = res.list
supplier_list.value = res.list
}) })
} }
const userInfo = ref({ const userInfo = ref<any>({})
id: null,
name: null,
username: null,
})
const getUserInfo = () => { const getUserInfo = () => {
post("manager/user/verify", null).then((res: any) => { post("manager/user/verify", null).then((res: any) => {
userInfo.value = res userInfo.value = res
@ -333,10 +347,12 @@ const removeTableRow = (row: any) => {
table_list.value.splice(index, 1); table_list.value.splice(index, 1);
} }
} }
onMounted(() => { const init = () => {
isShow.value = true
getSupplierList() getSupplierList()
getUserInfo() getUserInfo()
}) }
defineExpose({init})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.link { .link {
@ -378,29 +394,24 @@ onMounted(() => {
background-color: red; background-color: red;
} }
.bottom { .add-panel {
height: 86px; height: 602px;
padding: 24px 24px 0;
display: flex; display: flex;
justify-content: space-between; flex-direction: column;
align-items: center;
font-weight: 400; .top {
font-size: 22px; height: 180px;
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;
} }
.error {
background-color: #F00;
}
.edit-panel{
margin-top: 24px;
}
.table_content { .table_content {
flex: 1;
margin-top: 24px; margin-top: 24px;
display: flex;
flex-direction: column;
.add_goods { .add_goods {
height: 90px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -408,9 +419,28 @@ onMounted(() => {
font-size: 18px; font-size: 18px;
color: #333333; color: #333333;
font-style: normal; font-style: normal;
.search { .search {
width: 50%; 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> </style>

View File

@ -1,4 +1,6 @@
<template> <template>
<Mask :width="1200" :top="100" :is-show="isShow" @close="exit"
title="编辑" :height="720" :show-footer="true">
<div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......"> <div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......">
<div class="top"> <div class="top">
<el-form :model="inventory_order_data" label-position="top" ref="orderForm"> <el-form :model="inventory_order_data" label-position="top" ref="orderForm">
@ -175,6 +177,8 @@
</el-table> </el-table>
</div> </div>
</div>
<template #footer>
<div class="bottom"> <div class="bottom">
<div class="totalPrice"> <div class="totalPrice">
订单总金额<span style="color: #FF282E;font-size: 12px"></span><span 订单总金额<span style="color: #FF282E;font-size: 12px"></span><span
@ -185,7 +189,9 @@
<el-button type="primary" @click="exit">关闭</el-button> <el-button type="primary" @click="exit">关闭</el-button>
</div> </div>
</div> </div>
</div> </template>
</Mask>
<Mask :is-show="is_add" > <Mask :is-show="is_add" >
<Edit ref="editRef" @close="is_add = false;"/> <Edit ref="editRef" @close="is_add = false;"/>
@ -202,10 +208,10 @@ import {ElMessage, ElMessageBox} from "element-plus";
import GoodsSearch from "@/components/inventory/GoodsSearch.vue"; import GoodsSearch from "@/components/inventory/GoodsSearch.vue";
import CloseBtn from "@/components/CloseBtn.vue"; import CloseBtn from "@/components/CloseBtn.vue";
let props = defineProps({ const props = defineProps({
code: { code: {
type: String, type: String,
default: null default: ""
} }
}) })
const isLoading = ref(false) const isLoading = ref(false)
@ -291,10 +297,14 @@ const saveOrderEdit = () => {
}) })
} }
onMounted(() => { const isShow = ref<any>(false)
const code = ref<any>('')
const init = (e: any) => {
code.value = e
isShow.value = true
getSupplierList() getSupplierList()
getOrderDetail() getOrderDetail()
}) }
const getTotalPrice = () => { const getTotalPrice = () => {
let totalPrice = 0; let totalPrice = 0;
table_list.value.forEach((item: any) => { table_list.value.forEach((item: any) => {
@ -304,6 +314,7 @@ const getTotalPrice = () => {
} }
const emit = defineEmits(['close', 'updateOrderDetail']) const emit = defineEmits(['close', 'updateOrderDetail'])
let exit = () => { let exit = () => {
isShow.value = false
emit('close') emit('close')
} }
const table_list: any = ref([]) const table_list: any = ref([])
@ -331,7 +342,7 @@ const getSupplierList = () => {
}) })
} }
const getOrderDetail = () => { const getOrderDetail = () => {
post("inventory/order/detail", {code: props.code}).then((res: any) => { post("inventory/order/detail", {code: code.value}).then((res: any) => {
inventory_order_data.value = res.inventoryOrder inventory_order_data.value = res.inventoryOrder
table_list.value = res.inventoryOrderGoodsList table_list.value = res.inventoryOrderGoodsList
}) })
@ -387,7 +398,7 @@ const goodsSelectCallBack = (inventory: any) => {
}, 200) }, 200)
} }
defineExpose({init})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.link { .link {
@ -428,7 +439,38 @@ const goodsSelectCallBack = (inventory: any) => {
.active { .active {
background-color: red; background-color: red;
} }
.edit-panel {
height: 562px;
padding: 24px 24px 0;
display: flex;
flex-direction: column;
.top {
height: 180px;
}
.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;
font-weight: 800;
font-size: 18px;
color: #333333;
font-style: normal;
.search {
width: 50%;
}
}
}
}
.bottom { .bottom {
height: 86px; height: 86px;
display: flex; display: flex;
@ -446,23 +488,16 @@ const goodsSelectCallBack = (inventory: any) => {
.error { .error {
background-color: #F00; background-color: #F00;
} }
.edit-panel{
margin-top: 24px; .bottom {
} padding: 0 24px;
.table_content{ height: 100%;
margin-top: 24px;
.add_goods{
height: 80px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
font-weight: 800; font-weight: 400;
font-size: 18px; font-size: 22px;
color: #333333; color: #333333;
font-style: normal; font-style: normal;
.search{
width: 50%;
}
}
} }
</style> </style>

View File

@ -15,13 +15,6 @@
</div> </div>
</el-form> </el-form>
<el-descriptions title="解析后的数据" size="small" :column="2" border> <el-descriptions title="解析后的数据" size="small" :column="2" border>
<!-- <el-descriptions-item-->
<!-- align="center"-->
<!-- label="定点机构编码"-->
<!-- :span="2"-->
<!-- >-->
<!-- {{ decryptedText.fixmedinsCode }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item <el-descriptions-item
align="center" align="center"
label="证书创建时间" label="证书创建时间"
@ -34,6 +27,18 @@
> >
{{ formatDate(decryptedText.expiryDate) }} {{ formatDate(decryptedText.expiryDate) }}
</el-descriptions-item> </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> </el-descriptions>
</div> </div>
</template> </template>
@ -65,7 +70,8 @@ onMounted(async () => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.auth { .auth {
margin: 0 auto; margin: 24px auto;
padding: 0 24px;
.btn { .btn {
margin: 24px 0; margin: 24px 0;

View File

@ -132,7 +132,7 @@ const showAuth = () => {
</div> </div>
</div> </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> <Auth></Auth>
</Mask> </Mask>
</template> </template>

View File

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