|
@@ -22,7 +22,7 @@
|
|
|
</byTable>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
- :title="modalType == 'add' ? '添加仓库' : '编辑'"
|
|
|
+ title="入库"
|
|
|
v-model="dialogVisible"
|
|
|
width="800"
|
|
|
v-loading="loading"
|
|
@@ -35,27 +35,23 @@
|
|
|
ref="byform"
|
|
|
>
|
|
|
<template #detail>
|
|
|
- <div style="width">
|
|
|
- <el-table :data="formData.data.qualityDetailList">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-table :data="formData.data.stockWaitDetailsList">
|
|
|
<el-table-column prop="productCode" label="货品编码" />
|
|
|
<el-table-column prop="productName" label="货品名称" />
|
|
|
- <el-table-column prop="productSpec" label="采购数量" />
|
|
|
- <el-table-column prop="productUnit" label="本次发货" />
|
|
|
- <el-table-column prop="count" label="已入库" />
|
|
|
- <el-table-column
|
|
|
- prop="qualifiedCount"
|
|
|
- label="本次入库"
|
|
|
- min-width="150"
|
|
|
- >
|
|
|
+ <el-table-column prop="purchaseQuantity" label="采购数量" />
|
|
|
+ <el-table-column prop="arrivalQuantity" label="本次发货" />
|
|
|
+ <el-table-column prop="receiptQuantity" label="已入库" />
|
|
|
+ <el-table-column prop="quantity" label="本次入库" min-width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="'qualityDetailList.' + $index + '.qualifiedCount'"
|
|
|
- :rules="rules.qualifiedCount"
|
|
|
+ :prop="'stockWaitDetailsList.' + $index + '.quantity'"
|
|
|
+ :rules="rules.quantity"
|
|
|
:inline-message="true"
|
|
|
>
|
|
|
<el-input-number
|
|
|
- v-model="row.qualifiedCount"
|
|
|
- :precision="4"
|
|
|
+ v-model="row.quantity"
|
|
|
+ :precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
/>
|
|
@@ -97,6 +93,7 @@ const sourceList = ref({
|
|
|
total: 3,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ type: 1,
|
|
|
},
|
|
|
});
|
|
|
let dialogVisible = ref(false);
|
|
@@ -106,7 +103,10 @@ let rules = ref({
|
|
|
type: [
|
|
|
{ required: true, message: "请选择仓库类型", trigger: ["blur", "change"] },
|
|
|
],
|
|
|
- name: [{ required: true, message: "请输入仓库名称", trigger: "blur" }],
|
|
|
+ warehouseId: [
|
|
|
+ { required: true, message: "请选择仓库名称", trigger: "change" },
|
|
|
+ ],
|
|
|
+ quantity: [{ required: true, message: "请输入入库数量", trigger: "blur" }],
|
|
|
});
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const selectConfig = reactive([
|
|
@@ -119,10 +119,14 @@ const selectConfig = reactive([
|
|
|
const inboundType = ref([
|
|
|
{
|
|
|
label: "未入库",
|
|
|
- value: "1",
|
|
|
+ value: "0",
|
|
|
},
|
|
|
{
|
|
|
label: "部分入库",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "入库完成",
|
|
|
value: "2",
|
|
|
},
|
|
|
]);
|
|
@@ -131,50 +135,50 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "数据来源",
|
|
|
- prop: "name",
|
|
|
- },
|
|
|
- render(type) {
|
|
|
- return proxy.dictDataEcho(type, warehouseType.value);
|
|
|
+ prop: "businessType",
|
|
|
},
|
|
|
+ // render(type) {
|
|
|
+ // return proxy.dictDataEcho(type, warehouseType.value);
|
|
|
+ // },
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "单号",
|
|
|
- prop: "type",
|
|
|
+ prop: "code",
|
|
|
},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "物流/快递公司",
|
|
|
- prop: "keeperName",
|
|
|
+ prop: "logisticsCompanyName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "仓库名称",
|
|
|
- prop: "remark",
|
|
|
+ prop: "receiptWarehouseName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作人",
|
|
|
- prop: "remark",
|
|
|
+ prop: "operatorName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作时间",
|
|
|
- prop: "remark",
|
|
|
+ prop: "createTime",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "入库状态",
|
|
|
- prop: "name",
|
|
|
+ prop: "status",
|
|
|
},
|
|
|
- render(type) {
|
|
|
- return proxy.dictDataEcho(type, inboundType.value);
|
|
|
+ render(status) {
|
|
|
+ return status == 0 ? "未入库" : status == 1 ? "部分入库" : "";
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -191,6 +195,7 @@ const config = computed(() => {
|
|
|
label: "入库",
|
|
|
type: "primary",
|
|
|
text: true,
|
|
|
+ disabled: row.status > 1,
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
@@ -218,15 +223,16 @@ const treeData = ref([]);
|
|
|
const formConfig = reactive([
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "type",
|
|
|
+ prop: "businessType",
|
|
|
label: "入库类型",
|
|
|
required: true,
|
|
|
+ disabled: true,
|
|
|
itemWidth: 100,
|
|
|
data: [],
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "name",
|
|
|
+ prop: "warehouseId",
|
|
|
label: "仓库名称",
|
|
|
itemWidth: 33,
|
|
|
isLoad: {
|
|
@@ -243,8 +249,9 @@ const formConfig = reactive([
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- prop: "remark",
|
|
|
+ prop: "code",
|
|
|
label: "物流信息",
|
|
|
+ disabled: true,
|
|
|
itemWidth: 33,
|
|
|
},
|
|
|
{
|
|
@@ -257,10 +264,13 @@ const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
proxy
|
|
|
- .post("/abnormalInfo/page", sourceList.value.pagination)
|
|
|
+ .post("/stockWait/pageByWdly", sourceList.value.pagination)
|
|
|
.then((message) => {
|
|
|
console.log(message);
|
|
|
- sourceList.value.data = message.rows;
|
|
|
+ sourceList.value.data = message.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ ...JSON.parse(x.victoriatouristJson),
|
|
|
+ }));
|
|
|
sourceList.value.pagination.total = message.total;
|
|
|
setTimeout(() => {
|
|
|
loading.value = false;
|
|
@@ -274,13 +284,29 @@ const openModal = () => {
|
|
|
};
|
|
|
|
|
|
const submitForm = () => {
|
|
|
- console.log(byform.value);
|
|
|
byform.value.handleSubmit((valid) => {
|
|
|
+ const list = formData.data.stockWaitDetailsList;
|
|
|
+ const total = list.reduce((total, x) => (total += Number(x.quantity)), 0);
|
|
|
+ if (!(total > 0)) {
|
|
|
+ return ElMessage({
|
|
|
+ message: `本次入库不能为0!`,
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ const e = list[i];
|
|
|
+ if (Number(e.receiptQuantity) + e.quantity > Number(e.purchaseQuantity)) {
|
|
|
+ return ElMessage({
|
|
|
+ message: "本次入库加已入库数量不可大于到货数量!",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
submitLoading.value = true;
|
|
|
- proxy.post("/warehouse/" + modalType.value, formData.data).then(
|
|
|
+ proxy.post("/stockWait/addByWdly", formData.data).then(
|
|
|
(res) => {
|
|
|
ElMessage({
|
|
|
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
+ message: "操作成功",
|
|
|
type: "success",
|
|
|
});
|
|
|
dialogVisible.value = false;
|
|
@@ -294,10 +320,19 @@ const submitForm = () => {
|
|
|
|
|
|
const getDtl = (row) => {
|
|
|
modalType.value = "edit";
|
|
|
- proxy.post("/warehouse/detail", { id: row.id }).then((res) => {
|
|
|
- res.type = res.type + "";
|
|
|
- formData.data = res;
|
|
|
- console.log(formData);
|
|
|
+ proxy.post("/stockWait/detailByWdly", { id: row.id }).then((res) => {
|
|
|
+ const json = JSON.parse(res.victoriatouristJson);
|
|
|
+ formData.data = {
|
|
|
+ type: "1",
|
|
|
+ businessType: res.businessType,
|
|
|
+ warehouseId: "",
|
|
|
+ code: json.code,
|
|
|
+ stockWaitDetailsList: res.stockWaitDetailsList.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ arrivalQuantity: x.quantity,
|
|
|
+ quantity: 0,
|
|
|
+ })),
|
|
|
+ };
|
|
|
dialogVisible.value = true;
|
|
|
});
|
|
|
};
|