dev
This commit is contained in:
parent
4980225f2f
commit
b47c0ee658
|
|
@ -1,133 +1,140 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="add-panel">
|
<Mask :width="1200" :height="600" :top="100" :is-show="isShow" @close="exit" title="新增领用" :show-footer="true">
|
||||||
<div class="top">
|
<div class="add-panel">
|
||||||
<el-form :inline=true label-position="top" :model="formData" label-width="auto">
|
<div class="top">
|
||||||
<el-form-item label="领用人">
|
<el-form :inline=true label-position="top" :model="formData" label-width="auto">
|
||||||
<el-input v-model="formData.name" disabled></el-input>
|
<el-form-item label="领用人">
|
||||||
</el-form-item>
|
<el-input v-model="formData.name" disabled></el-input>
|
||||||
<el-form-item label="备注" style="width: 50%">
|
</el-form-item>
|
||||||
<el-input v-model="formData.remark"></el-input>
|
<el-form-item label="备注" style="width: 50%">
|
||||||
</el-form-item>
|
<el-input v-model="formData.remark"></el-input>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
</div>
|
</el-form>
|
||||||
<div class="table_content">
|
|
||||||
<div class="add_apply">
|
|
||||||
<span>领用药品</span>
|
|
||||||
<div class="search">
|
|
||||||
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<table class="simple-table" style="margin-top: 15px;width: 100% ;height:300px ;max-height:550px">
|
<div class="table_content">
|
||||||
<thead>
|
<div class="add_apply">
|
||||||
<tr>
|
<span>领用药品</span>
|
||||||
<th>名称</th>
|
<div class="search">
|
||||||
<th>批次</th>
|
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
|
||||||
<th>生产批号</th>
|
</div>
|
||||||
<th>有效期</th>
|
</div>
|
||||||
<th>当前库存</th>
|
<table class="simple-table" style="margin-top: 15px;width: 100% ;height:300px ;max-height:550px">
|
||||||
<th>出库数量</th>
|
<thead>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<template v-for="(item,index) in tableList">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ item.name }}</td>
|
<th>名称</th>
|
||||||
<td>
|
<th>批次</th>
|
||||||
<el-select
|
<th>生产批号</th>
|
||||||
v-model="item.selectList"
|
<th>有效期</th>
|
||||||
multiple
|
<th>当前库存</th>
|
||||||
@change="addLine(item)"
|
<th>出库数量</th>
|
||||||
: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>
|
</tr>
|
||||||
<template v-for="subItem in item.children">
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<template v-for="(item,index) in tableList">
|
||||||
<tr>
|
<tr>
|
||||||
<td>-</td>
|
<td>{{ item.name }}</td>
|
||||||
<td>-</td>
|
|
||||||
<td>{{ subItem.productionBatchCode }}</td>
|
|
||||||
<td>{{ subItem.expiryDate }}</td>
|
|
||||||
<td>
|
<td>
|
||||||
{{ subItem.wholeNumber }}{{ subItem.packagingUnit }}
|
<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">
|
<template v-if="item.trdnFlag == 1">
|
||||||
{{ subItem.fragmentNumber }}{{ subItem.minPackagingUnit }}
|
{{ item.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<el-input v-model.number="subItem.outWholeNumber" size="small" style="width: 50px"
|
{{ item.totalOutWholeNumber }}{{ item.packagingUnit }}
|
||||||
@change="changeOutNumber(item)">
|
<template v-if="item.trdnFlag == 1">
|
||||||
<template #suffix>
|
{{ item.totalFragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
{{ item.packagingUnit }}
|
</template>
|
||||||
</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>
|
</td>
|
||||||
</tr>
|
</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>
|
</template>
|
||||||
</template>
|
</tbody>
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<el-button type="primary" @click="save">保存</el-button>
|
<el-button type="primary" @click="save">保存</el-button>
|
||||||
<el-button type="primary" @click="exit">关闭</el-button>
|
<el-button type="primary" @click="exit">关闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</div>
|
</Mask>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {onMounted, ref, unref} from "vue";
|
import {onMounted, ref, unref} from "vue";
|
||||||
import GoodsSearch from "@/components/inventory/GoodsSearch.vue";
|
import GoodsSearch from "@/components/inventory/GoodsSearch.vue";
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import CloseBtn from "@/components/CloseBtn.vue";
|
import CloseBtn from "@/components/CloseBtn.vue";
|
||||||
|
import Mask from "@/components/common/Mask.vue";
|
||||||
|
|
||||||
|
const isShow = ref<any>(false)
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
const exit = () => {
|
const exit = () => {
|
||||||
|
isShow.value = false
|
||||||
emit('close')
|
emit('close')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
|
|
@ -162,7 +169,7 @@ const goodsSelectCallBack = (inventory: any) => {
|
||||||
if (findIndexForTableList(inventory.goodId) != -1) {
|
if (findIndexForTableList(inventory.goodId) != -1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
post("inventory/goods/getByGoodsId", {goodsId: inventory.goodId}).then((res: any) => {
|
post("inventory/goods/getByGoodsId", {goodsId: inventory.goodId,isZero:false}).then((res: any) => {
|
||||||
inventory.batchList = res.inventoryGoodsList
|
inventory.batchList = res.inventoryGoodsList
|
||||||
inventory.minPackagingUnit = res.minPackagingUnit
|
inventory.minPackagingUnit = res.minPackagingUnit
|
||||||
inventory.trdnFlag = res.trdnFlag
|
inventory.trdnFlag = res.trdnFlag
|
||||||
|
|
@ -173,7 +180,6 @@ const goodsSelectCallBack = (inventory: any) => {
|
||||||
inventory.packagingUnit = res.packagingUnit
|
inventory.packagingUnit = res.packagingUnit
|
||||||
tableList.value.push(inventory)
|
tableList.value.push(inventory)
|
||||||
})
|
})
|
||||||
console.log(inventory)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface childCheck {
|
interface childCheck {
|
||||||
|
|
@ -228,7 +234,6 @@ const addLine = (row: any) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
row.children = children;
|
row.children = children;
|
||||||
console.log("row", row)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const changeOutNumber = (row: any) => {
|
const changeOutNumber = (row: any) => {
|
||||||
|
|
@ -244,25 +249,6 @@ const changeOutNumber = (row: any) => {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
}
|
}
|
||||||
const save = () => {
|
const save = () => {
|
||||||
let children = [];
|
|
||||||
console.log(tableList.value)
|
|
||||||
// for (let i = 0; i < tableList.value.length; i++) {
|
|
||||||
// let item = tableList.value[i];
|
|
||||||
// for (let j = 0; j < item.children.length; j++) {
|
|
||||||
// let child = item.children[j];
|
|
||||||
// if (child && (child.outWholeNumber > 0 || child.outFragmentNumber > 0)) {
|
|
||||||
// let childrenItem = {
|
|
||||||
// id: child.id,
|
|
||||||
// outWholeNumber: child.outWholeNumber,
|
|
||||||
// outFragmentNumber: child.outFragmentNumber,
|
|
||||||
// }
|
|
||||||
// children.push(childrenItem);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// let dataJson = JSON.stringify(tableList.value);
|
|
||||||
post("inventory/apply/create", {useInfo: formData.value, data: tableList.value}).then((res: any) => {
|
post("inventory/apply/create", {useInfo: formData.value, data: tableList.value}).then((res: any) => {
|
||||||
exit()
|
exit()
|
||||||
})
|
})
|
||||||
|
|
@ -270,15 +256,14 @@ const save = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
const getUserInfo = () => {
|
const getUserInfo = () => {
|
||||||
|
isShow.value = true
|
||||||
post("manager/user/verify", null).then((res: any) => {
|
post("manager/user/verify", null).then((res: any) => {
|
||||||
formData.value.useUserId = res.id;
|
formData.value.useUserId = res.id;
|
||||||
formData.value.name = res.name;
|
formData.value.name = res.name;
|
||||||
formData.value.username = res.username;
|
formData.value.username = res.username;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
defineExpose({getUserInfo})
|
||||||
getUserInfo()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.simple-table {
|
.simple-table {
|
||||||
|
|
@ -366,6 +351,7 @@ onMounted(() => {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
padding: 0 24px;
|
||||||
|
|
||||||
.table_content {
|
.table_content {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
|
@ -397,10 +383,10 @@ onMounted(() => {
|
||||||
|
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
margin-top: 10px;
|
height: 100%;
|
||||||
position: absolute;
|
display: flex;
|
||||||
right: 10px;
|
justify-content: flex-end;
|
||||||
top: 175%;
|
align-items: center;
|
||||||
|
padding: 0 24px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,107 +1,114 @@
|
||||||
<template>
|
<template>
|
||||||
<el-descriptions border label-width="100">
|
<Mask :width="1200" :height="600" :top="100" :is-show="isShow" @close="exit" title="查看领用" :show-footer="true">
|
||||||
<el-descriptions-item label="领用人" width="200">
|
<div style="margin-top: 24px;padding: 0 24px">
|
||||||
<el-input v-model="formData.name" disabled></el-input>
|
<el-descriptions border label-width="100">
|
||||||
</el-descriptions-item>
|
<el-descriptions-item label="领用人" width="200">
|
||||||
<el-descriptions-item label="备注">
|
<el-input v-model="formData.name" disabled></el-input>
|
||||||
<el-input v-model="formData.remark" disabled></el-input>
|
</el-descriptions-item>
|
||||||
</el-descriptions-item>
|
<el-descriptions-item label="备注">
|
||||||
</el-descriptions>
|
<el-input v-model="formData.remark" disabled></el-input>
|
||||||
<table class="simple-table" style="margin-top: 15px">
|
</el-descriptions-item>
|
||||||
<thead>
|
</el-descriptions>
|
||||||
<tr>
|
<table class="simple-table" style="margin-top: 15px">
|
||||||
<th>名称</th>
|
<thead>
|
||||||
<th>批次</th>
|
|
||||||
<th>生产批号</th>
|
|
||||||
<th>有效期</th>
|
|
||||||
<th>当前库存</th>
|
|
||||||
<th>出库数量</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<template v-for="(item,index) in tableList" :key="index">
|
|
||||||
<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) in item.batchList"
|
|
||||||
:key="subItem.id"
|
|
||||||
:label="subItem.id"
|
|
||||||
:value="subItem.id"
|
|
||||||
:disabled="true"
|
|
||||||
>
|
|
||||||
<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>
|
|
||||||
{{ subItem.outWholeNumber }}{{ subItem.packagingUnit }}
|
|
||||||
<template v-if="item.trdnFlag == 1">
|
|
||||||
{{ subItem.outFragmentNumber }}{{ subItem.minPackagingUnit }}
|
|
||||||
</template>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<template v-for="(item,index) in tableList" :key="index">
|
||||||
|
<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) in item.batchList"
|
||||||
|
:key="subItem.id"
|
||||||
|
:label="subItem.id"
|
||||||
|
:value="subItem.id"
|
||||||
|
:disabled="true"
|
||||||
|
>
|
||||||
|
<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>
|
||||||
|
{{ subItem.outWholeNumber }}{{ subItem.packagingUnit }}
|
||||||
|
<template v-if="item.trdnFlag == 1">
|
||||||
|
{{ subItem.outFragmentNumber }}{{ subItem.minPackagingUnit }}
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="bottom">
|
||||||
|
<el-button type="primary" @click="exit">关闭</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</tbody>
|
</Mask>
|
||||||
</table>
|
|
||||||
<div class="bottom">
|
|
||||||
<el-button type="primary" @click="exit">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {onMounted, ref, defineProps} from "vue";
|
import {onMounted, ref, defineProps} from "vue";
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import CloseBtn from "@/components/CloseBtn.vue";
|
import CloseBtn from "@/components/CloseBtn.vue";
|
||||||
|
import Mask from "@/components/common/Mask.vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
|
@ -109,11 +116,17 @@ const props = defineProps({
|
||||||
default: null
|
default: null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const isShow = ref<any>(false)
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
const exit = () => {
|
const exit = () => {
|
||||||
|
formData.value = {
|
||||||
|
useUserId: null,
|
||||||
|
name: '',
|
||||||
|
username: "",
|
||||||
|
remark: ''
|
||||||
|
}
|
||||||
|
isShow.value = false
|
||||||
emit('close')
|
emit('close')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
|
|
@ -194,22 +207,27 @@ const addLine = (row: any) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const getUserInfo = () => {
|
const getUserInfo = () => {
|
||||||
post("manager/user/verify", null).then((res: any) => {
|
post("manager/user/verify").then((res: any) => {
|
||||||
formData.value.useUserId = res.id;
|
formData.value.useUserId = res.id;
|
||||||
formData.value.name = res.name;
|
formData.value.name = res.name;
|
||||||
formData.value.username = res.username;
|
formData.value.username = res.username;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const detail = () => {
|
const detail = (id: any) => {
|
||||||
post("inventory/apply/getApplyDetail", {id: props.id}).then((res: any) => {
|
isShow.value = true
|
||||||
|
post("inventory/apply/getApplyDetail", {id}).then((res: any) => {
|
||||||
formData.value = res.useInfo;
|
formData.value = res.useInfo;
|
||||||
tableList.value = JSON.parse(res);
|
tableList.value = JSON.parse(res);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getUserInfo()
|
|
||||||
detail()
|
|
||||||
})
|
})
|
||||||
|
const init=(id: any) => {
|
||||||
|
getUserInfo()
|
||||||
|
detail(id)
|
||||||
|
}
|
||||||
|
defineExpose({init})
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.simple-table {
|
.simple-table {
|
||||||
|
|
@ -231,6 +249,7 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody {
|
tbody {
|
||||||
tr:hover {
|
tr:hover {
|
||||||
background-color: #f5f7fa; /* 悬停效果 */
|
background-color: #f5f7fa; /* 悬停效果 */
|
||||||
|
|
@ -287,15 +306,17 @@ tbody {
|
||||||
background-color: #fffdec;
|
background-color: #fffdec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
margin-top: 10px;
|
height: 100%;
|
||||||
position: absolute;
|
display: flex;
|
||||||
right: 10px;
|
justify-content: flex-end;
|
||||||
bottom: 10px;
|
align-items: center;
|
||||||
|
padding: 0 24px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,144 +1,335 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="body_wrapper">
|
<Mask :width="1200" :height="540" :is-show="isShow" :top="100" @close="exit" title="新增盘点" :show-footer="true">
|
||||||
<div class="top" style="width: 100%">
|
<div class="body_wrapper">
|
||||||
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">
|
<div class="top" style="width: 100%">
|
||||||
<el-form-item label="备注" style="width: 100%;margin-right: 0">
|
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">
|
||||||
<el-input v-model="form.remark" placeholder="请输入单据编号"></el-input>
|
<el-form-item label="备注" style="width: 100%;margin-right: 0">
|
||||||
</el-form-item>
|
<el-input v-model="form.remark" placeholder="请输入单据编号"></el-input>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
</div>
|
</el-form>
|
||||||
<div class="content">
|
|
||||||
<div class="add_goods">
|
|
||||||
<span>盘点药品</span>
|
|
||||||
<div class="search">
|
|
||||||
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<table class="simple-table" style="margin-top: 15px;">
|
<div class="content">
|
||||||
<thead>
|
<div class="add_goods">
|
||||||
<tr>
|
<span>盘点药品</span>
|
||||||
<th>名称</th>
|
<div class="search">
|
||||||
<th>批次</th>
|
<GoodsSearch @selectCallBack="goodsSelectCallBack"></GoodsSearch>
|
||||||
<th>最小包装数量</th>
|
</div>
|
||||||
<th>库存</th>
|
</div>
|
||||||
<th>改后库存</th>
|
<table class="simple-table" style="margin-top: 15px;">
|
||||||
<th>变化量</th>
|
<thead>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<template v-for="(item,index) in list">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ item.name }}</td>
|
<th>名称</th>
|
||||||
<td>
|
<th>批次</th>
|
||||||
<!--<el-checkbox-group v-model="item.childIdList" @change="addLine(item)">
|
<th>最小包装数量</th>
|
||||||
<el-checkbox v-for="(subItem,subIndex) in item.selectList" :label="subItem.id" :value="subItem.id" />
|
<th>库存</th>
|
||||||
</el-checkbox-group>-->
|
<th>改后库存</th>
|
||||||
<el-select
|
<th>变化量</th>
|
||||||
v-model="item.childIdList"
|
|
||||||
@change="addLine(item)"
|
|
||||||
multiple
|
|
||||||
:teleported="false"
|
|
||||||
style="width: 150px;"
|
|
||||||
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.selectList"
|
|
||||||
: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>{{ item.minPackagingNumber }}</td>
|
|
||||||
<td>
|
|
||||||
{{ item.before.wholeNumber }}{{ item.packagingUnit }}
|
|
||||||
<template v-if="item.trdnFlag ==1">
|
|
||||||
{{ item.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<el-form v-show="item.childIdList.length===0">
|
|
||||||
<el-input v-model.number="item.after.wholeNumber" style="width: 60px" @change="setChange(item)">
|
|
||||||
<template #suffix>{{ item.packagingUnit }}</template>
|
|
||||||
</el-input>
|
|
||||||
<el-input v-model.number="item.after.fragmentNumber" style="width: 60px;margin-left: 5px"
|
|
||||||
@change="setChange(item)" v-if="item.trdnFlag ==1">
|
|
||||||
<template #suffix>{{ item.minPackagingUnit }}</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ item.change.wholeNumber }}{{ item.packagingUnit }}
|
|
||||||
<template v-if="item.trdnFlag ==1">
|
|
||||||
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
|
||||||
</template>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<template v-for="(subItem,subIndex) in item.children">
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<template v-for="(item,index) in list">
|
||||||
<tr>
|
<tr>
|
||||||
<td>-</td>
|
<td>{{ item.name }}</td>
|
||||||
<td>-</td>
|
<td>
|
||||||
<td>-</td>
|
<!--<el-checkbox-group v-model="item.childIdList" @change="addLine(item)">
|
||||||
<td> {{ subItem.before.wholeNumber }}{{ item.packagingUnit }}
|
<el-checkbox v-for="(subItem,subIndex) in item.selectList" :label="subItem.id" :value="subItem.id" />
|
||||||
|
</el-checkbox-group>-->
|
||||||
|
<el-select
|
||||||
|
v-model="item.childIdList"
|
||||||
|
@change="addLine(item)"
|
||||||
|
multiple
|
||||||
|
:teleported="false"
|
||||||
|
style="width: 150px;"
|
||||||
|
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.selectList"
|
||||||
|
: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>{{ item.minPackagingNumber }}</td>
|
||||||
|
<td>
|
||||||
|
{{ item.before.wholeNumber }}{{ item.packagingUnit }}
|
||||||
<template v-if="item.trdnFlag ==1">
|
<template v-if="item.trdnFlag ==1">
|
||||||
{{ subItem.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
{{ item.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<el-input v-model.number="subItem.after.wholeNumber" style="width: 60px" @change="setChange(subItem)">
|
<el-form v-show="item.childIdList.length===0">
|
||||||
<template #suffix>{{ item.packagingUnit }}</template>
|
<el-input v-model.number="item.after.wholeNumber" style="width: 60px" @change="setChange(item)">
|
||||||
</el-input>
|
<template #suffix>{{ item.packagingUnit }}</template>
|
||||||
<el-input v-model.number="subItem.after.fragmentNumber" style="width: 60px;margin-left: 5px"
|
</el-input>
|
||||||
@change="setChange(subItem)" v-if="item.trdnFlag ==1">
|
<el-input v-model.number="item.after.fragmentNumber" style="width: 60px;margin-left: 5px"
|
||||||
<template #suffix>{{ item.minPackagingUnit }}</template>
|
@change="setChange(item)" v-if="item.trdnFlag ==1">
|
||||||
</el-input>
|
<template #suffix>{{ item.minPackagingUnit }}</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ subItem.change.wholeNumber }}{{ item.packagingUnit }}
|
{{ item.change.wholeNumber }}{{ item.packagingUnit }}
|
||||||
<template v-if="item.trdnFlag ==1">
|
<template v-if="item.trdnFlag ==1">
|
||||||
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<template v-for="(subItem,subIndex) in item.children">
|
||||||
|
<tr>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td> {{ subItem.before.wholeNumber }}{{ item.packagingUnit }}
|
||||||
|
<template v-if="item.trdnFlag ==1">
|
||||||
|
{{ subItem.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<el-input v-model.number="subItem.after.wholeNumber" style="width: 60px" @change="setChange(subItem)">
|
||||||
|
<template #suffix>{{ item.packagingUnit }}</template>
|
||||||
|
</el-input>
|
||||||
|
<el-input v-model.number="subItem.after.fragmentNumber" style="width: 60px;margin-left: 5px"
|
||||||
|
@change="setChange(subItem)" v-if="item.trdnFlag ==1">
|
||||||
|
<template #suffix>{{ item.minPackagingUnit }}</template>
|
||||||
|
</el-input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ subItem.change.wholeNumber }}{{ item.packagingUnit }}
|
||||||
|
<template v-if="item.trdnFlag ==1">
|
||||||
|
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</tbody>
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<template #footer>
|
||||||
|
<div class="bottom">
|
||||||
<div class="bottom">
|
<div class="btn">
|
||||||
<div class="btn">
|
<el-button @click="save" type="primary">保存</el-button>
|
||||||
<el-button @click="save" type="primary">保存</el-button>
|
<el-button @click="exit" type="primary">关闭</el-button>
|
||||||
<el-button @click="exit" type="primary">关闭</el-button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
|
</Mask>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {post} from "@/utils/request.ts";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import GoodsSearch from "@/components/inventory/GoodsSearch.vue";
|
||||||
|
import Mask from "@/components/common/Mask.vue";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
|
const form = ref<any>({
|
||||||
|
remark: ""
|
||||||
|
})
|
||||||
|
const state = ref([])
|
||||||
|
const goodsSelectCallBack = (item: any) => {
|
||||||
|
|
||||||
|
if (findIndexForTableList(item.goodId) != -1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
addRow(item.goodId);
|
||||||
|
state.value = []
|
||||||
|
}
|
||||||
|
const findIndexForTableList = (goodId: any) => {
|
||||||
|
return list.value.findIndex((item: any) => item.goodsId === goodId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface Check {
|
||||||
|
id?: number,
|
||||||
|
goodsId: number,
|
||||||
|
name: string,
|
||||||
|
minPackagingUnit: string,
|
||||||
|
packagingUnit: string,
|
||||||
|
minPackagingNumber: number,
|
||||||
|
listSize: number,
|
||||||
|
trdnFlag: number,
|
||||||
|
childIdList: number[],
|
||||||
|
before: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
after: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
change: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
}
|
||||||
|
children: childCheck[],
|
||||||
|
selectList: seletcType[],
|
||||||
|
}
|
||||||
|
|
||||||
|
interface seletcType {
|
||||||
|
id: number,
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
productionBatchCode: string,
|
||||||
|
productionDate: string,
|
||||||
|
expiryDate: string,
|
||||||
|
purchaseUnitPrice: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface childCheck {
|
||||||
|
id?: number,
|
||||||
|
goodsId: number,
|
||||||
|
name: string,
|
||||||
|
minPackagingNumber: number,
|
||||||
|
before: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
after: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
change: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = ref<Check[]>([])
|
||||||
|
const emit = defineEmits(['close'])
|
||||||
|
let setChange = function (row: any) {
|
||||||
|
let totalBefore = row.before.wholeNumber * row.minPackagingNumber + row.before.fragmentNumber; // 使用原始数据
|
||||||
|
let totalAfter = row.after.wholeNumber * row.minPackagingNumber + row.after.fragmentNumber; // 使用原始数据
|
||||||
|
console.log(totalBefore, totalAfter)
|
||||||
|
let diff = totalAfter - totalBefore;
|
||||||
|
|
||||||
|
row.change.wholeNumber = Math.trunc(diff / row.minPackagingNumber);
|
||||||
|
row.change.fragmentNumber = diff % row.minPackagingNumber
|
||||||
|
}
|
||||||
|
let addLine = (row: any) => {
|
||||||
|
post("inventory/goods/getListByIds", {idList: row.childIdList}).then((list: any) => {
|
||||||
|
let children = [];
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
let inventoryGoods = list[i];
|
||||||
|
let index = row.children.findIndex((item: any) => item.id === inventoryGoods.id);
|
||||||
|
if (index > -1) {
|
||||||
|
children.push(row.children[index]);
|
||||||
|
} else {
|
||||||
|
let childCheck: childCheck = {
|
||||||
|
name: inventoryGoods.name,
|
||||||
|
id: inventoryGoods.id,
|
||||||
|
goodsId: inventoryGoods.goodId,
|
||||||
|
minPackagingNumber: row.minPackagingNumber,
|
||||||
|
before: {
|
||||||
|
wholeNumber: inventoryGoods.wholeNumber,
|
||||||
|
fragmentNumber: inventoryGoods.fragmentNumber,
|
||||||
|
},
|
||||||
|
after: {
|
||||||
|
wholeNumber: inventoryGoods.wholeNumber,
|
||||||
|
fragmentNumber: inventoryGoods.fragmentNumber,
|
||||||
|
},
|
||||||
|
change: {
|
||||||
|
wholeNumber: 0,
|
||||||
|
fragmentNumber: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
children.push(childCheck);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
row.children = children;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let addRow = (goodsId: number) => {
|
||||||
|
post("inventory/goods/getByGoodsId", {goodsId, isZero: true}).then((res: any) => {
|
||||||
|
let check: Check = {
|
||||||
|
goodsId: res.id,
|
||||||
|
name: res.name,
|
||||||
|
listSize: res.listSize,
|
||||||
|
childIdList: [],
|
||||||
|
minPackagingNumber: res.minPackagingNumber,
|
||||||
|
packagingUnit: res.packagingUnit,
|
||||||
|
minPackagingUnit: res.minPackagingUnit,
|
||||||
|
trdnFlag: res.trdnFlag,
|
||||||
|
before: {
|
||||||
|
wholeNumber: res.wholeNumber,
|
||||||
|
fragmentNumber: res.fragmentNumber,
|
||||||
|
},
|
||||||
|
after: {
|
||||||
|
wholeNumber: res.wholeNumber,
|
||||||
|
fragmentNumber: res.fragmentNumber,
|
||||||
|
},
|
||||||
|
change: {
|
||||||
|
wholeNumber: 0,
|
||||||
|
fragmentNumber: 0,
|
||||||
|
},
|
||||||
|
children: [],
|
||||||
|
selectList: [],
|
||||||
|
}
|
||||||
|
let inventoryGoodsList = res.inventoryGoodsList
|
||||||
|
|
||||||
|
for (let i = 0; i < inventoryGoodsList.length; i++) {
|
||||||
|
let inventoryGoods = inventoryGoodsList[i];
|
||||||
|
let childCheck: seletcType = {
|
||||||
|
id: inventoryGoods.id,
|
||||||
|
wholeNumber: inventoryGoods.wholeNumber,
|
||||||
|
fragmentNumber: inventoryGoods.fragmentNumber,
|
||||||
|
productionBatchCode: inventoryGoods.productionBatchCode,
|
||||||
|
productionDate: inventoryGoods.productionDate,
|
||||||
|
expiryDate: inventoryGoods.expiryDate,
|
||||||
|
purchaseUnitPrice: inventoryGoods.purchaseUnitPrice,
|
||||||
|
}
|
||||||
|
check.selectList.push(childCheck)
|
||||||
|
}
|
||||||
|
list.value.push(check)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let save = () => {
|
||||||
|
post("inventory/check/save", {list: list.value, remark: form.value.remark}).then((res: any) => {
|
||||||
|
ElMessage.success('保存成功')
|
||||||
|
exit()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let exit = () => {
|
||||||
|
form.value = {
|
||||||
|
remark: ""
|
||||||
|
}
|
||||||
|
list.value=[]
|
||||||
|
isShow.value = false
|
||||||
|
emit('close');
|
||||||
|
}
|
||||||
|
const isShow = ref<any>(false)
|
||||||
|
const init = () => {
|
||||||
|
isShow.value = true
|
||||||
|
}
|
||||||
|
defineExpose({init})
|
||||||
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.body_wrapper {
|
.body_wrapper {
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
padding: 0 24px;
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -286,203 +477,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
height: 86px;
|
height: 100%;
|
||||||
width: 100%;
|
display: flex;
|
||||||
margin-top: 10px;
|
justify-content: flex-end;
|
||||||
position: absolute;
|
align-items: center;
|
||||||
right: 10px;
|
padding: 0 24px;
|
||||||
bottom: 0;
|
|
||||||
border-top: 1px solid #EAEAEC;
|
|
||||||
.btn{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script setup lang="ts">
|
|
||||||
import {onMounted} from "vue";
|
|
||||||
import {post} from "@/utils/request.ts";
|
|
||||||
import {ref} from "vue";
|
|
||||||
import GoodsSearch from "@/components/inventory/GoodsSearch.vue";
|
|
||||||
|
|
||||||
const form = ref<any>({
|
|
||||||
remark: ""
|
|
||||||
})
|
|
||||||
const state = ref([])
|
|
||||||
const options = ref([])
|
|
||||||
|
|
||||||
|
|
||||||
const goodsSelectCallBack = (item: any) => {
|
|
||||||
|
|
||||||
if (findIndexForTableList(item.goodId) != -1) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
addRow(item.goodId);
|
|
||||||
state.value = []
|
|
||||||
}
|
|
||||||
const findIndexForTableList = (goodId: any) => {
|
|
||||||
return list.value.findIndex((item: any) => item.goodsId === goodId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
interface Check {
|
|
||||||
id?: number,
|
|
||||||
goodsId: number,
|
|
||||||
name: string,
|
|
||||||
minPackagingUnit: string,
|
|
||||||
packagingUnit: string,
|
|
||||||
minPackagingNumber: number,
|
|
||||||
listSize: number,
|
|
||||||
trdnFlag: number,
|
|
||||||
childIdList: number[],
|
|
||||||
before: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
after: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
change: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
}
|
|
||||||
children: childCheck[],
|
|
||||||
selectList: seletcType[],
|
|
||||||
}
|
|
||||||
|
|
||||||
interface seletcType {
|
|
||||||
id: number,
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
productionBatchCode: string,
|
|
||||||
productionDate: string,
|
|
||||||
expiryDate: string,
|
|
||||||
purchaseUnitPrice: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface childCheck {
|
|
||||||
id?: number,
|
|
||||||
goodsId: number,
|
|
||||||
name: string,
|
|
||||||
minPackagingNumber: number,
|
|
||||||
before: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
after: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
change: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const list = ref<Check[]>([])
|
|
||||||
const emit = defineEmits(['close'])
|
|
||||||
onMounted(() => {
|
|
||||||
//addRow(1);
|
|
||||||
})
|
|
||||||
let setChange = function (row: any) {
|
|
||||||
let totalBefore = row.before.wholeNumber * row.minPackagingNumber + row.before.fragmentNumber; // 使用原始数据
|
|
||||||
let totalAfter = row.after.wholeNumber * row.minPackagingNumber + row.after.fragmentNumber; // 使用原始数据
|
|
||||||
console.log(totalBefore, totalAfter)
|
|
||||||
let diff = totalAfter - totalBefore;
|
|
||||||
|
|
||||||
row.change.wholeNumber = Math.trunc(diff / row.minPackagingNumber);
|
|
||||||
row.change.fragmentNumber = diff % row.minPackagingNumber
|
|
||||||
}
|
|
||||||
let addLine = (row: any) => {
|
|
||||||
post("inventory/goods/getListByIds", {idList: row.childIdList}).then((list: any) => {
|
|
||||||
let children = [];
|
|
||||||
for (let i = 0; i < list.length; i++) {
|
|
||||||
let inventoryGoods = list[i];
|
|
||||||
let index = row.children.findIndex((item: any) => item.id === inventoryGoods.id);
|
|
||||||
if (index > -1) {
|
|
||||||
children.push(row.children[index]);
|
|
||||||
} else {
|
|
||||||
let childCheck: childCheck = {
|
|
||||||
name: inventoryGoods.name,
|
|
||||||
id: inventoryGoods.id,
|
|
||||||
goodsId: inventoryGoods.goodId,
|
|
||||||
minPackagingNumber: row.minPackagingNumber,
|
|
||||||
before: {
|
|
||||||
wholeNumber: inventoryGoods.wholeNumber,
|
|
||||||
fragmentNumber: inventoryGoods.fragmentNumber,
|
|
||||||
},
|
|
||||||
after: {
|
|
||||||
wholeNumber: inventoryGoods.wholeNumber,
|
|
||||||
fragmentNumber: inventoryGoods.fragmentNumber,
|
|
||||||
},
|
|
||||||
change: {
|
|
||||||
wholeNumber: 0,
|
|
||||||
fragmentNumber: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
children.push(childCheck);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
row.children = children;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
let addRow = (goodsId: number) => {
|
|
||||||
post("inventory/goods/getByGoodsId", {goodsId}).then((res: any) => {
|
|
||||||
let check: Check = {
|
|
||||||
goodsId: res.id,
|
|
||||||
name: res.name,
|
|
||||||
listSize: res.listSize,
|
|
||||||
childIdList: [],
|
|
||||||
minPackagingNumber: res.minPackagingNumber,
|
|
||||||
packagingUnit: res.packagingUnit,
|
|
||||||
minPackagingUnit: res.minPackagingUnit,
|
|
||||||
trdnFlag: res.trdnFlag,
|
|
||||||
before: {
|
|
||||||
wholeNumber: res.wholeNumber,
|
|
||||||
fragmentNumber: res.fragmentNumber,
|
|
||||||
},
|
|
||||||
after: {
|
|
||||||
wholeNumber: res.wholeNumber,
|
|
||||||
fragmentNumber: res.fragmentNumber,
|
|
||||||
},
|
|
||||||
change: {
|
|
||||||
wholeNumber: 0,
|
|
||||||
fragmentNumber: 0,
|
|
||||||
},
|
|
||||||
children: [],
|
|
||||||
selectList: [],
|
|
||||||
}
|
|
||||||
let inventoryGoodsList = res.inventoryGoodsList
|
|
||||||
|
|
||||||
for (let i = 0; i < inventoryGoodsList.length; i++) {
|
|
||||||
let inventoryGoods = inventoryGoodsList[i];
|
|
||||||
let childCheck: seletcType = {
|
|
||||||
id: inventoryGoods.id,
|
|
||||||
wholeNumber: inventoryGoods.wholeNumber,
|
|
||||||
fragmentNumber: inventoryGoods.fragmentNumber,
|
|
||||||
productionBatchCode: inventoryGoods.productionBatchCode,
|
|
||||||
productionDate: inventoryGoods.productionDate,
|
|
||||||
expiryDate: inventoryGoods.expiryDate,
|
|
||||||
purchaseUnitPrice: inventoryGoods.purchaseUnitPrice,
|
|
||||||
}
|
|
||||||
check.selectList.push(childCheck)
|
|
||||||
}
|
|
||||||
list.value.push(check)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
let save = () => {
|
|
||||||
post("inventory/check/save", {list: list.value, remark: form.value.remark}).then((res: any) => {
|
|
||||||
emit('close');
|
|
||||||
})
|
|
||||||
// emit('close');
|
|
||||||
}
|
|
||||||
let exit = () => {
|
|
||||||
emit('close');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
@ -1,130 +1,226 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="body_wrapper">
|
<Mask :width="1200" :height="540" :is-show="isShow" :top="100" @close="exit" title="查看盘点" :show-footer="true">
|
||||||
<div class="top">
|
<div class="body_wrapper">
|
||||||
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">
|
<div class="top">
|
||||||
<el-form-item label="备注" style="width: 100%;margin-right: 0">
|
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">
|
||||||
<el-input disabled v-model="form.remark"></el-input>
|
<el-form-item label="备注" style="width: 100%;margin-right: 0">
|
||||||
</el-form-item>
|
<el-input disabled v-model="form.remark"></el-input>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
</div>
|
</el-form>
|
||||||
<div class="content">
|
</div>
|
||||||
<table class="simple-table" style="margin-top: 15px;">
|
<div class="content">
|
||||||
<thead>
|
<table class="simple-table" style="margin-top: 15px;">
|
||||||
<tr>
|
<thead>
|
||||||
<th>名称</th>
|
|
||||||
<th>批次</th>
|
|
||||||
<th>最小包装数量</th>
|
|
||||||
<th>库存</th>
|
|
||||||
<th>改后库存</th>
|
|
||||||
<th>变化量</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<template v-for="(item,index) in list">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ item.name }}</td>
|
<th>名称</th>
|
||||||
<td v-if="item.childIdList.length=0">无</td>
|
<th>批次</th>
|
||||||
<td v-else>
|
<th>最小包装数量</th>
|
||||||
<el-select
|
<th>库存</th>
|
||||||
v-model="item.childIdList"
|
<th>改后库存</th>
|
||||||
multiple
|
<th>变化量</th>
|
||||||
:teleported="false"
|
|
||||||
style="width: 150px;"
|
|
||||||
collapse-tags
|
|
||||||
popper-class="table-select"
|
|
||||||
:collapse-tags-tooltip="true"
|
|
||||||
>
|
|
||||||
<div class="select-header">
|
|
||||||
<span>批次ID</span>
|
|
||||||
<span>生产批号</span>
|
|
||||||
<span>入库时间</span>
|
|
||||||
<span>有效期</span>
|
|
||||||
<span>进价</span>
|
|
||||||
</div>
|
|
||||||
<el-option
|
|
||||||
v-for="(subItem,subIndex) in item.selectList"
|
|
||||||
:key="subItem.id"
|
|
||||||
:label="subItem.id"
|
|
||||||
:value="subItem.id"
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
<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>{{ item.minPackagingNumber }}</td>
|
|
||||||
<td>
|
|
||||||
{{ item.before.wholeNumber }}{{ item.packagingUnit }}
|
|
||||||
<template v-if="item.trdnFlag ==1">
|
|
||||||
{{ item.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
|
||||||
</template>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ item.after.wholeNumber }}{{ item.packagingUnit }}
|
|
||||||
<template v-if="item.trdnFlag ==1">
|
|
||||||
{{ item.after.fragmentNumber }}{{ item.minPackagingUnit }}
|
|
||||||
</template>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ item.change.wholeNumber }}{{ item.packagingUnit }}
|
|
||||||
<template v-if="item.trdnFlag ==1">
|
|
||||||
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
|
||||||
</template>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<template v-for="(subItem,subIndex) in item.children">
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<template v-for="(item,index) in list">
|
||||||
<tr>
|
<tr>
|
||||||
<td>-</td>
|
<td>{{ item.name }}</td>
|
||||||
<td>-</td>
|
<td v-if="item.childIdList.length=0">无</td>
|
||||||
<td>-</td>
|
<td v-else>
|
||||||
|
<el-select
|
||||||
|
v-model="item.childIdList"
|
||||||
|
multiple
|
||||||
|
:teleported="false"
|
||||||
|
style="width: 150px;"
|
||||||
|
collapse-tags
|
||||||
|
popper-class="table-select"
|
||||||
|
:collapse-tags-tooltip="true"
|
||||||
|
>
|
||||||
|
<div class="select-header">
|
||||||
|
<span>批次ID</span>
|
||||||
|
<span>生产批号</span>
|
||||||
|
<span>入库时间</span>
|
||||||
|
<span>有效期</span>
|
||||||
|
<span>进价</span>
|
||||||
|
</div>
|
||||||
|
<el-option
|
||||||
|
v-for="(subItem,subIndex) in item.selectList"
|
||||||
|
:key="subItem.id"
|
||||||
|
:label="subItem.id"
|
||||||
|
:value="subItem.id"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<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>{{ item.minPackagingNumber }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ subItem.before.wholeNumber }}{{ item.packagingUnit }}
|
{{ item.before.wholeNumber }}{{ item.packagingUnit }}
|
||||||
<template v-if="item.trdnFlag ==1">
|
<template v-if="item.trdnFlag ==1">
|
||||||
{{ subItem.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
{{ item.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ subItem.after.wholeNumber }}{{ item.packagingUnit }}
|
{{ item.after.wholeNumber }}{{ item.packagingUnit }}
|
||||||
<template v-if="item.trdnFlag ==1">
|
<template v-if="item.trdnFlag ==1">
|
||||||
{{ subItem.after.fragmentNumber }}{{ item.minPackagingUnit }}
|
{{ item.after.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ subItem.change.wholeNumber }}{{ item.packagingUnit }}
|
{{ item.change.wholeNumber }}{{ item.packagingUnit }}
|
||||||
<template v-if="item.trdnFlag ==1">
|
<template v-if="item.trdnFlag ==1">
|
||||||
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<template v-for="(subItem,subIndex) in item.children">
|
||||||
|
<tr>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>
|
||||||
|
{{ subItem.before.wholeNumber }}{{ item.packagingUnit }}
|
||||||
|
<template v-if="item.trdnFlag ==1">
|
||||||
|
{{ subItem.before.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ subItem.after.wholeNumber }}{{ item.packagingUnit }}
|
||||||
|
<template v-if="item.trdnFlag ==1">
|
||||||
|
{{ subItem.after.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ subItem.change.wholeNumber }}{{ item.packagingUnit }}
|
||||||
|
<template v-if="item.trdnFlag ==1">
|
||||||
|
{{ item.change.fragmentNumber }}{{ item.minPackagingUnit }}
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</tbody>
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<template #footer>
|
||||||
|
<div class="bottom">
|
||||||
|
<div class="btn">
|
||||||
|
<el-button @click="exit" type="primary">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</Mask>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="bottom">
|
|
||||||
<div class="btn">
|
|
||||||
<el-button @click="exit" type="primary">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {onMounted,defineProps} from "vue";
|
||||||
|
import {post} from "@/utils/request.ts";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import Mask from "@/components/common/Mask.vue";
|
||||||
|
const props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const form=ref<any>({
|
||||||
|
remark: "",
|
||||||
|
})
|
||||||
|
interface Check {
|
||||||
|
id?: number,
|
||||||
|
goodsId: number,
|
||||||
|
name: string,
|
||||||
|
minPackagingUnit: string,
|
||||||
|
packagingUnit: string,
|
||||||
|
minPackagingNumber: number,
|
||||||
|
listSize: number,
|
||||||
|
trdnFlag: number,
|
||||||
|
childIdList: number[],
|
||||||
|
before: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
after: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
change: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
}
|
||||||
|
children: childCheck[],
|
||||||
|
selectList: seletcType[],
|
||||||
|
}
|
||||||
|
|
||||||
|
interface seletcType {
|
||||||
|
id: number,
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
productionBatchCode: string,
|
||||||
|
productionDate: string,
|
||||||
|
expiryDate: string,
|
||||||
|
purchaseUnitPrice: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface childCheck {
|
||||||
|
id?: number,
|
||||||
|
goodsId: number,
|
||||||
|
name: string,
|
||||||
|
minPackagingNumber: number,
|
||||||
|
before: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
after: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
},
|
||||||
|
change: {
|
||||||
|
wholeNumber: number,
|
||||||
|
fragmentNumber: number,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = ref<Check[]>([])
|
||||||
|
const emit = defineEmits(['close'])
|
||||||
|
let exit = () => {
|
||||||
|
form.value = {
|
||||||
|
remark: ""
|
||||||
|
}
|
||||||
|
list.value=[]
|
||||||
|
isShow.value = false
|
||||||
|
emit('close');
|
||||||
|
}
|
||||||
|
const detail = (id: any) => {
|
||||||
|
isShow.value = true
|
||||||
|
post("inventory/check/getCheckDetail",{id}).then((res: any) => {
|
||||||
|
list.value = JSON.parse(res);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const isShow = ref(false)
|
||||||
|
defineExpose({detail})
|
||||||
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.body_wrapper {
|
.body_wrapper {
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
padding: 0 24px;
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -258,104 +354,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
height: 86px;
|
height: 100%;
|
||||||
width: 100%;
|
display: flex;
|
||||||
margin-top: 10px;
|
justify-content: flex-end;
|
||||||
position: absolute;
|
align-items: center;
|
||||||
right: 10px;
|
padding: 0 24px;
|
||||||
bottom: 0;
|
|
||||||
border-top: 1px solid #EAEAEC;
|
|
||||||
.btn{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script setup lang="ts">
|
|
||||||
import {onMounted,defineProps} from "vue";
|
|
||||||
import {post} from "@/utils/request.ts";
|
|
||||||
import {ref} from "vue";
|
|
||||||
const props = defineProps({
|
|
||||||
id: {
|
|
||||||
type: String,
|
|
||||||
default: null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const form=ref<any>({
|
|
||||||
remark: "",
|
|
||||||
})
|
|
||||||
interface Check {
|
|
||||||
id?: number,
|
|
||||||
goodsId: number,
|
|
||||||
name: string,
|
|
||||||
minPackagingUnit: string,
|
|
||||||
packagingUnit: string,
|
|
||||||
minPackagingNumber: number,
|
|
||||||
listSize: number,
|
|
||||||
trdnFlag: number,
|
|
||||||
childIdList: number[],
|
|
||||||
before: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
after: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
change: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
}
|
|
||||||
children: childCheck[],
|
|
||||||
selectList: seletcType[],
|
|
||||||
}
|
|
||||||
|
|
||||||
interface seletcType {
|
|
||||||
id: number,
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
productionBatchCode: string,
|
|
||||||
productionDate: string,
|
|
||||||
expiryDate: string,
|
|
||||||
purchaseUnitPrice: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface childCheck {
|
|
||||||
id?: number,
|
|
||||||
goodsId: number,
|
|
||||||
name: string,
|
|
||||||
minPackagingNumber: number,
|
|
||||||
before: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
after: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
},
|
|
||||||
change: {
|
|
||||||
wholeNumber: number,
|
|
||||||
fragmentNumber: number,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const list = ref<Check[]>([])
|
|
||||||
const emit = defineEmits(['close'])
|
|
||||||
onMounted(() => {
|
|
||||||
detail()
|
|
||||||
})
|
|
||||||
let exit = () => {
|
|
||||||
emit('close');
|
|
||||||
}
|
|
||||||
const detail = () => {
|
|
||||||
post("inventory/check/getCheckDetail",{id: props.id}).then((res: any) => {
|
|
||||||
list.value = JSON.parse(res);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({detail})
|
|
||||||
</script>
|
|
||||||
|
|
@ -1,71 +1,77 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="add-supplier" style="width:100%;margin-top: 24px">
|
<Mask :width="540" :height="603" :is-show="isShow" :top="100" @close="close" :title="id?'编辑':'添加供应商'" :show-footer="true">
|
||||||
<div class="form">
|
<div class="add-supplier" style="width:100%;margin-top: 24px;padding: 0 24px">
|
||||||
<el-form style="width: 100%" ref="ruleFormRef" :model="formData" :inline=true label-position="top">
|
<div class="form">
|
||||||
<el-form-item label="供货商名称" style="width: 100%;margin-right: 0">
|
<el-form style="width: 100%" ref="ruleFormRef" :model="formData" :inline=true label-position="top">
|
||||||
<el-input style="width: 100%" v-model="formData.name" placeholder="请输入供货商名称"></el-input>
|
<el-form-item label="供货商名称" style="width: 100%;margin-right: 0">
|
||||||
</el-form-item>
|
<el-input style="width: 100%" v-model="formData.name" placeholder="请输入供货商名称"></el-input>
|
||||||
<el-row style="width: 100%">
|
</el-form-item>
|
||||||
<el-col :span="12">
|
<el-row style="width: 100%">
|
||||||
<el-form-item label="启用状态">
|
<el-col :span="12">
|
||||||
<el-radio-group v-model="formData.turn" size="large">
|
<el-form-item label="启用状态">
|
||||||
<el-radio-button label="禁用" :value="0"/>
|
<el-radio-group v-model="formData.turn" size="large">
|
||||||
<el-radio-button label="启用" :value="1"/>
|
<el-radio-button label="禁用" :value="0"/>
|
||||||
</el-radio-group>
|
<el-radio-button label="启用" :value="1"/>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
<el-form-item label="许可证号" style="margin-right: 0">
|
<el-col :span="12">
|
||||||
<el-input v-model="formData.licenseCode" placeholder="请输入许可证号"></el-input>
|
<el-form-item label="许可证号" style="margin-right: 0">
|
||||||
</el-form-item>
|
<el-input v-model="formData.licenseCode" placeholder="请输入许可证号"></el-input>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
<el-row style="width: 100%">
|
</el-row>
|
||||||
<el-col :span="12">
|
<el-row style="width: 100%">
|
||||||
<el-form-item label="联系人">
|
<el-col :span="12">
|
||||||
<el-input v-model="formData.contactName" placeholder="请输入联系人名称"></el-input>
|
<el-form-item label="联系人">
|
||||||
</el-form-item>
|
<el-input v-model="formData.contactName" placeholder="请输入联系人名称"></el-input>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
<el-form-item label="联系方式" style="margin-right: 0">
|
<el-col :span="12">
|
||||||
<el-input v-model="formData.contactTel" placeholder="请输入联系方式"></el-input>
|
<el-form-item label="联系方式" style="margin-right: 0">
|
||||||
</el-form-item>
|
<el-input v-model="formData.contactTel" placeholder="请输入联系方式"></el-input>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
<el-form-item label="备注" style="margin-right: 0;width: 100%">
|
</el-row>
|
||||||
<el-input v-model="formData.reamark"
|
<el-form-item label="备注" style="margin-right: 0;width: 100%">
|
||||||
type="textarea" rows="5"
|
<el-input v-model="formData.reamark"
|
||||||
max="200"
|
type="textarea" rows="5"
|
||||||
show-word-limit
|
max="200"
|
||||||
placeholder="请输入备注"
|
show-word-limit
|
||||||
style="width: 100%"
|
placeholder="请输入备注"
|
||||||
>
|
style="width: 100%"
|
||||||
</el-input>
|
>
|
||||||
</el-form-item>
|
</el-input>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<template #footer>
|
||||||
<div class="btn">
|
<div class="bottom">
|
||||||
<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>
|
||||||
|
</Mask>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import CloseBtn from "@/components/CloseBtn.vue";
|
import CloseBtn from "@/components/CloseBtn.vue";
|
||||||
|
import Mask from "@/components/common/Mask.vue";
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
name: null,
|
name: null,
|
||||||
turn: 1,
|
turn: 0,
|
||||||
contactName: null,
|
contactName: null,
|
||||||
contactTel: null,
|
contactTel: null,
|
||||||
reamark: null,
|
reamark: null,
|
||||||
licenseCode: null,
|
licenseCode: null,
|
||||||
})
|
})
|
||||||
const errorMsg = ref('')
|
const errorMsg = ref('')
|
||||||
const emit = defineEmits(['close', 'saveSuccess'])
|
const isShow = ref(false)
|
||||||
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
if (formData.value.name === '' || formData.value.name === null) {
|
if (formData.value.name === '' || formData.value.name === null) {
|
||||||
|
|
@ -73,15 +79,19 @@ const save = () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
post("inventory/supplier/save", {inventorySupplier: formData.value}).then((res: any) => {
|
post("inventory/supplier/save", {inventorySupplier: formData.value}).then((res: any) => {
|
||||||
emit('saveSuccess')
|
|
||||||
close()
|
close()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const id = ref<any>(null)
|
||||||
const edit = (supplierData: any) => {
|
const editInit = (supplierData: any) => {
|
||||||
|
isShow.value = true
|
||||||
|
id.value = supplierData.id
|
||||||
formData.value = supplierData
|
formData.value = supplierData
|
||||||
}
|
}
|
||||||
defineExpose({edit})
|
const addInit = () => {
|
||||||
|
isShow.value = true
|
||||||
|
}
|
||||||
|
defineExpose({addInit, editInit})
|
||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
|
|
@ -93,14 +103,19 @@ const close = () => {
|
||||||
licenseCode: null,
|
licenseCode: null,
|
||||||
}
|
}
|
||||||
errorMsg.value = ''
|
errorMsg.value = ''
|
||||||
|
isShow.value = false
|
||||||
|
id.value = null
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.btn {
|
.bottom {
|
||||||
position: absolute;
|
height: 100%;
|
||||||
right: 10px;
|
display: flex;
|
||||||
bottom: 10px;
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 24px;
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<el-button type="primary" :icon="Plus" @click="is_add = true">新增领用</el-button>
|
<el-button type="primary" :icon="Plus" @click="clickApply">新增领用</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<el-table :data="dataList" style="width: 100%" @row-click="rowClick">
|
<el-table :data="dataList" style="width: 100%" @row-click="rowClick">
|
||||||
|
|
@ -28,33 +28,29 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Mask :width="1200" :height="600" :top="100" :is-show="is_add" @close="is_add=false" title="新增领用">
|
<AddApply ref="addApplyRef" @close="closeAddApply"/>
|
||||||
<AddApply @close="closeAddApply"/>
|
<DetailApply ref="detailApplyRef" @close="closeDetailApply"/>
|
||||||
</Mask>
|
|
||||||
<Mask :width="1200" :height="600" :top="100" :is-show="is_detail" @close="is_detail=false" title="查看领用">
|
|
||||||
<DetailApply :id="id" @close="closeDetailApply"/>
|
|
||||||
</Mask>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Mask from "@/components/common/Mask.vue";
|
import Mask from "@/components/common/Mask.vue";
|
||||||
import AddApply from "@/components/inventory/apply/AddApply.vue";
|
import AddApply from "@/components/inventory/apply/AddApply.vue";
|
||||||
import {onMounted, ref} from "vue";
|
import {nextTick, onMounted, ref} from "vue";
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import DetailApply from "@/components/inventory/apply/DetailApply.vue";
|
import DetailApply from "@/components/inventory/apply/DetailApply.vue";
|
||||||
import {Plus} from "@element-plus/icons-vue";
|
import {Plus} from "@element-plus/icons-vue";
|
||||||
|
|
||||||
const is_add = ref(false)
|
const is_add = ref(false)
|
||||||
const is_detail = ref(false)
|
const is_detail = ref(false)
|
||||||
const id = ref('')
|
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
const query = {
|
const query = {
|
||||||
pageNum: 1,
|
pageNum: page.value,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
}
|
}
|
||||||
post("inventory/apply/list", {query: query}).then((res: any) => {
|
post("inventory/apply/list", {query: query}).then((res: any) => {
|
||||||
dataList.value = res.list
|
dataList.value = res.list
|
||||||
|
total.value = res.total_count
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
@ -66,14 +62,7 @@ let total = ref(0)
|
||||||
let page = ref(1)
|
let page = ref(1)
|
||||||
let changePage = (value: number) => {
|
let changePage = (value: number) => {
|
||||||
page.value = value
|
page.value = value
|
||||||
const query = {
|
getList()
|
||||||
pageNum: value,
|
|
||||||
pageSize: pageSize.value,
|
|
||||||
}
|
|
||||||
post("inventory/apply/list", {query: query}).then((res: any) => {
|
|
||||||
dataList.value = res.list
|
|
||||||
total.value = res.total_count
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const closeAddApply = () => {
|
const closeAddApply = () => {
|
||||||
is_add.value = false
|
is_add.value = false
|
||||||
|
|
@ -87,14 +76,23 @@ const formatDate = (isoStr: any) => {
|
||||||
const date = new Date(isoStr);
|
const date = new Date(isoStr);
|
||||||
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
||||||
}
|
}
|
||||||
|
const detailApplyRef = ref()
|
||||||
const rowClick = (row: any) => {
|
const rowClick = (row: any) => {
|
||||||
id.value = row.id
|
nextTick(()=>{
|
||||||
is_detail.value = true
|
detailApplyRef.value?.init(row.id)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const addApplyRef = ref()
|
||||||
|
const clickApply = () => {
|
||||||
|
nextTick(() => {
|
||||||
|
addApplyRef.value?.getUserInfo()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "@/assets/scss/base.scss";
|
@use "@/assets/scss/base.scss";
|
||||||
|
|
||||||
.container-wrapper {
|
.container-wrapper {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
|
|
@ -102,12 +100,14 @@ const rowClick = (row: any) => {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-top: base.$margin-base;
|
margin-top: base.$margin-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,19 @@
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="content_list">
|
<div class="content_list">
|
||||||
<el-table :data="tableData" @cell-click="editCheck">
|
<el-scrollbar>
|
||||||
<el-table-column label="订单号" prop="code" width="250">
|
<el-table :data="tableData" @cell-click="editCheck">
|
||||||
</el-table-column>
|
<el-table-column label="订单号" prop="code" width="250">
|
||||||
<el-table-column label="状态" prop="state" width="250"></el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" prop="createDatetime" width="250">
|
<el-table-column label="状态" prop="state" width="250"></el-table-column>
|
||||||
<template #default="scope">
|
<el-table-column label="创建时间" prop="createDatetime" width="250">
|
||||||
{{ formatDate(scope.row.createDatetime) }}
|
<template #default="scope">
|
||||||
</template>
|
{{ formatDate(scope.row.createDatetime) }}
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="page_btn_list">
|
<div class="page_btn_list">
|
||||||
|
|
@ -31,15 +33,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Mask :width="1200" :height="540" :is-show="showAdd" :top="100" @close="showAdd = false" title="新增盘点">
|
<Add ref="addRef" @close="getCheck()"/>
|
||||||
<Add @close="showAdd = false;getCheck()"/>
|
<Detail ref="detailRef" @close="getCheck()"/>
|
||||||
</Mask>
|
|
||||||
<Mask :width="1200" :height="540" :is-show="showDetail" :top="100" @close="showDetail = false" title="查看盘点">
|
|
||||||
<Detail :id="id" @close="showDetail = false;getCheck()"/>
|
|
||||||
</Mask>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {onMounted, ref} from "vue";
|
import {nextTick, onMounted, ref} from "vue";
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import Mask from "@/components/common/Mask.vue";
|
import Mask from "@/components/common/Mask.vue";
|
||||||
import Add from "@/components/inventory/check/Add.vue";
|
import Add from "@/components/inventory/check/Add.vue";
|
||||||
|
|
@ -49,12 +47,13 @@ import {Plus} from "@element-plus/icons-vue";
|
||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
const getCheck = () => {
|
const getCheck = () => {
|
||||||
const query = {
|
const query = {
|
||||||
pageNum: 1,
|
pageNum: page.value,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
}
|
}
|
||||||
post("inventory/check/list", {query: query}).then(
|
post("inventory/check/list", {query: query}).then(
|
||||||
(res: any) => {
|
(res: any) => {
|
||||||
tableData.value = res.list
|
tableData.value = res.list
|
||||||
|
total.value = res.total_count
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -62,12 +61,17 @@ const detailCheckRef = ref<any>('');
|
||||||
const showAdd = ref(false)
|
const showAdd = ref(false)
|
||||||
const showDetail = ref(false)
|
const showDetail = ref(false)
|
||||||
const id = ref('')
|
const id = ref('')
|
||||||
|
const addRef = ref<any>('');
|
||||||
const openAdd = () => {
|
const openAdd = () => {
|
||||||
showAdd.value = true
|
nextTick(() => {
|
||||||
|
addRef.value?.init()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
const detailRef = ref<any>('');
|
||||||
const editCheck = (row: any) => {
|
const editCheck = (row: any) => {
|
||||||
id.value = row.id
|
nextTick(() => {
|
||||||
showDetail.value = true
|
detailRef.value?.detail(row.id)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
@ -79,14 +83,7 @@ let total = ref(0)
|
||||||
let page = ref(1)
|
let page = ref(1)
|
||||||
let changePage = (value: number) => {
|
let changePage = (value: number) => {
|
||||||
page.value = value
|
page.value = value
|
||||||
const query = {
|
getCheck()
|
||||||
pageNum: value,
|
|
||||||
pageSize: pageSize.value,
|
|
||||||
}
|
|
||||||
post("goods/goods/searchDetail", {query: query}).then((res: any) => {
|
|
||||||
tableData.value = res.list
|
|
||||||
total.value = res.total_count
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 转成YYYY-MM-DD格式
|
// 转成YYYY-MM-DD格式
|
||||||
const formatDate = (isoStr: any) => {
|
const formatDate = (isoStr: any) => {
|
||||||
|
|
@ -105,8 +102,8 @@ const formatDate = (isoStr: any) => {
|
||||||
|
|
||||||
.content_list {
|
.content_list {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
|
||||||
margin-top: base.$margin-base;
|
margin-top: base.$margin-base;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
|
|
|
||||||
|
|
@ -6,33 +6,35 @@
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="content_list">
|
<div class="content_list">
|
||||||
<el-table :data="tableData" style="width: 100%" @row-click="open_edit">
|
<el-scrollbar>
|
||||||
<el-table-column fixed label="进货单号" width="250" show-overflow-tooltip>
|
<el-table :data="tableData" style="width: 100%" @row-click="open_edit">
|
||||||
<template #default="scope">
|
<el-table-column fixed label="进货单号" width="250" show-overflow-tooltip>
|
||||||
<div class="link">{{ scope.row.code }}</div>
|
<template #default="scope">
|
||||||
</template>
|
<div class="link">{{ scope.row.code }}</div>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column label="品种" prop="kindCount" width="100">
|
</el-table-column>
|
||||||
|
<el-table-column label="品种" prop="kindCount" width="100">
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="入库金额" width="100">
|
<el-table-column label="入库金额" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
¥{{ scope.row.totalPrice.toFixed(2) }}
|
¥{{ scope.row.totalPrice.toFixed(2) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="采购人" prop="managerUserName" width="100"></el-table-column>
|
<el-table-column label="采购人" prop="managerUserName" width="100"></el-table-column>
|
||||||
<el-table-column label="供应商" prop="supplierName"></el-table-column>
|
<el-table-column label="供应商" prop="supplierName"></el-table-column>
|
||||||
<el-table-column prop="purchaseDate" label="采购时间">
|
<el-table-column prop="purchaseDate" label="采购时间">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatDate(scope.row.purchaseDate) }}
|
{{ formatDate(scope.row.purchaseDate) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createDatetime" label="创建时间">
|
<el-table-column prop="createDatetime" label="创建时间">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatDate(scope.row.createDatetime) }}
|
{{ formatDate(scope.row.createDatetime) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="page_btn_list">
|
<div class="page_btn_list">
|
||||||
|
|
@ -83,11 +85,12 @@ let open_edit = (row: any) => {
|
||||||
|
|
||||||
let init = () => {
|
let init = () => {
|
||||||
const query = {
|
const query = {
|
||||||
page: 1,
|
page: page.value,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
}
|
}
|
||||||
post("inventory/order/list", {query: query}).then((res: any) => {
|
post("inventory/order/list", {query: query}).then((res: any) => {
|
||||||
tableData.value = res.list
|
tableData.value = res.list
|
||||||
|
total.value = res.total_count
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -105,14 +108,7 @@ let total = ref(0)
|
||||||
let page = ref(1)
|
let page = ref(1)
|
||||||
let changePage = (value: number) => {
|
let changePage = (value: number) => {
|
||||||
page.value = value
|
page.value = value
|
||||||
const query = {
|
init()
|
||||||
pageNum: value,
|
|
||||||
pageSize: pageSize.value,
|
|
||||||
}
|
|
||||||
post("goods/goods/searchDetail", {query: query}).then((res: any) => {
|
|
||||||
tableData.value = res.list
|
|
||||||
total.value = res.total_count
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 转成YYYY-MM-DD格式
|
// 转成YYYY-MM-DD格式
|
||||||
const formatDate = (isoStr: any) => {
|
const formatDate = (isoStr: any) => {
|
||||||
|
|
|
||||||
|
|
@ -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="openAdd">添加供应商</el-button>
|
<el-button type="primary" :icon="Plus" @click="addSupplier(null)">添加供应商</el-button>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="content_list">
|
<div class="content_list">
|
||||||
|
|
@ -33,9 +33,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Mask :width="540" :height="603" :is-show="showAdd" :top="100" @close="showAdd = false" :title="id?'编辑':'添加供应商'">
|
<AddSupplier ref="addSupplierRef" @close="getSupplier()"></AddSupplier>
|
||||||
<AddSupplier @close="showAdd = false" @saveSuccess="getSupplier()" ref="addSupplierRef"></AddSupplier>
|
|
||||||
</Mask>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
@ -48,29 +46,28 @@ import {Plus} from "@element-plus/icons-vue";
|
||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
const getSupplier = () => {
|
const getSupplier = () => {
|
||||||
const query = {
|
const query = {
|
||||||
page: 1,
|
page: page.value,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
}
|
}
|
||||||
post("inventory/supplier/list", {query: query}, null).then(
|
post("inventory/supplier/list", {query: query}, null).then(
|
||||||
(res: any) => {
|
(res: any) => {
|
||||||
tableData.value = res.list
|
tableData.value = res.list
|
||||||
|
total.value = res.total_count
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const addSupplierRef = ref();
|
const addSupplierRef = ref();
|
||||||
|
|
||||||
const openAdd = () => {
|
|
||||||
showAdd.value = true
|
|
||||||
}
|
|
||||||
const id = ref('')
|
|
||||||
const editSupplier = (row: any) => {
|
const editSupplier = (row: any) => {
|
||||||
id.value = row.id
|
|
||||||
openAdd()
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
addSupplierRef.value.edit(row)
|
addSupplierRef.value.editInit(row)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const addSupplier = (row: any) => {
|
||||||
|
nextTick(() => {
|
||||||
|
addSupplierRef.value.addInit()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const showAdd = ref(false)
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSupplier()
|
getSupplier()
|
||||||
})
|
})
|
||||||
|
|
@ -80,14 +77,7 @@ let total = ref(0)
|
||||||
let page = ref(1)
|
let page = ref(1)
|
||||||
let changePage = (value: number) => {
|
let changePage = (value: number) => {
|
||||||
page.value = value
|
page.value = value
|
||||||
const query = {
|
getSupplier()
|
||||||
pageNum: value,
|
|
||||||
pageSize: pageSize.value,
|
|
||||||
}
|
|
||||||
post("goods/goods/searchDetail", {query: query}).then((res: any) => {
|
|
||||||
tableData.value = res.list
|
|
||||||
total.value = res.total_count
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue