This commit is contained in:
ChenQiuYu 2025-04-27 14:46:12 +08:00
parent 0fa3bf802e
commit 30dd4a29f6
7 changed files with 366 additions and 317 deletions

View File

@ -52,7 +52,6 @@ const handleSelect = (item: any) => {
:remote-method="querySearchAsync" :remote-method="querySearchAsync"
:options="options" :options="options"
placeholder="输入关键字搜索药品" placeholder="输入关键字搜索药品"
:fit-input-width="800"
> >
<template #header> <template #header>
<div class="header"> <div class="header">

View File

@ -1,111 +1,122 @@
<template> <template>
<el-descriptions border label-width="100"> <div class="add-panel">
<el-descriptions-item label="领用人" width="200"> <div class="top">
<el-input v-model="formData.name" disabled></el-input> <el-form :inline=true label-position="top" :model="formData" label-width="auto">
</el-descriptions-item> <el-form-item label="领用人">
<el-descriptions-item label="备注"> <el-input v-model="formData.name" disabled></el-input>
<el-input v-model="formData.remark"></el-input> </el-form-item>
</el-descriptions-item> <el-form-item label="备注" style="width: 50%">
</el-descriptions> <el-input v-model="formData.remark"></el-input>
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch> </el-form-item>
<table class="simple-table" style="margin-top: 15px"> </el-form>
<thead> </div>
<tr> <div class="table_content">
<th>名称</th> <div class="add_apply">
<th>批次</th> <span>领用药品</span>
<th>生产批号</th> <div class="search">
<th>有效期</th> <GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
<th>当前库存</th> </div>
<th>出库数量</th> </div>
</tr> <table class="simple-table" style="margin-top: 15px;width: 100% ;height:300px ;max-height:550px">
</thead> <thead>
<tbody>
<template v-for="(item,index) in tableList">
<tr>
<td>{{ item.name }}</td>
<td>
<el-select
v-model="item.selectList"
multiple
@change="addLine(item)"
:teleported="false"
style="width: 100px;"
collapse-tags
popper-class="table-select">
<div class="select-header">
<span>批次ID</span>
<span>生产批号</span>
<span>入库数据</span>
<span>有效期</span>
<span>进价</span>
</div>
<el-option
v-for="(subItem,subIndex) in item.batchList"
:key="subItem.id"
:label="subItem.id"
:value="subItem.id">
<div class="option-row">
<span>{{ subItem.id }}</span>
<span>{{ subItem.productionBatchCode }}</span>
<span>{{ subItem.productionDate }}</span>
<span>{{ subItem.expiryDate }}</span>
<span>{{ subItem.purchaseUnitPrice }}</span>
</div>
</el-option>
</el-select>
</td>
<td></td>
<td>
</td>
<td>
{{ item.wholeNumber }}{{ item.packagingUnit }}
<template v-if="item.trdnFlag == 1">
{{ item.fragmentNumber }}{{ item.minPackagingUnit }}
</template>
</td>
<td>
{{ item.totalOutWholeNumber }}{{ item.packagingUnit }}
<template v-if="item.trdnFlag == 1">
{{ item.totalFragmentNumber }}{{ item.minPackagingUnit }}
</template>
</td>
</tr>
<template v-for="subItem in item.children">
<tr> <tr>
<td>-</td> <th>名称</th>
<td>-</td> <th>批次</th>
<td>{{ subItem.productionBatchCode }}</td> <th>生产批号</th>
<td>{{ subItem.expiryDate }}</td> <th>有效期</th>
<td> <th>当前库存</th>
{{ subItem.wholeNumber }}{{ subItem.packagingUnit }} <th>出库数量</th>
<template v-if="item.trdnFlag == 1">
{{ subItem.fragmentNumber }}{{ subItem.minPackagingUnit }}
</template>
</td>
<td>
<el-input v-model.number="subItem.outWholeNumber" size="small" style="width: 50px" @change="changeOutNumber(item)">
<template #suffix>
{{ item.packagingUnit }}
</template>
</el-input>
<el-input v-model.number="subItem.outFragmentNumber" size="small" style="width: 50px"
@change="changeOutNumber(item)" v-if="item.trdnFlag == 1">
<template #suffix>
{{ item.minPackagingUnit }}
</template>
</el-input>
</td>
</tr> </tr>
</template> </thead>
</template> <tbody>
</tbody> <template v-for="(item,index) in tableList">
</table> <tr>
<div class="bottom"> <td>{{ item.name }}</td>
<el-button type="primary" @click="save">保存</el-button> <td>
<el-button type="primary" @click="exit">关闭</el-button> <el-select
</div> v-model="item.selectList"
multiple
@change="addLine(item)"
:teleported="false"
style="width: 100px;"
collapse-tags
popper-class="table-select">
<div class="select-header">
<span>批次ID</span>
<span>生产批号</span>
<span>入库数据</span>
<span>有效期</span>
<span>进价</span>
</div>
<el-option
v-for="(subItem,subIndex) in item.batchList"
:key="subItem.id"
:label="subItem.id"
:value="subItem.id">
<div class="option-row">
<span>{{ subItem.id }}</span>
<span>{{ subItem.productionBatchCode }}</span>
<span>{{ subItem.productionDate }}</span>
<span>{{ subItem.expiryDate }}</span>
<span>{{ subItem.purchaseUnitPrice }}</span>
</div>
</el-option>
</el-select>
</td>
<td></td>
<td>
</td>
<td>
{{ item.wholeNumber }}{{ item.packagingUnit }}
<template v-if="item.trdnFlag == 1">
{{ item.fragmentNumber }}{{ item.minPackagingUnit }}
</template>
</td>
<td>
{{ item.totalOutWholeNumber }}{{ item.packagingUnit }}
<template v-if="item.trdnFlag == 1">
{{ item.totalFragmentNumber }}{{ item.minPackagingUnit }}
</template>
</td>
</tr>
<template v-for="subItem in item.children">
<tr>
<td>-</td>
<td>-</td>
<td>{{ subItem.productionBatchCode }}</td>
<td>{{ subItem.expiryDate }}</td>
<td>
{{ subItem.wholeNumber }}{{ subItem.packagingUnit }}
<template v-if="item.trdnFlag == 1">
{{ subItem.fragmentNumber }}{{ subItem.minPackagingUnit }}
</template>
</td>
<td>
<el-input v-model.number="subItem.outWholeNumber" size="small" style="width: 50px"
@change="changeOutNumber(item)">
<template #suffix>
{{ item.packagingUnit }}
</template>
</el-input>
<el-input v-model.number="subItem.outFragmentNumber" size="small" style="width: 50px"
@change="changeOutNumber(item)" v-if="item.trdnFlag == 1">
<template #suffix>
{{ item.minPackagingUnit }}
</template>
</el-input>
</td>
</tr>
</template>
</template>
</tbody>
</table>
<div class="bottom">
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="exit">关闭</el-button>
</div>
</div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {onMounted, ref, unref} from "vue"; import {onMounted, ref, unref} from "vue";
@ -288,6 +299,7 @@ onMounted(() => {
border-bottom: 1px solid #ebeef5; border-bottom: 1px solid #ebeef5;
} }
} }
tbody { tbody {
tr:hover { tr:hover {
background-color: #f5f7fa; /* 悬停效果 */ background-color: #f5f7fa; /* 悬停效果 */
@ -345,15 +357,50 @@ onMounted(() => {
background-color: #fffdec; background-color: #fffdec;
} }
} }
.btn { .btn {
margin-top: 5px; margin-top: 5px;
} }
.add-panel {
position: relative;
margin-top: 24px;
height: 100%;
.table_content {
margin-top: 24px;
display: flex;
flex-direction: column;
.add_apply {
height: 80px;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 800;
font-size: 18px;
color: #333333;
font-style: normal;
.search {
width: 50%;
}
}
.simple-table {
flex: 1;
}
}
}
.bottom { .bottom {
margin-top: 10px; margin-top: 10px;
position: absolute; position: absolute;
right: 10px; right: 10px;
bottom: 10px; top: 175%;
} }
</style> </style>

View File

@ -63,7 +63,6 @@
<span>添加商品</span> <span>添加商品</span>
<div class="search"> <div class="search">
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch> <GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
<el-button :icon="Search" type="primary">搜索</el-button>
</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%" height="300" max-height="550">
@ -139,14 +138,15 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="totalPrice">
订单总金额{{ inventory_order_data.totalPrice.toFixed(2) }}
</div>
</div> </div>
<div class="bottom"> <div class="bottom">
<el-button type="primary" @click="confirm">确认</el-button> <div class="totalPrice">
<el-button type="primary" @click="exit">关闭</el-button> 订单总金额<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>
</div> </div>
@ -339,21 +339,6 @@ onMounted(() => {
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.order_table {
position: relative;
width: 100%;
//background-color: rgb(148.6, 212.3, 117.1);
background-color: #fff;
border-radius: 10px;
box-sizing: border-box;
padding: 10px;
tr {
height: 40px;
}
}
.link { .link {
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 12px;
@ -394,10 +379,17 @@ onMounted(() => {
} }
.bottom { .bottom {
margin-top: 10px; height: 86px;
position: absolute; display: flex;
right: 10px; justify-content: space-between;
bottom: 10px; 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;
} }
.error { .error {
@ -408,7 +400,6 @@ onMounted(() => {
} }
.table_content{ .table_content{
margin-top: 24px; margin-top: 24px;
background: #F9FAFC;
.add_goods{ .add_goods{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -418,8 +409,7 @@ onMounted(() => {
color: #333333; color: #333333;
font-style: normal; font-style: normal;
.search{ .search{
display: flex; width: 50%;
align-items: center;
} }
} }
} }

View File

@ -1,66 +1,89 @@
<template> <template>
<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-descriptions title="采购订单" border> <el-form :model="inventory_order_data" label-position="top" ref="orderForm">
<el-descriptions-item label="订单编号" width="200"> <el-row>
<span class="order-info">{{ inventory_order_data.code }}</span> <el-col :span="6">
</el-descriptions-item> <el-form-item label="订单编号">
<el-descriptions-item label="采购人" width="150"> <div style="width: 234px;">
<span class="order-info">{{ inventory_order_data.managerUserName }}</span> <span class="order-info">{{ inventory_order_data.code }}</span>
</el-descriptions-item> </div>
<el-descriptions-item label="采购日期"> </el-form-item>
<el-date-picker </el-col>
v-model="inventory_order_data.purchaseDate" <el-col :span="6">
type="date" <el-form-item label="采购人">
placeholder="选择一个创建日期" <span style="width: 234px;" class="order-info">{{ inventory_order_data.managerUserName }}</span>
size="default" </el-form-item>
value-format="YYYY-MM-DD" </el-col>
v-if="orderInfoIsEdit" <el-col :span="6">
/> <el-form-item prop="purchaseDate" label="采购日期">
<span class="order-info" v-else>{{ inventory_order_data.purchaseDate }}</span> <el-date-picker
</el-descriptions-item> v-model="inventory_order_data.purchaseDate"
<el-descriptions-item label="货单号"> type="date"
placeholder="选择一个创建日期"
<el-input v-model="inventory_order_data.shippingCode" v-if="orderInfoIsEdit"></el-input> size="default"
<span class="order-info" v-else>{{ inventory_order_data.shippingCode }}</span> value-format="YYYY-MM-DD"
</el-descriptions-item> v-if="orderInfoIsEdit"
<el-descriptions-item label="发票号"> style="width: 234px;"
/>
<el-input v-model="inventory_order_data.invoiceCode" v-if="orderInfoIsEdit"></el-input> <span style="width: 234px;" class="order-info" v-else>{{ inventory_order_data.purchaseDate }}</span>
<span class="order-info" v-else>{{ inventory_order_data.invoiceCode }}</span> </el-form-item>
</el-descriptions-item> </el-col>
<el-descriptions-item label="供应商"> <el-col :span="6">
<el-select <el-form-item prop="shippingCode" label="货单号">
v-model="inventory_order_data.supplierId" <el-input v-model="inventory_order_data.shippingCode" v-if="orderInfoIsEdit"></el-input>
placeholder="请选择供应商" <span class="order-info" v-else>{{ inventory_order_data.shippingCode }}</span>
v-if="orderInfoIsEdit"> </el-form-item>
<el-option </el-col>
v-for="item in supplier_list" </el-row>
:key="item.id" <el-row>
:label="item.name" <el-col :span="6">
:value="item.id" <el-form-item prop="invoiceCode" label="发票号">
/> <el-input style="width: 234px;" v-model="inventory_order_data.invoiceCode"
</el-select> v-if="orderInfoIsEdit"></el-input>
<span class="order-info" v-else>{{ inventory_order_data.supplierName }}</span> <span style="width: 234px;" class="order-info" v-else>{{ inventory_order_data.invoiceCode }}</span>
</el-descriptions-item> </el-form-item>
<el-descriptions-item label="备注"> </el-col>
<el-input v-model="inventory_order_data.remark" v-if="orderInfoIsEdit"/> <el-col :span="6">
<span class="order-info" v-else>{{ inventory_order_data.remark }}</span> <el-form-item prop="supplierId" label="供应商">
</el-descriptions-item> <el-select
<el-descriptions-item> v-model="inventory_order_data.supplierId"
<el-button type="primary" @click="saveOrderEdit" v-if="orderInfoIsEdit" plain>保存</el-button> placeholder="请选择供应商"
<el-button type="primary" @click="editOrder" v-else plain>编辑</el-button> v-if="orderInfoIsEdit"
</el-descriptions-item> style="width: 234px;"
</el-descriptions> >
<span class="btn-add-good" style="font-size: 16px" <el-option
@click="changeShowGoodSearch">{{ showGoodSearch ? '取消' : '添加药品' }} v-for="item in supplier_list"
</span> :key="item.id"
<GoodsSearch v-if="showGoodSearch" @selectCallBack="goodsSelectCallBack"> :label="item.name"
:value="item.id"
</GoodsSearch> />
</el-select>
<span style="width: 234px;" class="order-info" v-else>{{ inventory_order_data.supplierName }}</span>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="备注" style="width: 234px">
<el-input style="width: 234px;" v-model="inventory_order_data.remark" v-if="orderInfoIsEdit"/>
<span style="width: 234px;" class="order-info" v-else>{{ inventory_order_data.remark }}</span>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="操作">
<el-button type="primary" @click="saveOrderEdit" v-if="orderInfoIsEdit" plain>保存</el-button>
<el-button type="primary" @click="editOrder" v-else plain>编辑</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div> </div>
<div class="table_content"> <div class="table_content">
<div class="add_goods">
<el-button type="primary" @click="changeShowGoodSearch">{{ showGoodSearch ? '取消' : '添加药品' }}</el-button>
<div class="search">
<GoodsSearch v-if="showGoodSearch" @selectCallBack="goodsSelectCallBack"></GoodsSearch>
</div>
</div>
<el-table :data="table_list" style="width: 100%" height="250"> <el-table :data="table_list" style="width: 100%" height="250">
<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">
@ -151,18 +174,23 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="totalPrice">
订单总金额{{ inventory_order_data.totalPrice.toFixed(2) }}
</div>
</div> </div>
<div class="bottom"> <div class="bottom">
<el-button type="danger" @click="returnableAll()" plain>整单退货</el-button> <div class="totalPrice">
<el-button type="primary" @click="exit" plain>关闭</el-button> 订单总金额<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="danger" @click="returnableAll()" plain>整单退货</el-button>
<el-button type="primary" @click="exit">关闭</el-button>
</div>
</div> </div>
</div> </div>
<Mask :is-show="is_add" :top="100">
<Edit ref="editRef" @close="is_add = false;"/> <Mask :is-show="is_add" :top="100">
</Mask> <Edit ref="editRef" @close="is_add = false;"/>
</Mask>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -298,7 +326,7 @@ const getSupplierList = () => {
const query = { const query = {
turn: 1 turn: 1
} }
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
}) })
} }
@ -306,7 +334,6 @@ const getOrderDetail = () => {
post("inventory/order/detail", {code: props.code}).then((res: any) => { post("inventory/order/detail", {code: props.code}).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
console.log(res)
}) })
} }
const addOneGoods = (row: any) => { const addOneGoods = (row: any) => {
@ -363,70 +390,12 @@ const goodsSelectCallBack = (inventory: any) => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.order_table {
position: relative;
width: 100%;
//background-color: rgb(148.6, 212.3, 117.1);
background-color: #fff;
border-radius: 10px;
box-sizing: border-box;
padding: 10px;
tr {
height: 40px;
}
}
.order-info {
line-height: 32px;
}
.search_box {
//background-color: rgb(148.6, 212.3, 117.1);
background-color: #fff;
padding: 10px;
border-radius: 10px;
box-sizing: border-box;
margin-top: 10px;
margin-bottom: 10px;
}
.header {
display: flex;
.text {
font-size: 16px;
width: 200px;
color: #6a6a6a;
}
}
.link { .link {
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 12px;
color: #2e7eb3; color: #2e7eb3;
} }
.btn-add-good {
cursor: pointer;
font-size: 12px;
color: #2e7eb3;
}
.row {
display: flex;
max-height: 500px;
.text {
font-size: 12px;
width: 150px;
margin-left: 10px;
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis; /* 显示省略号 */
white-space: nowrap; /* 防止换行 */
}
}
.line { .line {
margin-right: 10px; margin-right: 10px;
@ -461,9 +430,39 @@ const goodsSelectCallBack = (inventory: any) => {
} }
.bottom { .bottom {
margin-top: 10px; height: 86px;
position: absolute; display: flex;
right: 10px; justify-content: space-between;
bottom: 10px; 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;
}
.error {
background-color: #F00;
}
.edit-panel{
margin-top: 24px;
}
.table_content{
margin-top: 24px;
.add_goods{
height: 80px;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 800;
font-size: 18px;
color: #333333;
font-style: normal;
.search{
width: 50%;
}
}
} }
</style> </style>

View File

@ -1,45 +1,54 @@
<template> <template>
<el-descriptions <div class="add-supplier" style="width:100%;margin-top: 24px">
direction="vertical" <div class="form">
:column="1" <el-form style="width: 100%" ref="ruleFormRef" :model="formData" :inline=true label-position="top">
> <el-form-item label="供货商名称" style="width: 100%;margin-right: 0">
<el-descriptions-item label="供货商名称"> <el-input style="width: 100%" v-model="formData.name" placeholder="请输入供货商名称"></el-input>
<el-input v-model="formData.name" placeholder="请输入供货商名称"></el-input> </el-form-item>
</el-descriptions-item> <el-row style="width: 100%">
</el-descriptions> <el-col :span="12">
<el-descriptions <el-form-item label="启用状态">
direction="vertical" <el-radio-group v-model="formData.turn" size="large">
:column="2" <el-radio-button label="禁用" :value="0"/>
> <el-radio-button label="启用" :value="1"/>
<el-descriptions-item label="启用状态"> </el-radio-group>
<el-radio-group v-model="formData.turn" size="large"> </el-form-item>
<el-radio-button label="禁用" :value="0"/> </el-col>
<el-radio-button label="启用" :value="1"/> <el-col :span="12">
</el-radio-group> <el-form-item label="许可证号" style="margin-right: 0">
</el-descriptions-item> <el-input v-model="formData.licenseCode" placeholder="请输入许可证号"></el-input>
<el-descriptions-item label="许可证号"> </el-form-item>
<el-input v-model="formData.licenseCode" placeholder="请输入许可证号"></el-input> </el-col>
</el-descriptions-item> </el-row>
<el-descriptions-item label="联系人"> <el-row style="width: 100%">
<el-input v-model="formData.contactName" placeholder="请输入联系人名称"></el-input> <el-col :span="12">
</el-descriptions-item> <el-form-item label="联系人">
<el-descriptions-item label="联系方式"> <el-input v-model="formData.contactName" placeholder="请输入联系人名称"></el-input>
<el-input v-model="formData.contactTel" placeholder="请输入联系方式"></el-input> </el-form-item>
</el-descriptions-item> </el-col>
<el-descriptions-item label="备注"> <el-col :span="12">
<el-input v-model="formData.reamark" <el-form-item label="联系方式" style="margin-right: 0">
type="textarea" rows="5" <el-input v-model="formData.contactTel" placeholder="请输入联系方式"></el-input>
max="200" </el-form-item>
show-word-limit </el-col>
placeholder="请输入备注"> </el-row>
</el-input> <el-form-item label="备注" style="margin-right: 0;width: 100%">
</el-descriptions-item> <el-input v-model="formData.reamark"
</el-descriptions> type="textarea" rows="5"
max="200"
show-word-limit
placeholder="请输入备注"
style="width: 100%"
>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
<div class="btn"> <div class="btn">
<el-button type="primary" @click="save">确定</el-button> <el-button type="primary" @click="save">确定</el-button>
<el-button @click="close">取消</el-button> <el-button @click="close">取消</el-button>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -89,7 +98,7 @@ const close = () => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.btn{ .btn {
position: absolute; position: absolute;
right: 10px; right: 10px;
bottom: 10px; bottom: 10px;

View File

@ -2,11 +2,11 @@
<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="open_add(null)">新增采购</el-button> <el-button type="primary" :icon="Plus" @click="is_add = true">新增采购</el-button>
</el-dropdown> </el-dropdown>
</div> </div>
<div class="content_list"> <div class="content_list">
<el-table :data="tableData" style="width: 100%" @row-click="open_add"> <el-table :data="tableData" style="width: 100%" @row-click="open_edit">
<el-table-column fixed label="进货单号" width="250" show-overflow-tooltip> <el-table-column fixed label="进货单号" width="250" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<div class="link">{{ scope.row.code }}</div> <div class="link">{{ scope.row.code }}</div>
@ -46,10 +46,13 @@
/> />
</div> </div>
</div> </div>
<Mask :width="1200" :top="100" :is-show="is_add" @close="is_add=false" <Mask v-if="!open_code" :width="1200" :top="100" :is-show="is_add" @close="closeAddOrder"
:title="open_code?'编辑':'新增'"> title="新增" :height="760">
<AddOrder v-if="!open_code" @close="closeAddOrder"/> <AddOrder @close="closeAddOrder"/>
<EditOrder v-else :code="open_code" @close="is_add=false" @updateOrderDetail="init"/> </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> </Mask>
</div> </div>
</template> </template>
@ -65,18 +68,15 @@ import {Plus} from "@element-plus/icons-vue";
let tableData = ref([]) let tableData = ref([])
let is_add = ref(false) let is_add = 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()
}) })
let open_add = (row: any) => { let open_edit = (row: any) => {
is_add.value = true is_edit.value = true
if (row!=null) { open_code.value = row.code
open_code.value = row.code
}else{
open_code.value = null
}
} }
@ -94,6 +94,11 @@ const closeAddOrder = () => {
is_add.value = false is_add.value = false
init() init()
} }
const closeEditOrder = () => {
open_code.value = null
is_edit.value = false
init()
}
// //
let pageSize = ref(20) let pageSize = ref(20)
let total = ref(0) let total = ref(0)

View File

@ -33,7 +33,7 @@
/> />
</div> </div>
</div> </div>
<Mask :width="400" :height="600" :is-show="showAdd" :top="100" @close="showAdd = false" :title="id?'编辑':'添加'"> <Mask :width="540" :height="603" :is-show="showAdd" :top="100" @close="showAdd = false" :title="id?'编辑':'添加供应商'">
<AddSupplier @close="showAdd = false" @saveSuccess="getSupplier()" ref="addSupplierRef"></AddSupplier> <AddSupplier @close="showAdd = false" @saveSuccess="getSupplier()" ref="addSupplierRef"></AddSupplier>
</Mask> </Mask>
</div> </div>