|
@@ -172,7 +172,7 @@ let rules = ref({
|
|
inWarehouseId: [
|
|
inWarehouseId: [
|
|
{ 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([
|
|
@@ -254,6 +254,9 @@ const config = computed(() => {
|
|
label: "单位",
|
|
label: "单位",
|
|
prop: "productUnit",
|
|
prop: "productUnit",
|
|
},
|
|
},
|
|
|
|
+ render(unit) {
|
|
|
|
+ return proxy.dictValueLabel(unit, productUnit.value);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
@@ -309,6 +312,10 @@ const formOption = reactive({
|
|
});
|
|
});
|
|
const byform = ref(null);
|
|
const byform = ref(null);
|
|
let formConfig = ref([]);
|
|
let formConfig = ref([]);
|
|
|
|
+const businessType = [
|
|
|
|
+ { label: "销售订单出库", value: "6" },
|
|
|
|
+ { label: "京东订单出库", value: "5" },
|
|
|
|
+];
|
|
const configData = [
|
|
const configData = [
|
|
[
|
|
[
|
|
{
|
|
{
|
|
@@ -322,11 +329,11 @@ const configData = [
|
|
required: true,
|
|
required: true,
|
|
disabled: true,
|
|
disabled: true,
|
|
itemWidth: 100,
|
|
itemWidth: 100,
|
|
- data: [],
|
|
|
|
|
|
+ data: businessType,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
- prop: "businessType",
|
|
|
|
|
|
+ prop: "businessCode",
|
|
label: "单号",
|
|
label: "单号",
|
|
required: true,
|
|
required: true,
|
|
disabled: true,
|
|
disabled: true,
|
|
@@ -334,7 +341,7 @@ const configData = [
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
- prop: "businessType",
|
|
|
|
|
|
+ prop: "productName",
|
|
label: "物品名称",
|
|
label: "物品名称",
|
|
required: true,
|
|
required: true,
|
|
disabled: true,
|
|
disabled: true,
|
|
@@ -342,7 +349,7 @@ const configData = [
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
- prop: "businessType",
|
|
|
|
|
|
+ prop: "waitQuantity",
|
|
label: "待出库数量",
|
|
label: "待出库数量",
|
|
required: true,
|
|
required: true,
|
|
disabled: true,
|
|
disabled: true,
|
|
@@ -370,11 +377,14 @@ const configData = [
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- type: "input",
|
|
|
|
- prop: "code",
|
|
|
|
|
|
+ type: "number",
|
|
|
|
+ prop: "quantity",
|
|
label: "出库数量",
|
|
label: "出库数量",
|
|
disabled: false,
|
|
disabled: false,
|
|
itemWidth: 33,
|
|
itemWidth: 33,
|
|
|
|
+ precision: 2,
|
|
|
|
+ min: 0,
|
|
|
|
+ controls: false,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
[
|
|
[
|
|
@@ -424,6 +434,7 @@ const getList = async (req) => {
|
|
sourceList.value.data = message.rows.map((x) => ({
|
|
sourceList.value.data = message.rows.map((x) => ({
|
|
...x,
|
|
...x,
|
|
...JSON.parse(x.victoriatouristJson),
|
|
...JSON.parse(x.victoriatouristJson),
|
|
|
|
+ quantity: Number(x.quantity) - Number(x.receiptQuantity),
|
|
}));
|
|
}));
|
|
sourceList.value.pagination.total = message.total;
|
|
sourceList.value.pagination.total = message.total;
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -470,6 +481,39 @@ const submitForm = () => {
|
|
},
|
|
},
|
|
(err) => (submitLoading.value = false)
|
|
(err) => (submitLoading.value = false)
|
|
);
|
|
);
|
|
|
|
+ } else if (modalType.value === "edit") {
|
|
|
|
+ const data = {
|
|
|
|
+ id: formData.data.id,
|
|
|
|
+ businessType: formData.data.businessType,
|
|
|
|
+ warehouseId: formData.data.warehouseId,
|
|
|
|
+ quantity: formData.data.quantity,
|
|
|
|
+ waitQuantity: formData.data.waitQuantity,
|
|
|
|
+ };
|
|
|
|
+ if (!(data.quantity > 0)) {
|
|
|
|
+ return ElMessage({
|
|
|
|
+ message: "出库数量不能为0!",
|
|
|
|
+ type: "info",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (data.quantity > data.waitQuantity) {
|
|
|
|
+ return ElMessage({
|
|
|
|
+ message: "出库数量不能大于待出库数量!",
|
|
|
|
+ type: "info",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ submitLoading.value = true;
|
|
|
|
+ proxy.post("/stockWaitDetails/add", data).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: "操作成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ dialogVisible.value = false;
|
|
|
|
+ submitLoading.value = false;
|
|
|
|
+ getList();
|
|
|
|
+ },
|
|
|
|
+ (err) => (submitLoading.value = false)
|
|
|
|
+ );
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -495,20 +539,25 @@ const outBound = (row) => {
|
|
};
|
|
};
|
|
dialogVisible.value = true;
|
|
dialogVisible.value = true;
|
|
});
|
|
});
|
|
- } else {
|
|
|
|
|
|
+ } else if (row.businessType == 6) {
|
|
modalType.value = "edit";
|
|
modalType.value = "edit";
|
|
formConfig.value = configData[0];
|
|
formConfig.value = configData[0];
|
|
|
|
+ proxy.post("/orderInfo/detail", { id: row.businessId }).then((res) => {
|
|
|
|
+ formData.data = {
|
|
|
|
+ id: row.id,
|
|
|
|
+ warehouseId: "",
|
|
|
|
+ businessType: row.businessType + "",
|
|
|
|
+ businessCode: row.businessCode,
|
|
|
|
+ productName: row.productName,
|
|
|
|
+ waitQuantity: row.quantity,
|
|
|
|
+ quantity: undefined,
|
|
|
|
+ };
|
|
|
|
+ dialogVisible.value = true;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
-
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
};
|
|
};
|
|
const warehouseType = ref([]);
|
|
const warehouseType = ref([]);
|
|
|
|
|
|
-const businessType = [
|
|
|
|
- { label: "销售订单出库", value: "6" },
|
|
|
|
- { label: "京东订单出库", value: "5" },
|
|
|
|
-];
|
|
|
|
-
|
|
|
|
const handleRemove = (index) => {
|
|
const handleRemove = (index) => {
|
|
formData.data.jdOrderDetailsList.splice(index, 1);
|
|
formData.data.jdOrderDetailsList.splice(index, 1);
|
|
return ElMessage({
|
|
return ElMessage({
|
|
@@ -574,6 +623,16 @@ const warehouseListData = () => {
|
|
};
|
|
};
|
|
warehouseListData();
|
|
warehouseListData();
|
|
getList();
|
|
getList();
|
|
|
|
+const productUnit = ref([]);
|
|
|
|
+const getDict = () => {
|
|
|
|
+ proxy.getDictOne(["unit"]).then((res) => {
|
|
|
|
+ productUnit.value = res["unit"].map((x) => ({
|
|
|
|
+ label: x.dictValue,
|
|
|
|
+ value: x.dictKey,
|
|
|
|
+ }));
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+getDict();
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
selectConfig[0].data = businessType;
|
|
selectConfig[0].data = businessType;
|
|
selectConfig[1].data = outboundType.value;
|
|
selectConfig[1].data = outboundType.value;
|