|
|
|
|
@ -81,7 +81,9 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 出库单表格 -->
|
|
|
|
|
<el-table
|
|
|
|
|
ref="outStockTableRef"
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
border
|
|
|
|
|
:data="outStockBillList"
|
|
|
|
|
@ -267,6 +269,11 @@
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="productName" />
|
|
|
|
|
<!--<el-table-column label="单价" align="center" prop="unitPrice" width="80" />-->
|
|
|
|
|
<el-table-column label="当前库存" align="center" prop="inventoryAmount" width="90" />
|
|
|
|
|
<el-table-column label="锁定库存" align="center" width="90">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ scope.row.lockedAmount || 0 }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="出库数量" align="center" prop="outStockAmount" width="140">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input-number
|
|
|
|
|
@ -274,7 +281,7 @@
|
|
|
|
|
:min="0"
|
|
|
|
|
:precision="2"
|
|
|
|
|
:step="1"
|
|
|
|
|
:max="scope.row.inventoryAmount"
|
|
|
|
|
:max="scope.row.inventoryAmount - scope.row.lockedAmount"
|
|
|
|
|
controls-position="right"
|
|
|
|
|
size="small"
|
|
|
|
|
placeholder="请输入出库数量"
|
|
|
|
|
@ -555,6 +562,7 @@ const getList = async () => {
|
|
|
|
|
outStockBillList.value = res.rows;
|
|
|
|
|
total.value = res.total;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
closeChildTable();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 取消按钮 */
|
|
|
|
|
@ -695,7 +703,7 @@ const handleDelete = async (row?: OutStockBillVO) => {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const _outStockBillIds = row?.outStockBillId || ids.value;
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除出库单编号为"' + _outStockBillIds + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除出库单编号为"' + row?.outStockCode + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
await delOutStockBill(_outStockBillIds);
|
|
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
await getList();
|
|
|
|
|
@ -703,7 +711,7 @@ const handleDelete = async (row?: OutStockBillVO) => {
|
|
|
|
|
/** 发货操作 */
|
|
|
|
|
const handleDeliver = async (row?: OutStockBillVO) => {
|
|
|
|
|
if (row.outStockBillStatus !== '0') {
|
|
|
|
|
ElMessage.warning('不符合发货条件');
|
|
|
|
|
ElMessage.warning('不符合出库条件');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
@ -728,7 +736,16 @@ const handleExport = () => {
|
|
|
|
|
`outStockBill_${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 添加表格引用
|
|
|
|
|
const outStockTableRef = ref();
|
|
|
|
|
// 关闭所有展开的子表
|
|
|
|
|
const closeChildTable = () => {
|
|
|
|
|
if (outStockTableRef.value) {
|
|
|
|
|
outStockTableRef.value.store.states.expandRows.value.forEach((row) => {
|
|
|
|
|
outStockTableRef.value.toggleRowExpansion(row, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getList();
|
|
|
|
|
// 初始化下拉框数据
|
|
|
|
|
|