Commit 5f8d2bd9 authored by huhaiqing's avatar huhaiqing

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

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