|
|
|
|
@ -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="请输入出库数量"
|
|
|
|
|
@ -352,7 +359,7 @@ import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo';
|
|
|
|
|
import { getWmsWarehouseInfoList } from '@/api/wms/warehouseInfo';
|
|
|
|
|
import WmsInventorySelect from '@/components/WmsInventorySelect/index.vue';
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
import { getWmsOutStockDetailsList } from '@/api/wms/outStockDetails';
|
|
|
|
|
import { countUnOutStockDetails, getWmsOutStockDetailsList } from '@/api/wms/outStockDetails';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const { wms_out_bill_status, out_stock_type, flow_status } = toRefs<any>(proxy?.useDict('wms_out_bill_status', 'out_stock_type', 'flow_status'));
|
|
|
|
|
@ -555,6 +562,7 @@ const getList = async () => {
|
|
|
|
|
outStockBillList.value = res.rows;
|
|
|
|
|
total.value = res.total;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
closeChildTable();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 取消按钮 */
|
|
|
|
|
@ -610,6 +618,19 @@ const handleUpdate = async (row?: OutStockBillVO) => {
|
|
|
|
|
Object.assign(form.value, res.data);
|
|
|
|
|
const chiildRes = await getWmsOutStockDetailsList({ outStockBillId: _outStockBillId });
|
|
|
|
|
selectInventorys.value = chiildRes.data || [];
|
|
|
|
|
// 查询锁定库存数量
|
|
|
|
|
for (const item of selectInventorys.value) {
|
|
|
|
|
try {
|
|
|
|
|
const lockRes = await countUnOutStockDetails({
|
|
|
|
|
inventoryDetailsId: item.inventoryDetailsId,
|
|
|
|
|
outStockDetailsId: item.outStockDetailsId
|
|
|
|
|
});
|
|
|
|
|
item.lockedAmount = lockRes.data.outStockAmount || 0;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('查询锁定库存失败:', error);
|
|
|
|
|
item.lockedAmount = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dialog.visible = true;
|
|
|
|
|
dialog.title = '修改出库单';
|
|
|
|
|
};
|
|
|
|
|
@ -635,6 +656,7 @@ const submitAddProjectForm = () => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
await updateOutStockBillProject({
|
|
|
|
|
outStockBillId: form.value.outStockBillId,
|
|
|
|
|
outStockBillStatus: form.value.outStockBillStatus,
|
|
|
|
|
projectId: form.value.projectId
|
|
|
|
|
}).finally(() => (buttonLoading.value = false));
|
|
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
|
|
@ -695,7 +717,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 +725,7 @@ const handleDelete = async (row?: OutStockBillVO) => {
|
|
|
|
|
/** 发货操作 */
|
|
|
|
|
const handleDeliver = async (row?: OutStockBillVO) => {
|
|
|
|
|
if (row.outStockBillStatus !== '0') {
|
|
|
|
|
ElMessage.warning('不符合发货条件');
|
|
|
|
|
ElMessage.warning('不符合出库条件');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
@ -728,7 +750,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();
|
|
|
|
|
// 初始化下拉框数据
|
|
|
|
|
|