|
@@ -29,16 +29,18 @@
|
|
<template #detail>
|
|
<template #detail>
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
<el-table :data="formData.data.stockWaitDetailsList" show-summary :summary-method="getSummaries">
|
|
<el-table :data="formData.data.stockWaitDetailsList" show-summary :summary-method="getSummaries">
|
|
- <el-table-column prop="productCustomCode" label="物品编码" width="130" />
|
|
|
|
- <el-table-column prop="productName" label="物品名称" />
|
|
|
|
- <el-table-column prop="productSpec" label="规格" width="120" />
|
|
|
|
- <el-table-column prop="purchaseQuantity" label="采购数量" width="100" />
|
|
|
|
- <el-table-column prop="arrivalQuantity" label="本次发货" width="100" />
|
|
|
|
- <el-table-column prop="receiptQuantity" label="已入库" width="100" />
|
|
|
|
|
|
+ <el-table-column prop="productCustomCode" label="物品编码" width="130"/>
|
|
|
|
+ <el-table-column prop="productName" label="物品名称"/>
|
|
|
|
+ <el-table-column prop="productSpec" label="规格" width="120"/>
|
|
|
|
+ <el-table-column prop="purchaseQuantity" label="采购数量" width="100"/>
|
|
|
|
+ <el-table-column prop="arrivalQuantity" label="本次发货" width="100"/>
|
|
|
|
+ <el-table-column prop="receiptQuantity" label="已入库" width="100"/>
|
|
<el-table-column prop="quantity" label="本次入库" width="160">
|
|
<el-table-column prop="quantity" label="本次入库" width="160">
|
|
<template #default="{ row, $index }">
|
|
<template #default="{ row, $index }">
|
|
- <el-form-item :prop="'stockWaitDetailsList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
|
|
|
|
- <el-input-number v-model="row.quantity" :precision="0" :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
|
|
|
+ <el-form-item :prop="'stockWaitDetailsList.' + $index + '.quantity'" :rules="rules.quantity"
|
|
|
|
+ :inline-message="true">
|
|
|
|
+ <el-input-number v-model="row.quantity" :precision="0" :controls="false" :min="0"
|
|
|
|
+ onmousewheel="return false;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -55,15 +57,15 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+
|
|
<script setup>
|
|
<script setup>
|
|
/* eslint-disable vue/no-unused-components */
|
|
/* eslint-disable vue/no-unused-components */
|
|
-import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
|
|
+import {ElMessage, ElMessageBox} from "element-plus";
|
|
import byTable from "@/components/byTable/index";
|
|
import byTable from "@/components/byTable/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import byForm from "@/components/byForm/index";
|
|
-import { computed, defineComponent, ref } from "vue";
|
|
|
|
|
|
+import {computed, ref} from "vue";
|
|
import useUserStore from "@/store/modules/user";
|
|
import useUserStore from "@/store/modules/user";
|
|
-import { getToken } from "@/utils/auth";
|
|
|
|
|
|
+
|
|
const actionUrl = import.meta.env.VITE_APP_BASE_API;
|
|
const actionUrl = import.meta.env.VITE_APP_BASE_API;
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
const submitLoading = ref(false);
|
|
const submitLoading = ref(false);
|
|
@@ -81,14 +83,14 @@ let roomDialogVisible = ref(false);
|
|
let modalType = ref("add");
|
|
let modalType = ref("add");
|
|
let rules = ref({
|
|
let rules = ref({
|
|
type: [
|
|
type: [
|
|
- { required: true, message: "请选择仓库类型", trigger: ["blur", "change"] },
|
|
|
|
|
|
+ {required: true, message: "请选择仓库类型", trigger: ["blur", "change"]},
|
|
],
|
|
],
|
|
warehouseId: [
|
|
warehouseId: [
|
|
- { required: true, message: "请选择仓库名称", trigger: "change" },
|
|
|
|
|
|
+ {required: true, message: "请选择仓库名称", trigger: "change"},
|
|
],
|
|
],
|
|
- quantity: [{ required: true, message: "请输入入库数量", trigger: "blur" }],
|
|
|
|
|
|
+ quantity: [{required: true, message: "请输入入库数量", trigger: "blur"}],
|
|
});
|
|
});
|
|
-const { proxy } = getCurrentInstance();
|
|
|
|
|
|
+const {proxy} = getCurrentInstance();
|
|
const selectConfig = reactive([
|
|
const selectConfig = reactive([
|
|
{
|
|
{
|
|
label: "数据来源",
|
|
label: "数据来源",
|
|
@@ -114,6 +116,10 @@ const inboundType = ref([
|
|
label: "入库完成",
|
|
label: "入库完成",
|
|
value: "2",
|
|
value: "2",
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ label: "结束",
|
|
|
|
+ value: "3",
|
|
|
|
+ }
|
|
]);
|
|
]);
|
|
const config = computed(() => {
|
|
const config = computed(() => {
|
|
return [
|
|
return [
|
|
@@ -178,7 +184,7 @@ const config = computed(() => {
|
|
width: 100,
|
|
width: 100,
|
|
},
|
|
},
|
|
render(status) {
|
|
render(status) {
|
|
- return status == 0 ? "未入库" : status == 1 ? "部分入库" : "入库完成";
|
|
|
|
|
|
+ return status == 0 ? "未入库" : status == 1 ? "部分入库" : status == 1 ? "入库完成" : "结束";
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -191,7 +197,7 @@ const config = computed(() => {
|
|
renderHTML(row) {
|
|
renderHTML(row) {
|
|
return [
|
|
return [
|
|
row.status < 2
|
|
row.status < 2
|
|
- ? {
|
|
|
|
|
|
+ ? {
|
|
attrs: {
|
|
attrs: {
|
|
label: "入库",
|
|
label: "入库",
|
|
type: "primary",
|
|
type: "primary",
|
|
@@ -202,7 +208,8 @@ const config = computed(() => {
|
|
getDtl(row);
|
|
getDtl(row);
|
|
},
|
|
},
|
|
}
|
|
}
|
|
- : {},
|
|
|
|
|
|
+ : {},
|
|
|
|
+ row.status < 3?
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
label: "结束入库",
|
|
label: "结束入库",
|
|
@@ -218,19 +225,19 @@ const config = computed(() => {
|
|
}).then(() => {
|
|
}).then(() => {
|
|
// 删除
|
|
// 删除
|
|
proxy
|
|
proxy
|
|
- .post("/stockWait/endInStock", {
|
|
|
|
- id: row.id,
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- ElMessage({
|
|
|
|
- message: "操作成功",
|
|
|
|
- type: "success",
|
|
|
|
|
|
+ .post("/stockWait/endInStock", {
|
|
|
|
+ id: row.id,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: "操作成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ getList();
|
|
});
|
|
});
|
|
- getList();
|
|
|
|
- });
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- },
|
|
|
|
|
|
+ }: {},
|
|
];
|
|
];
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -311,21 +318,21 @@ const formConfig = reactive([
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
const getList = async (req) => {
|
|
const getList = async (req) => {
|
|
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
|
|
|
+ sourceList.value.pagination = {...sourceList.value.pagination, ...req};
|
|
loading.value = true;
|
|
loading.value = true;
|
|
proxy
|
|
proxy
|
|
- .post("/stockWait/pageByWdly", sourceList.value.pagination)
|
|
|
|
- .then((message) => {
|
|
|
|
- console.log(message);
|
|
|
|
- sourceList.value.data = message.rows.map((x) => ({
|
|
|
|
- ...x,
|
|
|
|
- ...JSON.parse(x.victoriatouristJson),
|
|
|
|
- }));
|
|
|
|
- sourceList.value.pagination.total = message.total;
|
|
|
|
- setTimeout(() => {
|
|
|
|
- loading.value = false;
|
|
|
|
- }, 200);
|
|
|
|
- });
|
|
|
|
|
|
+ .post("/stockWait/pageByWdly", sourceList.value.pagination)
|
|
|
|
+ .then((message) => {
|
|
|
|
+ console.log(message);
|
|
|
|
+ sourceList.value.data = message.rows.map((x) => ({
|
|
|
|
+ ...x,
|
|
|
|
+ ...JSON.parse(x.victoriatouristJson),
|
|
|
|
+ }));
|
|
|
|
+ sourceList.value.pagination.total = message.total;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ loading.value = false;
|
|
|
|
+ }, 200);
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
const openModal = () => {
|
|
const openModal = () => {
|
|
@@ -355,26 +362,26 @@ const submitForm = () => {
|
|
// }
|
|
// }
|
|
submitLoading.value = true;
|
|
submitLoading.value = true;
|
|
proxy.post("/stockWait/addByWdly", formData.data).then(
|
|
proxy.post("/stockWait/addByWdly", formData.data).then(
|
|
- (res) => {
|
|
|
|
- ElMessage({
|
|
|
|
- message: "操作成功",
|
|
|
|
- type: "success",
|
|
|
|
- });
|
|
|
|
- dialogVisible.value = false;
|
|
|
|
- submitLoading.value = false;
|
|
|
|
- getList();
|
|
|
|
- },
|
|
|
|
- (err) => (submitLoading.value = false)
|
|
|
|
|
|
+ (res) => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: "操作成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ dialogVisible.value = false;
|
|
|
|
+ submitLoading.value = false;
|
|
|
|
+ getList();
|
|
|
|
+ },
|
|
|
|
+ (err) => (submitLoading.value = false)
|
|
);
|
|
);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
const getDtl = (row) => {
|
|
const getDtl = (row) => {
|
|
modalType.value = "edit";
|
|
modalType.value = "edit";
|
|
- proxy.post("/stockWait/detailByWdly", { id: row.id }).then((res) => {
|
|
|
|
|
|
+ proxy.post("/stockWait/detailByWdly", {id: row.id}).then((res) => {
|
|
const json = res.victoriatouristJson
|
|
const json = res.victoriatouristJson
|
|
- ? JSON.parse(res.victoriatouristJson)
|
|
|
|
- : {};
|
|
|
|
|
|
+ ? JSON.parse(res.victoriatouristJson)
|
|
|
|
+ : {};
|
|
formData.data = {
|
|
formData.data = {
|
|
id: row.id,
|
|
id: row.id,
|
|
type: "1",
|
|
type: "1",
|
|
@@ -386,10 +393,10 @@ const getDtl = (row) => {
|
|
...x,
|
|
...x,
|
|
arrivalQuantity: x.quantity,
|
|
arrivalQuantity: x.quantity,
|
|
quantity: x.stockWaitDetailsCheckList
|
|
quantity: x.stockWaitDetailsCheckList
|
|
- ? x.stockWaitDetailsCheckList
|
|
|
|
- .filter((x) => x.status != 2)
|
|
|
|
- .reduce((total, y) => (total += Number(y.quantity)), 0)
|
|
|
|
- : 0,
|
|
|
|
|
|
+ ? x.stockWaitDetailsCheckList
|
|
|
|
+ .filter((x) => x.status != 2)
|
|
|
|
+ .reduce((total, y) => (total += Number(y.quantity)), 0)
|
|
|
|
+ : 0,
|
|
})),
|
|
})),
|
|
};
|
|
};
|
|
dialogVisible.value = true;
|
|
dialogVisible.value = true;
|
|
@@ -399,23 +406,23 @@ const warehouseType = ref([]);
|
|
const getDict = () => {
|
|
const getDict = () => {
|
|
// // 币种数据
|
|
// // 币种数据
|
|
proxy
|
|
proxy
|
|
- .post("/dictTenantData/page", {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 999,
|
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
|
- dictCode: "warehouse_type",
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- warehouseType.value = res.rows;
|
|
|
|
- });
|
|
|
|
|
|
+ .post("/dictTenantData/page", {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 999,
|
|
|
|
+ tenantId: useUserStore().user.tenantId,
|
|
|
|
+ dictCode: "warehouse_type",
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ warehouseType.value = res.rows;
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
const businessType = [
|
|
const businessType = [
|
|
- { label: "线边回仓", value: "1" },
|
|
|
|
- { label: "完工入库", value: "2" },
|
|
|
|
- { label: "采购到货", value: "3" },
|
|
|
|
- { label: "退货出库", value: "4" },
|
|
|
|
- { label: "多货处理", value: "23" },
|
|
|
|
|
|
+ {label: "线边回仓", value: "1"},
|
|
|
|
+ {label: "完工入库", value: "2"},
|
|
|
|
+ {label: "采购到货", value: "3"},
|
|
|
|
+ {label: "退货出库", value: "4"},
|
|
|
|
+ {label: "多货处理", value: "23"},
|
|
];
|
|
];
|
|
|
|
|
|
getList();
|
|
getList();
|
|
@@ -438,32 +445,32 @@ const deriveExcel = () => {
|
|
type: "success",
|
|
type: "success",
|
|
});
|
|
});
|
|
proxy
|
|
proxy
|
|
- .postTwo(
|
|
|
|
- "/stockWait/inStockWaitExportExcel",
|
|
|
|
- selectData.value.map((x) => x.id)
|
|
|
|
- )
|
|
|
|
- .then((res) => {
|
|
|
|
- const content = res;
|
|
|
|
- const blob = new Blob([content], { type: "application/ms-excel" });
|
|
|
|
- const fileName = "待入库.xlsx";
|
|
|
|
- if ("download" in document.createElement("a")) {
|
|
|
|
- // 非IE下载
|
|
|
|
- const elink = document.createElement("a");
|
|
|
|
- elink.download = fileName;
|
|
|
|
- elink.style.display = "none";
|
|
|
|
- elink.href = URL.createObjectURL(blob);
|
|
|
|
- document.body.appendChild(elink);
|
|
|
|
- elink.click();
|
|
|
|
- URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
|
|
- document.body.removeChild(elink);
|
|
|
|
- } else {
|
|
|
|
- navigator.msSaveBlob(blob, fileName);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ .postTwo(
|
|
|
|
+ "/stockWait/inStockWaitExportExcel",
|
|
|
|
+ selectData.value.map((x) => x.id)
|
|
|
|
+ )
|
|
|
|
+ .then((res) => {
|
|
|
|
+ const content = res;
|
|
|
|
+ const blob = new Blob([content], {type: "application/ms-excel"});
|
|
|
|
+ const fileName = "待入库.xlsx";
|
|
|
|
+ if ("download" in document.createElement("a")) {
|
|
|
|
+ // 非IE下载
|
|
|
|
+ const elink = document.createElement("a");
|
|
|
|
+ elink.download = fileName;
|
|
|
|
+ elink.style.display = "none";
|
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
+ elink.click();
|
|
|
|
+ URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
|
|
+ document.body.removeChild(elink);
|
|
|
|
+ } else {
|
|
|
|
+ navigator.msSaveBlob(blob, fileName);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
const getSummaries = (param) => {
|
|
const getSummaries = (param) => {
|
|
- const { columns, data } = param; //columns是每列的信息,data是每行的信息
|
|
|
|
|
|
+ const {columns, data} = param; //columns是每列的信息,data是每行的信息
|
|
const sums = [];
|
|
const sums = [];
|
|
columns.forEach((column, index) => {
|
|
columns.forEach((column, index) => {
|
|
if (index === 0) {
|
|
if (index === 0) {
|
|
@@ -472,10 +479,10 @@ const getSummaries = (param) => {
|
|
}
|
|
}
|
|
const values = data.map((item) => Number(item[column.property]));
|
|
const values = data.map((item) => Number(item[column.property]));
|
|
if (
|
|
if (
|
|
- column.property === "purchaseQuantity" ||
|
|
|
|
- column.property === "arrivalQuantity" ||
|
|
|
|
- column.property === "receiptQuantity" ||
|
|
|
|
- column.property === "quantity"
|
|
|
|
|
|
+ column.property === "purchaseQuantity" ||
|
|
|
|
+ column.property === "arrivalQuantity" ||
|
|
|
|
+ column.property === "receiptQuantity" ||
|
|
|
|
+ column.property === "quantity"
|
|
) {
|
|
) {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
const value = Number(curr);
|
|
const value = Number(curr);
|
|
@@ -491,7 +498,7 @@ const getSummaries = (param) => {
|
|
return sums;
|
|
return sums;
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-
|
|
|
|
|
|
+
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.tenant {
|
|
.tenant {
|
|
padding: 20px;
|
|
padding: 20px;
|