Commit 5f8d2bd9 authored by huhaiqing's avatar huhaiqing

修改出货显示问题以及拆单修改

parent d2c421ac
......@@ -667,6 +667,21 @@ export function externalLoad(data) {
});
}
/**
* 获取拆单列表
*
* @param {*} params
* @returns
*/
export function splitList(data) {
return request({
url: "/shipment/box/splitList",
method: "post",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
data: jsonToFormData(data),
});
}
/***************************** 装柜 end **********************************/
/***************************** 卸柜 start **********************************/
......@@ -708,7 +723,7 @@ export function batchUnload(data) {
* @param {*} data
* @return {*}
*/
export function singleUnload(data) {
export function singleUnload(data) {
return request({
url: "/ecw/box-load-info/singleUnload",
method: "post",
......
......@@ -181,14 +181,14 @@
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="400px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="100px">
<el-row>
<el-form-item label="中文品名:" prop="prodTitleZh">
<el-form-item label="中文品名:" prop="zhId">
<el-select v-model="shopForm.zhId" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="英文品名:" prop="prodTitleEn">
<el-form-item label="英文品名:" prop="enId">
<el-select v-model="shopForm.enId" :placeholder="$t('请选择英文品名')" @change="changeProdTitleEn">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.id" :key="item.id"></el-option>
</el-select>
......@@ -223,7 +223,7 @@ import { getTradeCityList } from "@/api/ecw/region";
import WorkFlow from "@/components/WorkFlow";
import { getOrder } from "@/api/ecw/order";
import { serviceMsg, toReviewDetail } from "../../utils";
import { createApproval, approvalCancel } from "@/api/ecw/boxSea";
import { createApproval, approvalCancel, splitList } from "@/api/ecw/boxSea";
import Decimal from "decimal.js";
export default {
......@@ -249,13 +249,23 @@ export default {
shopForm: {},
// 表单校验
shopRules: {
prodTitleZh: [
{ required: true, message: this.$t("请选择中文品名"), trigger: "change" },
zhId: [
{
required: true,
message: this.$t("请选择中文品名"),
trigger: "change",
},
],
prodTitleEn: [
{ required: true, message: this.$t("请选择英文品名"), trigger: "change" },
enId: [
{
required: true,
message: this.$t("请选择英文品名"),
trigger: "change",
},
],
num: [
{ required: true, message: this.$t("请输入箱数"), trigger: "change" },
],
num: [{ required: true, message: this.$t("请输入箱数"), trigger: "change" }],
},
queryParams: {
orderId: 0,
......@@ -318,40 +328,38 @@ export default {
},
/* 打开拆单 */
getSplit() {
if (this.currRow.goodsList && this.currRow.goodsList.length) {
const [orderItem] = this.currRow.goodsList;
createSplit({
parentOrderId: this.currRow.orderId,
parentOrderNo: this.currRow.orderNo,
dstWarehouseId: orderItem.destWarehouseId,
transportId: orderItem.transportId,
shipmentType: 1,
}).then((res) => {
this.querySplitGoods();
});
}
this.orderItems = this.currRow.goodsList ?? [];
const { shipmentObj } = this.$attrs;
splitList({
orderId: this.currRow.orderId,
shipmentId: shipmentObj.id,
}).then((res) => {
const orderSplitBackVOList = res.data;
if (orderSplitBackVOList && orderSplitBackVOList.length) {
// 取拆单项
this.splitData = orderSplitBackVOList.filter(
(item) => !item.isMaster
)[0];
}
});
},
/* 查询拆单项 */
querySplitGoods() {
return new Promise((resolve, reject) => {
getSplitList({
lang: 0,
orderId: this.currRow.orderId,
shipmentType: 1,
}).then((res) => {
const { orderSplitBackVOList } = res.data;
if (orderSplitBackVOList && orderSplitBackVOList.length) {
this.orderItems = this.currRow.goodsList ?? [];
console.log(this.orderItems)
// 取拆单项
this.splitData = orderSplitBackVOList.filter(
(item) => !item.isMaster
)[0];
resolve(false);
} else {
resolve(true);
}
});
getSplitList({
lang: 0,
orderId: this.currRow.orderId,
shipmentType: 1,
}).then((res) => {
console.log(res)
const { orderSplitBackVOList } = res.data;
if (orderSplitBackVOList && orderSplitBackVOList.length) {
this.orderItems = this.currRow.goodsList ?? [];
console.log(this.orderItems);
// 取拆单项
this.splitData = orderSplitBackVOList.filter(
(item) => !item.isMaster
)[0];
}
});
},
getOrderDetail() {
......@@ -395,10 +403,18 @@ export default {
column.warehouseInInfoVO?.weight ?? 0
).toFixed(2);
});
sums[1] = this.$t("下单统计:{orderSum} 箱 {orderV)m³ {orderW}kg 入仓统计:{leviteSum} 箱 {leviteV)m³ {leviteW}kg", {
orderSum, orderV, orderW, leviteSum, leviteV, leviteW
})
/* "下单统计:" +
sums[1] = this.$t(
"下单统计:{orderSum} 箱 {orderV)m³ {orderW}kg 入仓统计:{leviteSum} 箱 {leviteV)m³ {leviteW}kg",
{
orderSum,
orderV,
orderW,
leviteSum,
leviteV,
leviteW,
}
);
/* "下单统计:" +
orderSum +
" 箱 " +
orderV +
......@@ -417,7 +433,7 @@ export default {
},
importCityName(id) {
let arr = this.tradeCityList.filter((item) => item.id == id);
return arr.length > 0 ? this.$l(arr[0], 'title') : this.$t("");
return arr.length > 0 ? this.$l(arr[0], "title") : this.$t("");
},
submitForm() {
const { shipmentObj } = this.$attrs;
......@@ -432,7 +448,7 @@ export default {
}).then((res) => {
serviceMsg(res, this).then((res) => {
this.$emit("getBoxInfo");
this.getSplit();
this.querySplitGoods();
});
});
},
......@@ -442,9 +458,7 @@ export default {
},
changeProdTitleZh() {
let list = [];
list = this.currRow.goodsList.filter(
(item) => item.id == this.shopForm.zhId
);
list = this.orderItems.filter((item) => item.id == this.shopForm.zhId);
this.shopForm.sum =
this.currRow.num - this.currRow.installNum - this.totalSplitNum();
this.shopForm.orderItemId = list[0].orderItemId;
......@@ -452,9 +466,7 @@ export default {
},
changeProdTitleEn() {
let list = [];
list = this.orderData.orderItemVOList.filter(
(item) => item.id == this.shopForm.enId
);
list = this.orderItems.filter((item) => item.id == this.shopForm.enId);
this.shopForm.sum =
this.currRow.num - this.currRow.installNum - this.totalSplitNum();
this.shopForm.orderItemId = list[0].orderItemId;
......@@ -487,7 +499,7 @@ export default {
};
createSplitItem(params).then((res) => {
this.$message.success(this.$t("放入成功"));
this.getSplit();
this.querySplitGoods();
});
this.shopOpen = false;
}
......@@ -497,8 +509,8 @@ export default {
let that = this;
that.$confirm(this.$t("是否移除货物吗?")).then(function () {
deleteSplitItem(id).then((res) => {
that.$message.success(this.$t("移除成功"));
that.getSplit();
that.$message.success(that.$t("移除成功"));
that.querySplitGoods();
});
});
},
......@@ -511,7 +523,7 @@ export default {
}).then((res) => {
serviceMsg(res, this).then(() => {
this.$emit("getBoxInfo");
this.getSplit();
this.querySplitGoods();
});
});
},
......
......@@ -84,7 +84,7 @@
<div v-show="!item.fold">
<el-table v-loading="loading" :data="item.boxOrderItemList" border>
<el-table-column :label="$t('序号')" type="index" align="center" width="50" />
<el-table-column :label="$t('品名')" align="center" :prop="$t('prodTitle')" min-width="500" />
<el-table-column :label="$t('品名')" align="center" prop="prodTitleZh" min-width="500" />
<el-table-column :label="$t('品牌')" align="center" prop="brandType" width="120">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_BRAND_TYPE" :value="scope.row.brandType" />
......
......@@ -422,7 +422,7 @@ export default {
/* 获取城市 */
importCityName(id) {
var arr = this.$attrs.warehouseList.filter((item) => item.id == id);
return arr.length > 0 ? $l(arr[0], 'title') : this.$t("");
return arr.length > 0 ? this.$l(arr[0], 'title') : this.$t("");
},
/* 选中行 */
checkboxSelect(selection, part) {
......
......@@ -241,7 +241,7 @@ export default {
getCityName() {
return (id) => {
let arr = this.$attrs.warehouseList.filter((item) => item.id == id);
return arr.length > 0 ? $l(arr[0], 'title') : this.$t("");
return arr.length > 0 ? this.$l(arr[0], 'title') : this.$t("");
};
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment