Commit 9e71f942 authored by huhaiqing's avatar huhaiqing

装柜功能开发

parent 688d28d8
......@@ -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 **********************************/
/***************************** 卸柜 start **********************************/
......
......@@ -175,7 +175,7 @@ export default {
this.$set(this.dialogCfg, "visible", true);
},
makeBill(row) {
const { bookSeaInfo } = this.shipmentObj;
// TODO zgDate需要返回
makeBillService({
orderId: row.orderId,
zgDate: '2022-09-27',
......
......@@ -68,10 +68,20 @@ export default {
"ldBoxTime",
"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 = {
...oldData,
ldWarehouseType:
oldData.ldWarehouseType === 0 ? undefined : oldData.ldWarehouseType,
ldPictures: pictures,
};
},
methods: {
......@@ -87,9 +97,20 @@ export default {
return;
}
}
const { ldPictures } = this.cabinetObj;
let pictures = ldPictures?.split(",") ?? [];
// 兼容手机端数据结构
pictures = pictures.map((item) => {
return {
type: "image",
url: item,
};
});
cabinetCreate({
shipmentId: this.$attrs.shipmentObj.id,
...this.cabinetObj,
ldPictures: JSON.stringify(pictures),
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
......
......@@ -196,7 +196,7 @@
{{shopForm.sum||0}}
</el-form-item>
<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 label="备注信息:">
<el-input v-model="shopForm.remarks"></el-input>
......@@ -310,7 +310,7 @@ export default {
let _total = 0;
const { orderSplitItemBackVOList = [] } = this.splitData;
orderSplitItemBackVOList.forEach((v) => {
_total += Number(v.splitNum);
_total += Number(v.num);
});
return _total;
},
......@@ -427,6 +427,7 @@ export default {
});
},
addShop() {
this.shopForm = {};
this.shopOpen = true;
},
changeProdTitleZh() {
......@@ -434,7 +435,8 @@ export default {
list = this.currRow.goodsList.filter(
(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.prodTitleEn = list[0].prodTitleEn;
},
......@@ -443,7 +445,9 @@ export default {
list = this.orderData.orderItemVOList.filter(
(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;
},
shopAdd() {
......@@ -457,6 +461,10 @@ export default {
this.$message.error("放入箱数不能大于总箱数");
return;
}
if (this.shopForm.num === 0) {
this.$message.error("放入箱数不能为0");
return;
}
let params = {
num: this.shopForm.num,
......@@ -467,7 +475,6 @@ export default {
createSplitItem(params).then((res) => {
this.$message.success("放入成功");
this.getSplit();
this.shopForm = {};
});
this.shopOpen = false;
}
......
......@@ -188,13 +188,44 @@
</template>
<!-- 装柜批量输入 -->
<template v-if="dialogConfig.type === 'batchInput' && dialogConfig.dialogVisible">
<el-form ref="batchForm" :rules="rules" :model="batchObj" label-position="top">
<el-form-item label="" prop="qrCode">
<el-input type="textarea" :rows="3" v-model="batchObj.qrCode" placeholder="请输入,多个以逗号分隔" clearable />
<el-form ref="batchForm" :rules="rules" :model="batchObj">
<el-form-item label="" prop="qrCode" class="two-element">
<el-input v-model="batchObj.qrCode" placeholder="请输入订单号" clearable />
<el-button style="marginLeft:10px;" type="primary" @click="queryOrderInfo">确定</el-button>
</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-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-row>
</template>
......@@ -219,6 +250,8 @@ import {
boxUpdate,
approvalCreate,
approvalCancel,
getOrderDetailByBoxNo,
externalLoad,
} from "@/api/ecw/boxSea";
import {
getTotlContent,
......@@ -284,6 +317,8 @@ export default {
// 当前行
currRow: {},
selectedUsers: [],
// 订单信息
boxOrderInfo: {},
};
},
created() {
......@@ -357,6 +392,7 @@ export default {
case "batchInput":
this.$set(this.dialogConfig, "fullscreen", false);
this.batchObj = {};
this.boxOrderInfo = {};
break;
case "correction":
this.$set(this.dialogConfig, "fullscreen", false);
......@@ -525,11 +561,53 @@ export default {
});
});
},
/* 跳转详情 */
jumpReviewDetail() {
const { cabinetApprovalInfo } = this.shipmentObj;
toReviewDetail.apply(this, [cabinetApprovalInfo.bpmProcessId]);
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: {
/* 是否审核中 */
......
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