|
@@ -14,32 +14,80 @@
|
|
|
action: () => openModal(),
|
|
|
},
|
|
|
]"
|
|
|
- @get-list="getList">
|
|
|
+ @get-list="getList"
|
|
|
+ >
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog title="新增调仓" v-if="dialogVisible" v-model="dialogVisible" width="1000" v-loading="loadingDialog">
|
|
|
- <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
+ <el-dialog
|
|
|
+ title="新增调仓"
|
|
|
+ v-if="dialogVisible"
|
|
|
+ v-model="dialogVisible"
|
|
|
+ width="1000"
|
|
|
+ v-loading="loadingDialog"
|
|
|
+ >
|
|
|
+ <byForm
|
|
|
+ :formConfig="formConfig"
|
|
|
+ :formOption="formOption"
|
|
|
+ v-model="formData.data"
|
|
|
+ :rules="rules"
|
|
|
+ ref="submit"
|
|
|
+ >
|
|
|
<template #details>
|
|
|
<div style="width: 100%">
|
|
|
- <el-button type="primary" @click="openProduct = true">添加明细</el-button>
|
|
|
- <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
|
|
|
- <el-table-column prop="productCode" label="产品编码" width="140" />
|
|
|
- <el-table-column prop="productName" label="产品名称" min-width="220" />
|
|
|
- <el-table-column prop="productSpec" label="规格型号" min-width="220" />
|
|
|
- <el-table-column prop="productUnit" label="单位" width="100" />
|
|
|
- <el-table-column label="入库数量" width="160">
|
|
|
+ <el-button type="primary" @click="openProduct = true"
|
|
|
+ >添加明细</el-button
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ :data="formData.data.list"
|
|
|
+ style="width: 100%; margin-top: 16px"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="productCode"
|
|
|
+ label="物品编码"
|
|
|
+ width="140"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="productName"
|
|
|
+ label="物品名称"
|
|
|
+ min-width="220"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="productSpec"
|
|
|
+ label="规格型号"
|
|
|
+ min-width="220"
|
|
|
+ />
|
|
|
+ <!-- <el-table-column prop="productUnit" label="单位" width="100" /> -->
|
|
|
+ <el-table-column label="调仓数量" width="160">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
|
|
|
- <el-input-number v-model="row.quantity" placeholder="请输入数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
|
|
|
+ <el-form-item
|
|
|
+ :prop="'list.' + $index + '.quantity'"
|
|
|
+ :rules="rules.quantity"
|
|
|
+ :inline-message="true"
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ v-model="row.quantity"
|
|
|
+ placeholder="请输入数量"
|
|
|
+ style="width: 100%"
|
|
|
+ :precision="0"
|
|
|
+ :controls="false"
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="操作" width="80" fixed="right">
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="操作"
|
|
|
+ width="80"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
|
|
|
+ <el-button type="primary" link @click="handleDelete($index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -48,12 +96,22 @@
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog v-model="openProduct" title="选择商品" width="70%" append-to-body>
|
|
|
- <SelectGoods @cancel="openProduct = false" @pushGoods="pushGoods"></SelectGoods>
|
|
|
+ <el-dialog
|
|
|
+ v-model="openProduct"
|
|
|
+ title="选择商品"
|
|
|
+ width="70%"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <SelectGoods
|
|
|
+ @cancel="openProduct = false"
|
|
|
+ @pushGoods="pushGoods"
|
|
|
+ ></SelectGoods>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -115,7 +173,7 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "调出仓库",
|
|
|
+ label: "调入仓库",
|
|
|
prop: "toWarehouseName",
|
|
|
width: 220,
|
|
|
},
|
|
@@ -189,13 +247,15 @@ const getDict = () => {
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
- proxy.post("/stockJournalDetails/page", sourceList.value.pagination).then((res) => {
|
|
|
- sourceList.value.data = res.rows;
|
|
|
- sourceList.value.pagination.total = res.total;
|
|
|
- setTimeout(() => {
|
|
|
- loading.value = false;
|
|
|
- }, 200);
|
|
|
- });
|
|
|
+ proxy
|
|
|
+ .post("/stockJournalDetails/page", sourceList.value.pagination)
|
|
|
+ .then((res) => {
|
|
|
+ sourceList.value.data = res.rows;
|
|
|
+ sourceList.value.pagination.total = res.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
};
|
|
|
getDict();
|
|
|
getList();
|
|
@@ -215,7 +275,7 @@ const formData = reactive({
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
- label: "基本信息",
|
|
|
+ label: "调仓信息",
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
@@ -236,18 +296,24 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "remark",
|
|
|
- label: "调仓说明",
|
|
|
+ label: "调拨说明",
|
|
|
itemType: "textarea",
|
|
|
},
|
|
|
{
|
|
|
type: "slot",
|
|
|
slotName: "details",
|
|
|
- label: "入库明细",
|
|
|
+ label: "调仓明细",
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
const rules = ref({
|
|
|
- warehouseId: [{ required: true, message: "请选择仓库", trigger: "change" }],
|
|
|
+ warehouseId: [
|
|
|
+ { required: true, message: "请选择调出仓库", trigger: "change" },
|
|
|
+ ],
|
|
|
+ toWarehouseId: [
|
|
|
+ { required: true, message: "请选择调入仓库", trigger: "change" },
|
|
|
+ ],
|
|
|
+ quantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
|
|
|
});
|
|
|
const openModal = () => {
|
|
|
formData.data = {
|
|
@@ -277,11 +343,22 @@ const pushGoods = (goods) => {
|
|
|
});
|
|
|
openProduct.value = false;
|
|
|
} else {
|
|
|
- ElMessage("请选择至少一件产品");
|
|
|
+ ElMessage("请选择至少一件物品");
|
|
|
}
|
|
|
};
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
|
+ if (formData.data.warehouseId === formData.data.toWarehouseId)
|
|
|
+ return ElMessage({
|
|
|
+ message: "调出仓库和调入仓库不可一致!",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!formData.data.list.length > 0)
|
|
|
+ return ElMessage({
|
|
|
+ message: "请添加调仓明细",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
loadingDialog.value = true;
|
|
|
proxy.post("/stock/stockTransfer", formData.data).then(
|
|
|
() => {
|