Commit 9e71f942 authored by huhaiqing's avatar huhaiqing

装柜功能开发

parent 688d28d8
...@@ -624,6 +624,34 @@ export function createApproval(data) { ...@@ -624,6 +624,34 @@ export function createApproval(data) {
}); });
} }
/**
* 订单详情
*
* @param {*} params
* @returns
*/
export function getOrderDetailByBoxNo(data) {
return request({
url: "/my/shipment/searchLoadOrderByBoxNo",
method: "post",
data,
});
}
/**
* 外部仓装柜
*
* @param {*} params
* @returns
*/
export function externalLoad(data) {
return request({
url: "/ecw/box-load-info/externalLoad",
method: "post",
data,
});
}
/***************************** 装柜 end **********************************/ /***************************** 装柜 end **********************************/
/***************************** 卸柜 start **********************************/ /***************************** 卸柜 start **********************************/
......
...@@ -175,7 +175,7 @@ export default { ...@@ -175,7 +175,7 @@ export default {
this.$set(this.dialogCfg, "visible", true); this.$set(this.dialogCfg, "visible", true);
}, },
makeBill(row) { makeBill(row) {
const { bookSeaInfo } = this.shipmentObj; // TODO zgDate需要返回
makeBillService({ makeBillService({
orderId: row.orderId, orderId: row.orderId,
zgDate: '2022-09-27', zgDate: '2022-09-27',
......
...@@ -68,10 +68,20 @@ export default { ...@@ -68,10 +68,20 @@ export default {
"ldBoxTime", "ldBoxTime",
"ldOutWarehouseTime", "ldOutWarehouseTime",
]); ]);
let pictures = oldData.ldPictures;
if (oldData.ldPictures) {
pictures = JSON.parse(oldData.ldPictures);
if (Array.isArray(pictures)) {
pictures = pictures.map((item) => item.url).join(",");
}
}
this.cabinetObj = { this.cabinetObj = {
...oldData, ...oldData,
ldWarehouseType: ldWarehouseType:
oldData.ldWarehouseType === 0 ? undefined : oldData.ldWarehouseType, oldData.ldWarehouseType === 0 ? undefined : oldData.ldWarehouseType,
ldPictures: pictures,
}; };
}, },
methods: { methods: {
...@@ -87,9 +97,20 @@ export default { ...@@ -87,9 +97,20 @@ export default {
return; return;
} }
} }
const { ldPictures } = this.cabinetObj;
let pictures = ldPictures?.split(",") ?? [];
// 兼容手机端数据结构
pictures = pictures.map((item) => {
return {
type: "image",
url: item,
};
});
cabinetCreate({ cabinetCreate({
shipmentId: this.$attrs.shipmentObj.id, shipmentId: this.$attrs.shipmentObj.id,
...this.cabinetObj, ...this.cabinetObj,
ldPictures: JSON.stringify(pictures),
operateType, operateType,
}).then((res) => { }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
......
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
{{shopForm.sum||0}} {{shopForm.sum||0}}
</el-form-item> </el-form-item>
<el-form-item label="放入箱数:" prop="num"> <el-form-item label="放入箱数:" prop="num">
<el-input-number v-model="shopForm.num" controls-position="right" :min="1" :max="shopForm.sum"></el-input-number> <el-input-number v-model="shopForm.num" controls-position="right" :min="0" :max="shopForm.sum"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="备注信息:"> <el-form-item label="备注信息:">
<el-input v-model="shopForm.remarks"></el-input> <el-input v-model="shopForm.remarks"></el-input>
...@@ -310,7 +310,7 @@ export default { ...@@ -310,7 +310,7 @@ export default {
let _total = 0; let _total = 0;
const { orderSplitItemBackVOList = [] } = this.splitData; const { orderSplitItemBackVOList = [] } = this.splitData;
orderSplitItemBackVOList.forEach((v) => { orderSplitItemBackVOList.forEach((v) => {
_total += Number(v.splitNum); _total += Number(v.num);
}); });
return _total; return _total;
}, },
...@@ -427,6 +427,7 @@ export default { ...@@ -427,6 +427,7 @@ export default {
}); });
}, },
addShop() { addShop() {
this.shopForm = {};
this.shopOpen = true; this.shopOpen = true;
}, },
changeProdTitleZh() { changeProdTitleZh() {
...@@ -434,7 +435,8 @@ export default { ...@@ -434,7 +435,8 @@ export default {
list = this.currRow.goodsList.filter( list = this.currRow.goodsList.filter(
(item) => item.prodTitleZh == this.shopForm.prodTitleZh (item) => item.prodTitleZh == this.shopForm.prodTitleZh
); );
this.shopForm.sum = list[0].num; this.shopForm.sum =
this.currRow.num - this.currRow.installNum - this.totalSplitNum();
this.shopForm.orderItemId = list[0].orderItemId; this.shopForm.orderItemId = list[0].orderItemId;
this.shopForm.prodTitleEn = list[0].prodTitleEn; this.shopForm.prodTitleEn = list[0].prodTitleEn;
}, },
...@@ -443,7 +445,9 @@ export default { ...@@ -443,7 +445,9 @@ export default {
list = this.orderData.orderItemVOList.filter( list = this.orderData.orderItemVOList.filter(
(item) => item.prodTitleEn == this.shopForm.prodTitleEn (item) => item.prodTitleEn == this.shopForm.prodTitleEn
); );
this.shopForm.sum = list[0].num; this.shopForm.sum =
this.currRow.num - this.currRow.installNum - this.totalSplitNum();
this.shopForm.orderItemId = list[0].orderItemId;
this.shopForm.prodTitleZh = list[0].prodTitleZh; this.shopForm.prodTitleZh = list[0].prodTitleZh;
}, },
shopAdd() { shopAdd() {
...@@ -457,6 +461,10 @@ export default { ...@@ -457,6 +461,10 @@ export default {
this.$message.error("放入箱数不能大于总箱数"); this.$message.error("放入箱数不能大于总箱数");
return; return;
} }
if (this.shopForm.num === 0) {
this.$message.error("放入箱数不能为0");
return;
}
let params = { let params = {
num: this.shopForm.num, num: this.shopForm.num,
...@@ -467,7 +475,6 @@ export default { ...@@ -467,7 +475,6 @@ export default {
createSplitItem(params).then((res) => { createSplitItem(params).then((res) => {
this.$message.success("放入成功"); this.$message.success("放入成功");
this.getSplit(); this.getSplit();
this.shopForm = {};
}); });
this.shopOpen = false; this.shopOpen = false;
} }
......
...@@ -188,13 +188,44 @@ ...@@ -188,13 +188,44 @@
</template> </template>
<!-- 装柜批量输入 --> <!-- 装柜批量输入 -->
<template v-if="dialogConfig.type === 'batchInput' && dialogConfig.dialogVisible"> <template v-if="dialogConfig.type === 'batchInput' && dialogConfig.dialogVisible">
<el-form ref="batchForm" :rules="rules" :model="batchObj" label-position="top"> <el-form ref="batchForm" :rules="rules" :model="batchObj">
<el-form-item label="" prop="qrCode"> <el-form-item label="" prop="qrCode" class="two-element">
<el-input type="textarea" :rows="3" v-model="batchObj.qrCode" placeholder="请输入,多个以逗号分隔" clearable /> <el-input v-model="batchObj.qrCode" placeholder="请输入订单号" clearable />
<el-button style="marginLeft:10px;" type="primary" @click="queryOrderInfo">确定</el-button>
</el-form-item> </el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="订单号">
{{boxOrderInfo.orderNo}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="箱数">
<el-input-number v-if="boxOrderInfo.isExternalWarehouse === 1" v-model="batchObj.boxNum" :min="0" :max="batchObj.boxNum" />
<template v-else>
{{batchObj.boxNum}}
</template>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="方数">
{{getTotlContent(boxOrderInfo, ['volume'])}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="重量">
{{getTotlContent(boxOrderInfo, ['weight'])}}
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-row class="operate-button"> <el-row class="operate-button">
<el-button type="primary" @click="onSubmit('batchForm')">提交</el-button> <el-button type="primary" :disabled="boxOrderInfo.orderId ? false : true" @click="batchLoad">提交</el-button>
<el-button @click="closeDialog2">取消</el-button> <el-button @click="closeDialog2">取消</el-button>
</el-row> </el-row>
</template> </template>
...@@ -219,6 +250,8 @@ import { ...@@ -219,6 +250,8 @@ import {
boxUpdate, boxUpdate,
approvalCreate, approvalCreate,
approvalCancel, approvalCancel,
getOrderDetailByBoxNo,
externalLoad,
} from "@/api/ecw/boxSea"; } from "@/api/ecw/boxSea";
import { import {
getTotlContent, getTotlContent,
...@@ -284,6 +317,8 @@ export default { ...@@ -284,6 +317,8 @@ export default {
// 当前行 // 当前行
currRow: {}, currRow: {},
selectedUsers: [], selectedUsers: [],
// 订单信息
boxOrderInfo: {},
}; };
}, },
created() { created() {
...@@ -357,6 +392,7 @@ export default { ...@@ -357,6 +392,7 @@ export default {
case "batchInput": case "batchInput":
this.$set(this.dialogConfig, "fullscreen", false); this.$set(this.dialogConfig, "fullscreen", false);
this.batchObj = {}; this.batchObj = {};
this.boxOrderInfo = {};
break; break;
case "correction": case "correction":
this.$set(this.dialogConfig, "fullscreen", false); this.$set(this.dialogConfig, "fullscreen", false);
...@@ -525,11 +561,53 @@ export default { ...@@ -525,11 +561,53 @@ export default {
}); });
}); });
}, },
/* 跳转详情 */
jumpReviewDetail() { jumpReviewDetail() {
const { cabinetApprovalInfo } = this.shipmentObj; const { cabinetApprovalInfo } = this.shipmentObj;
toReviewDetail.apply(this, [cabinetApprovalInfo.bpmProcessId]); toReviewDetail.apply(this, [cabinetApprovalInfo.bpmProcessId]);
this.$emit("closeDialog1", "close"); this.$emit("closeDialog1", "close");
}, },
queryOrderInfo() {
this.$refs["batchForm"].validate((valid) => {
if (valid) {
getOrderDetailByBoxNo({
orderNumCode: this.batchObj.qrCode,
shipmentId: this.shipmentObj.id,
}).then((res) => {
const { data } = res;
this.boxOrderInfo = data;
this.batchObj.boxNum = data.num - data.installNum;
});
}
});
},
batchLoad() {
if (!this.boxOrderInfo.orderId) {
this.$message.error("请输入订单号");
return;
}
if (this.batchObj.boxNum === 0) {
this.$message.error("箱数不能为0");
return;
}
let params = {
boxNum: this.boxOrderInfo.num,
orderId: this.boxOrderInfo.orderId,
orderNo: this.boxOrderInfo.orderNo,
shipmentId: this.shipmentObj.id,
};
if (this.boxOrderInfo.isExternalWarehouse === 1) {
params.boxNum = this.batchObj.boxNum;
}
externalLoad(params).then((res) => {
serviceMsg(res, this).then(() => {
this.closeDialog2();
this.boxOrderInfo = {};
this.getLoadSecGoodsList();
});
});
},
}, },
computed: { computed: {
/* 是否审核中 */ /* 是否审核中 */
......
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