Commit d1d9e8d6 authored by huhaiqing's avatar huhaiqing

修改海运操作缺陷单

parent b8102b65
......@@ -411,6 +411,21 @@ export function createSection(data) {
});
}
/**
* 创建预装部分
*
* @export
* @param {*} data
* @return {*}
*/
export function changeSection(data) {
return request({
url: "/ecw/box-preload-goods/changeSection",
method: "post",
data,
});
}
/**
* 查询出货单下的所有部分列表
*
......
......@@ -171,7 +171,7 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_NOTICE_TYPE" :value="String(scope.row.noticeType)" />
</template>
</el-table-column>
<el-table-column label="操作时间" align="center">
<el-table-column label="预计时间" align="center">
<template slot-scope="scope">
{{formatDate(scope.row.createTime)}}
</template>
......
......@@ -169,7 +169,7 @@ export default {
orderId: this.currRow.orderId,
copyUserId: this.selectedUsers,
};
if (['makeBill','resetBill'].includes(this.dialogCfg.type)) {
if (["makeBill", "resetBill"].includes(this.dialogCfg.type)) {
createBillService({ ...params, status: 1 }).then((res) => {
serviceMsg(res, this).then((res) => {
this.close("query");
......
......@@ -164,7 +164,7 @@ export default {
calcSum(goodsList) {
let sum = 0;
goodsList.forEach((element) => {
sum = Decimal.add(sum, element.num);
sum = Decimal.add(sum, element.num).toNumber();
});
return sum;
},
......
......@@ -312,7 +312,7 @@ export default {
let _total = 0;
const { orderSplitItemBackVOList = [] } = this.splitData;
orderSplitItemBackVOList.forEach((v) => {
_total = Decimal.add(_total, Number(v.num));
_total = Decimal.add(_total, Number(v.num)).toNumber();
});
return _total;
},
......@@ -382,15 +382,15 @@ export default {
let leviteV = 0;
let leviteW = 0;
this.orderData.orderItemVOList.forEach((column, index) => {
orderSum = Decimal.add(orderSum, column.num ?? 0);
orderV = Decimal.add(orderV, column.volume ?? 0);
orderW = Decimal.add(orderW, column.weight ?? 0);
orderSum = Decimal.add(orderSum, column.num ?? 0).toNumber();
orderV = Decimal.add(orderV, column.volume ?? 0).toFixed(2);
orderW = Decimal.add(orderW, column.weight ?? 0).toFixed(2);
leviteSum = Decimal.add(
leviteSum,
column.warehouseInInfoVO?.cartonsNum ?? 0
);
leviteV += Decimal.add(leviteV, column.warehouseInInfoVO?.volume ?? 0);
leviteW += Decimal.add(leviteW, column.warehouseInInfoVO?.weight ?? 0);
).toNumber();
leviteV += Decimal.add(leviteV, column.warehouseInInfoVO?.volume ?? 0).toFixed(2);
leviteW += Decimal.add(leviteW, column.warehouseInInfoVO?.weight ?? 0).toFixed(2);
});
sums[1] =
"下单统计:" +
......@@ -460,8 +460,8 @@ export default {
if (valid) {
// 输入箱数大于实装箱数
const total = this.totalSplitNum();
const canSplitNum = Decimal.sub(this.currRow.num, this.currRow.installNum);
const remain = Decimal.sub(canSplitNum, total);
const canSplitNum = Decimal.sub(this.currRow.num, this.currRow.installNum).toNumber();
const remain = Decimal.sub(canSplitNum, total).toNumber();
if (this.shopForm.num > remain) {
this.$message.error("放入箱数不能大于总箱数");
return;
......
......@@ -642,7 +642,7 @@ export default {
this.listData.forEach((item) => {
const { sectionOrderList = [] } = item;
sectionOrderList.forEach((item) => {
count = Decimal.add(count, item.installNum);
count = Decimal.add(count, item.installNum).toNumber();
});
});
}
......
......@@ -3,6 +3,9 @@
<el-form ref="cusDeclarationForm" :rules="rules" :model="cusDeclarationObj" label-width="120px">
<el-form-item label="单证要求">
<template v-for="(item, index) in cusDeclarationObj.documentInfo">
{{
(index === 0 || index === cusDeclarationObj.documentInfo.length) ? "" :"/"
}}
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="item" :key="index" />
</template>
<el-button type="primary" style="margin-left:10px;" @click="downloadVGM">{{getButtonLabel(cusDeclarationObj.documentInfo)}}</el-button>
......@@ -30,7 +33,7 @@
<el-date-picker type="datetime" placeholder="请选择日期" v-model="cusDeclarationObj.dcCutOffTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item label="状态" prop="dcCustomsStatus">
<el-radio-group v-model="cusDeclarationObj.dcCustomsStatus" :disabled="inReview || isCheckDeal">
<el-radio-group v-model="cusDeclarationObj.dcCustomsStatus" :disabled="inReview || isCheckDeal('status')">
<el-radio v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_DCCUSTOMS_STATUS)" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
......@@ -38,7 +41,7 @@
<!-- 查验 -->
<div v-show="cusDeclarationObj.dcCustomsStatus === '3'">
<el-form-item label="查验">
<el-radio-group v-model="cusDeclarationObj.dcCheckStatus" :disabled="inReview || isCheckDeal">
<el-radio-group v-model="cusDeclarationObj.dcCheckStatus" :disabled="inReview || isCheckDeal('check')">
<el-radio v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_CHECK_STATUS)" :key="item.value" :label="item.value" :disabled="disabledRadio(item)">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
......@@ -78,8 +81,8 @@
<el-button type="primary" plain @click="canclAudit">{{cusDeclarationObj.dcCheckStatus === '1' ? '取消全部退场审核' : '取消部分退场审核'}}</el-button>
</el-row>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)" :disabled="isCheckDeal">保存</el-button>
<el-button type="success" v-if="!inReview" @click="onSubmit(2)" :disabled="isCheckDeal">提交</el-button>
<el-button type="primary" @click="onSubmit(1)" :disabled="isCheckDeal('submit')">保存</el-button>
<el-button type="success" v-if="!inReview" @click="onSubmit(2)" :disabled="isCheckDeal('submit')">提交</el-button>
<el-button @click="cancel">关闭</el-button>
<el-button type="primary" @click="extraCost" v-show="cusDeclarationObj.dcCustomsStatus === '2' || cusDeclarationObj.dcCustomsStatus === '3'">额外费用</el-button>
</el-row>
......@@ -156,7 +159,7 @@ import {
downloadFile,
} from "../utils";
import ImageUpload from "@/components/ImageUpload";
import Decimal from 'decimal.js'
import Decimal from "decimal.js";
/**
* 报关
......@@ -218,7 +221,7 @@ export default {
methods: {
getButtonLabel(documentInfo = []) {
const newList = Array.from(new Set(documentInfo));
return newList.length > 2 ? "混合报关" : "VGM声明";
return newList.length >= 2 ? "混合报关" : "VGM声明";
},
submitCustomsCreate(operateType) {
customsCreate({
......@@ -404,7 +407,7 @@ export default {
this.$set(
this.cusDeclarationObj,
"dcVgmWgt",
Decimal.add(dcBoxWgtTmp, dcGoodsWgtTmp)
Decimal.add(dcBoxWgtTmp, dcGoodsWgtTmp).toFixed(2)
);
},
// 审核详情
......@@ -439,6 +442,7 @@ export default {
if (
checkExamineStatus === 2 &&
dcCheckStatus === 2 &&
checkDealStatus === 0 &&
item.value === "1"
) {
return true;
......@@ -491,12 +495,16 @@ export default {
computed: {
/* 获取报关审核退场状态文字 */
getCheckExamineStatus() {
const { checkExamineStatus, customsInfo = {} } = this.shipmentObj;
const {
checkExamineStatus,
checkDealStatus,
customsInfo = {},
} = this.shipmentObj;
const { dcCheckStatus } = customsInfo;
if (checkExamineStatus === 1) {
return dcCheckStatus === 1 ? "退场审核中" : "部分退场审核中";
}
if (checkExamineStatus === 2) {
if (checkExamineStatus === 2 && checkDealStatus === 0) {
return dcCheckStatus === 1
? "审核通过,退场中"
: "审核通过,部分退场中";
......@@ -505,21 +513,57 @@ export default {
},
/* 判断是否已处理 */
isCheckDeal() {
return (type) => {
const {
checkExamineStatus,
checkDealStatus,
customsInfo = {},
} = this.shipmentObj;
const { dcCheckStatus } = customsInfo;
// 退场未处理不能操作
// 状态
if (type === "status") {
// 退场/部分退场 审核通过未处理,禁用
if (
checkExamineStatus === 2 &&
[1, 2].includes(dcCheckStatus) &&
checkDealStatus === 0
) {
return true;
}
}
// 查验
if (type === "check") {
// 退场 审核通过未处理,禁用
// 部分退场 审核通过未处理,由 disabledRadio 方法判断
if (
checkExamineStatus === 2 &&
dcCheckStatus === 1 &&
[1].includes(dcCheckStatus) &&
checkDealStatus === 0
) {
return true;
}
}
// 提交/保存
if (type === "submit") {
const { dcCheckStatus: newCheckStatus } = this.cusDeclarationObj;
// 退场/部分退场 审核通过未处理
if (checkExamineStatus === 2 && checkDealStatus === 0) {
// 退场,禁用
if (dcCheckStatus === 1) return true;
// 部分退场
if (dcCheckStatus === 2) {
// 修改为查验后放行,可用,其他禁用
if (newCheckStatus === "3") return false;
return true;
}
}
}
return false;
};
},
},
};
......
......@@ -100,7 +100,7 @@
<p>{{preList.remainWeight}}kg</p>
</div>
<div class="table-button">
<el-button type="success" size="small" @click="addPart">增加</el-button>
<el-button type="success" size="small" @click="addPart" :disabled="isAudit">增加</el-button>
</div>
</el-row>
<el-scrollbar style="height:calc(100% - 43px)">
......@@ -111,8 +111,8 @@
<p>{{getTotlContent(part.secStatistics)}}</p>
</div>
<div class="table-button">
<el-button type="danger" size="small" @click="deletePart(part)">删除部分</el-button>
<el-button type="danger" size="small" @click="deleteOrder('selected', part)">删除订单</el-button>
<el-button type="danger" size="small" @click="deletePart(part)" :disabled="isAudit">删除部分</el-button>
<el-button type="danger" size="small" @click="deleteOrder('selected', part)" :disabled="isAudit">删除订单</el-button>
<el-button type="primary" size="small" @click="foldTable(index, part)">{{part.fold ? '展开' : '收起'}}</el-button>
</div>
</el-row>
......@@ -157,13 +157,13 @@
</el-table-column>
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-dropdown trigger="click" @command="(command)=>handleGoods('singele',scope.row,command)">
<el-button type="primary" size="small" icon="el-icon-edit-outline" circle></el-button>
<el-dropdown trigger="click" @command="(command)=>handleGoods('single',scope.row,command)" :disabled="isAudit">
<el-button type="primary" size="small" icon="el-icon-edit-outline" circle :disabled="isAudit"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="bPart" v-for="(bPart, index) in preList.sectionGoodList" :key="bPart.id" v-show="bPart.id !== part.id">{{index+1}}部分</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="danger" size="small" icon="el-icon-minus" circle style="margin-left:10px;" @click="deleteOrder('row',scope.row)"></el-button>
<el-button type="danger" size="small" icon="el-icon-minus" circle style="margin-left:10px;" @click="deleteOrder('row',scope.row)" :disabled="isAudit"></el-button>
</template>
</el-table-column>
</el-table>
......@@ -220,8 +220,8 @@
</div>
<div class="table-button">
<el-dropdown trigger="click" @command="(command)=>handleGoods('all',item,command)">
<el-button type="success" size="small">预装全部</el-button>
<el-dropdown-menu slot="dropdown">
<el-button type="success" size="small" :disabled="isAudit">预装全部</el-button>
<el-dropdown-menu slot="dropdown" v-if="preList.sectionGoodList">
<el-dropdown-item :command="part" v-for="(part, index) in preList.sectionGoodList" :key="part.id">第{{index+1}}部分</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
......@@ -257,7 +257,7 @@
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-dropdown trigger="click" @command="(command)=>handleGoods('singele',scope.row,command)">
<el-dropdown trigger="click" @command="(command)=>handleGoods('single',scope.row,command)">
<el-button type="primary" size="small">预装</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="part" v-for="(part, index) in preList" :key="part.id">第{{index+1}}部分</el-dropdown-item>
......@@ -311,6 +311,7 @@ import {
deleteSection,
createGoods,
deleteGoods,
changeSection,
approvalCreate,
approvalCancel,
} from "@/api/ecw/boxSea";
......@@ -494,18 +495,22 @@ export default {
return;
}
if (column.property === "num") {
sums[index] = this.calcSum(column.property, data) ?? 0;
sums[index] = new Decimal(
this.calcSum(column.property, data)
).toNumber();
}
if (column.property === "volumeWeight") {
const volume = this.calcSum("volume", data);
const weight = this.calcSum("weight", data);
let volume = this.calcSum("volume", data);
let weight = this.calcSum("weight", data);
volume = volume === 0 ? volume : new Decimal(volume).toFixed(2);
weight = weight === 0 ? weight : new Decimal(weight).toFixed(2);
sums[index] = getTotlContent({ volume, weight }, [
"volume",
"weight",
]);
sums[index] = sums[index].replace(" ", "\n");
}
});
return sums;
},
/* 计算总和 */
......@@ -515,12 +520,13 @@ export default {
return values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return Decimal.add(prev, curr);
return prev + curr;
} else {
return prev;
}
}, 0);
}
return 0;
},
/* 待预装订单分页 */
pageChange(page) {
......@@ -558,23 +564,32 @@ export default {
},
/** 预装 */
handleGoods(type, item, part) {
if (type === "all") {
let params = {
secId: part.id,
shipmentId: this.shipmentObj.id,
orderId: item.orderId,
};
if (type === "all") {
params.orderItemIdList = item.boxOrderItemList.map(
orderItemIdList: item.boxOrderItemList.map(
(data) => data.orderItemId
);
} else {
params.orderItemIdList = [item.orderItemId];
}
),
};
createGoods(params).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
} else {
let params = {
secId: part.id,
id: item.id,
};
changeSection(params).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
}
},
/* 删除订单 */
deleteOrder(type, data) {
......@@ -735,6 +750,11 @@ export default {
.tobePre-row {
margin-top: 10px;
.el-table {
.cell {
white-space: pre-line;
}
}
}
}
}
......
......@@ -6,8 +6,8 @@
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="success" @click="onSubmit" :disabled="isReview">发起申请</el-button>
<el-button type="primary" @click="jumpReviewDetail" :disabled="!isReview">审核中</el-button>
<el-button type="success" @click="onSubmit" v-show="!isReview">发起申请</el-button>
<el-button type="primary" @click="jumpReviewDetail" v-show="isReview">审核中</el-button>
<el-button @click="cancel">关闭</el-button>
</el-row>
</div>
......
......@@ -46,7 +46,7 @@
</template>
</el-table-column>
<el-table-column label="箱数" align="center" prop="num" />
<el-table-column label="纸箱尺寸" align="center" prop="boxGauge">
<el-table-column label="纸箱尺寸" align="center" prop="warehouseInInfo.boxGauge">
</el-table-column>
<el-table-column label="体积" align="center" prop="volume">
</el-table-column>
......@@ -130,8 +130,14 @@ export default {
let list = [];
res.data.forEach((item) => {
item.orderItemList.forEach((oItem) => {
let warehouseInInfo = {};
if (oItem.warehouseInInfo) {
warehouseInInfo = JSON.parse(oItem.warehouseInInfo ?? {});
}
list.push({
...oItem,
warehouseInInfo,
positionNo: item.positionNo,
tallyStatus: item.tallyStatus,
tallyTime: item.tallyTime,
......
......@@ -329,7 +329,7 @@ export default {
let count = 0;
if (this.pageData.sectionOrderList) {
this.pageData.sectionOrderList.forEach((item) => {
count = Decimal.add(count, item.unloadNum);
count = Decimal.add(count, item.unloadNum).toNumber();
});
}
return count;
......
<template>
<div>
<el-form ref="errorForm" :model="errorObj" label-width="100px">
<el-form-item label="异常">
<el-radio-group v-model="errorObj.exceptionType ">
<el-form ref="errorForm" :model="errorObj" label-width="100px" :rules="rules">
<el-form-item label="异常" prop="exceptionType">
<el-radio-group v-model="errorObj.exceptionType">
<el-radio v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_UNLOADING_ERROR)" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
......@@ -11,7 +11,7 @@
<el-option v-for="(item, index) in goodsList" :key="index" :value="item.orderItemId" :label="item.prodTitleZh"></el-option>
</el-select>
</el-form-item>
<el-form-item label="件数">
<el-form-item label="件数" prop="productNum">
<el-input-number v-model="errorObj.productNum" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="异常详情">
......@@ -39,6 +39,11 @@ export default {
const { currRow } = this.$attrs;
return {
// 校验
rules: {
exceptionType: [{ required: true, message: "必填", trigger: "change" }],
productNum: [{ required: true, message: "必填", trigger: "change" }],
},
// 异常对象
errorObj: {
productId: currRow.goodsList[0].orderItemId,
......
......@@ -1415,10 +1415,14 @@ function getTotlContent(total, keys = ["num", "volume", "weight"]) {
content.push(`${total?.num ?? 0}`);
}
if (key === "volume") {
content.push(`${total?.volume ?? 0}m³`);
let volume = total?.volume ?? 0;
volume = volume === 0 ? volume : new Decimal(volume).toFixed(2);
content.push(`${volume}m³`);
}
if (key === "weight") {
content.push(`${total?.weight ?? 0}kg`);
let weight = total?.weight ?? 0;
weight = weight === 0 ? weight : new Decimal(weight).toFixed(2);
content.push(`${weight}kg`);
}
}
return content.join(" ");
......@@ -1437,13 +1441,22 @@ function sumStatistics(val) {
const { secStatistics } = item;
if (secStatistics) {
if (!Number.isNaN(Number(secStatistics.num))) {
count.num = Decimal.add(count.num, Number(secStatistics.num));
count.num = Decimal.add(
count.num,
Number(secStatistics.num)
).toNumber();
}
if (!Number.isNaN(Number(secStatistics.volume))) {
count.volume = Decimal.add(count.volume, Number(secStatistics.volume));
count.volume = Decimal.add(
count.volume,
Number(secStatistics.volume)
);
}
if (!Number.isNaN(Number(secStatistics.weight))) {
count.weight = Decimal.add(count.weight, Number(secStatistics.weight));
count.weight = Decimal.add(
count.weight,
Number(secStatistics.weight)
);
}
}
});
......
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