|
@@ -39,7 +39,7 @@
|
|
|
>添加明细</el-button
|
|
|
>
|
|
|
<el-table
|
|
|
- :data="formData.data.list"
|
|
|
+ :data="formData.data.stockTransferDetailsList"
|
|
|
style="width: 100%; margin-top: 16px"
|
|
|
>
|
|
|
<el-table-column
|
|
@@ -62,12 +62,14 @@
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item
|
|
|
- :prop="'list.' + $index + '.quantity'"
|
|
|
- :rules="rules.quantity"
|
|
|
+ :prop="
|
|
|
+ 'stockTransferDetailsList.' + $index + '.outQuantity'
|
|
|
+ "
|
|
|
+ :rules="rules.outQuantity"
|
|
|
:inline-message="true"
|
|
|
>
|
|
|
<el-input-number
|
|
|
- v-model="row.quantity"
|
|
|
+ v-model="row.outQuantity"
|
|
|
placeholder="请输入数量"
|
|
|
style="width: 100%"
|
|
|
:precision="0"
|
|
@@ -132,8 +134,8 @@ const sourceList = ref({
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
- warehouseId: "",
|
|
|
- toWarehouseId: "",
|
|
|
+ outWarehouseId: "",
|
|
|
+ inWarehouseId: "",
|
|
|
type: "3,11",
|
|
|
},
|
|
|
});
|
|
@@ -142,12 +144,12 @@ const selectConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
label: "调出仓库",
|
|
|
- prop: "warehouseId",
|
|
|
+ prop: "outWarehouseId",
|
|
|
data: warehouseList.value,
|
|
|
},
|
|
|
{
|
|
|
label: "调入仓库",
|
|
|
- prop: "toWarehouseId",
|
|
|
+ prop: "inWarehouseId",
|
|
|
data: warehouseList.value,
|
|
|
},
|
|
|
];
|
|
@@ -164,7 +166,7 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "调出仓库",
|
|
|
- prop: "warehouseName",
|
|
|
+ prop: "outWarehouseName",
|
|
|
width: 220,
|
|
|
},
|
|
|
// render(type) {
|
|
@@ -174,7 +176,7 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "调入仓库",
|
|
|
- prop: "toWarehouseName",
|
|
|
+ prop: "inWarehouseName",
|
|
|
width: 220,
|
|
|
},
|
|
|
// render(type) {
|
|
@@ -212,7 +214,7 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "调仓数量",
|
|
|
- prop: "quantity",
|
|
|
+ prop: "outQuantity",
|
|
|
width: 140,
|
|
|
},
|
|
|
},
|
|
@@ -248,7 +250,7 @@ const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
proxy
|
|
|
- .post("/stockJournalDetails/page", sourceList.value.pagination)
|
|
|
+ .post("stockTransferDetails/page", sourceList.value.pagination)
|
|
|
.then((res) => {
|
|
|
sourceList.value.data = res.rows;
|
|
|
sourceList.value.pagination.total = res.total;
|
|
@@ -279,7 +281,7 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "warehouseId",
|
|
|
+ prop: "outWarehouseId",
|
|
|
label: "调出仓库",
|
|
|
required: true,
|
|
|
data: warehouseList.value,
|
|
@@ -287,7 +289,7 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "toWarehouseId",
|
|
|
+ prop: "inWarehouseId",
|
|
|
label: "调入仓库",
|
|
|
required: true,
|
|
|
data: warehouseList.value,
|
|
@@ -307,36 +309,37 @@ const formConfig = computed(() => {
|
|
|
];
|
|
|
});
|
|
|
const rules = ref({
|
|
|
- warehouseId: [
|
|
|
+ outWarehouseId: [
|
|
|
{ required: true, message: "请选择调出仓库", trigger: "change" },
|
|
|
],
|
|
|
- toWarehouseId: [
|
|
|
+ inWarehouseId: [
|
|
|
{ required: true, message: "请选择调入仓库", trigger: "change" },
|
|
|
],
|
|
|
- quantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
|
|
|
+ outQuantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
|
|
|
});
|
|
|
const openModal = () => {
|
|
|
formData.data = {
|
|
|
type: "1",
|
|
|
- list: [],
|
|
|
+ stockTransferDetailsList: [],
|
|
|
};
|
|
|
loadingDialog.value = false;
|
|
|
dialogVisible.value = true;
|
|
|
};
|
|
|
const pushGoods = (goods) => {
|
|
|
if (goods && goods.length > 0) {
|
|
|
- formData.data.list = formData.data.list.concat(
|
|
|
- goods.map((item) => {
|
|
|
- return {
|
|
|
- productCode: item.code,
|
|
|
- productId: item.id,
|
|
|
- productName: item.name,
|
|
|
- productSpec: item.spec,
|
|
|
- productUnit: item.unit,
|
|
|
- quantity: undefined,
|
|
|
- };
|
|
|
- })
|
|
|
- );
|
|
|
+ formData.data.stockTransferDetailsList =
|
|
|
+ formData.data.stockTransferDetailsList.concat(
|
|
|
+ goods.map((item) => {
|
|
|
+ return {
|
|
|
+ productCode: item.code,
|
|
|
+ productId: item.id,
|
|
|
+ productName: item.name,
|
|
|
+ productSpec: item.spec,
|
|
|
+ productUnit: item.unit,
|
|
|
+ outQuantity: undefined,
|
|
|
+ };
|
|
|
+ })
|
|
|
+ );
|
|
|
ElMessage({
|
|
|
message: "添加成功!",
|
|
|
type: "success",
|
|
@@ -348,19 +351,19 @@ const pushGoods = (goods) => {
|
|
|
};
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
|
- if (formData.data.warehouseId === formData.data.toWarehouseId)
|
|
|
+ if (formData.data.outWarehouseId === formData.data.inWarehouseId)
|
|
|
return ElMessage({
|
|
|
message: "调出仓库和调入仓库不可一致!",
|
|
|
type: "info",
|
|
|
});
|
|
|
|
|
|
- if (!formData.data.list.length > 0)
|
|
|
+ if (!formData.data.stockTransferDetailsList.length > 0)
|
|
|
return ElMessage({
|
|
|
message: "请添加调仓明细",
|
|
|
type: "info",
|
|
|
});
|
|
|
loadingDialog.value = true;
|
|
|
- proxy.post("/stock/stockTransfer", formData.data).then(
|
|
|
+ proxy.post("/stockTransfer/addSt", formData.data).then(
|
|
|
() => {
|
|
|
ElMessage({
|
|
|
message: "提交成功",
|
|
@@ -377,7 +380,7 @@ const submitForm = () => {
|
|
|
});
|
|
|
};
|
|
|
const handleDelete = (index) => {
|
|
|
- formData.data.list.splice(index, 1);
|
|
|
+ formData.data.stockTransferDetailsList.splice(index, 1);
|
|
|
};
|
|
|
</script>
|
|
|
|