Commit 33211bf4 authored by zhoutong's avatar zhoutong

空运暂存

parent b6692430
......@@ -17,3 +17,26 @@ export function updatebox(data) {
data: data,
});
}
/**
* 订舱
*
* @export
* @param {*} data
* @return {*}
*/
export function booking(data) {
if (data.id) {
return request({
url: "/shipment/box-book-air/update",
method: "put",
data,
});
}
return request({
url: "/shipment/box-book-air/create",
method: "post",
data,
});
}
\ No newline at end of file
......@@ -466,6 +466,28 @@ export const constantRoutes = [
}
]
},
{
path: '/boxAir',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'query/:shipmentId(\\d+)',
component: (resolve) => import('@/views/ecw/box/query'),
props: true,
name: 'shippingDetail',
meta: {titleZh: '出货详情', titleEn: "Shipping Details", icon: '', activeMenu: '/shipment/boxDetail'}
},
{
path: 'shippingAir/:shipmentId(\\d+)',
component: (resolve) => import('@/views/ecw/box/shippingAir/shippingAir'),
props: true,
name: 'shippingAir',
meta: {titleZh: '空运出货操作', titleEn: "Ocean shipment operation", icon: '', activeMenu: '/shipment/boxAir'}
}
]
},
]
// 防止连续点击多次路由报错
......
......@@ -101,8 +101,6 @@ export default {
return
}
this.form.transportType = 4
// 修改的提交
if (this.form.id != null) {
updatebox(this.form).then((response) => {
......
......@@ -341,45 +341,21 @@ export default {
this.$set(this.dialogCfg, 'fullscreen', false)
this.$set(this.dialogCfg, 'open', true)
this.currRow = {
transportType: '1'
transportType: '3'
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id
const id = row.id;
getbox(id).then((response) => {
this.form = response.data
this.open = true
this.title = this.$t('修改出货')
})
this.currRow = response.data;
this.$set(this.dialogCfg, "title", this.$t("修改出货"));
this.$set(this.dialogCfg, "dialogType", "edit");
this.$set(this.dialogCfg, "width", "600px");
this.$set(this.dialogCfg, "open", true);
});
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (!valid) {
return
}
this.form.transportType = 3
// 修改的提交
if (this.form.id != null) {
updatebox(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('修改成功'))
this.open = false
this.getList()
})
return
}
// 添加的提交
createbox(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('新增成功'))
this.open = false
this.getList()
})
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id
......@@ -417,8 +393,8 @@ export default {
/** 查看按钮操作 */
handleCommand(row, command) {
switch (command) {
case 'sea':
this.$router.push('/box/shippingSea/' + row.id)
case 'air':
this.$router.push('/boxAir/shippingAir/' + row.id)
break
case 'edit':
......
<template>
<div>
<el-form ref="agentForm" :model="agentObj" :rules="rules" label-width="120px">
<el-form-item :label="$t('代理商Agent')" prop="agentId">
<supplierSelect v-model="agentObj.agentId" :companyType="'1'" :areaType="1" :placeholder="$t('请选择代理商')" :allSupplier="this.$attrs.allSupplier" />
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="success" @click="onSubmit">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { agentSet } from "@/api/ecw/boxSea";
import supplierSelect from "./common/supplierSelect.vue";
import { formatStringNumber, serviceMsg } from "../utils";
/**
* agent
*/
export default {
name: "agent",
inheritAttrs: false,
components: { supplierSelect },
data() {
return {
// agent对象
agentObj: {},
// 校验
rules: {
agentId: [{ required: true, message: this.$t("必填"), trigger: "change" }],
},
};
},
created() {
const { currNode, shipmentObj } = this.$attrs;
const voName = currNode.voName;
let oldData = { ...shipmentObj[voName] };
oldData = formatStringNumber(oldData, ["agentId"]);
this.agentObj = oldData;
},
methods: {
/** 提交 */
onSubmit() {
this.$refs["agentForm"].validate((valid) => {
if (valid) {
agentSet({
shipmentId: this.$attrs.shipmentObj.id,
...this.agentObj,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-form ref="arrivalForm" :rules="rules" :model="arrivalObj" label-width="120px">
<el-form-item :label="$t('预计到港时间')">{{getExpectedTime()}}</el-form-item>
<el-form-item :label="$t('实际到港时间')" prop="apRealTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apRealTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('确认到港')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apConfirmTime" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
<p class="message-area" v-show="showMsg">{{$t('请确认是否有异常,如有异常请进行异常登记')}}</p>
</el-form-item>
<el-form-item :label="$t('卸港时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apUnloadPortTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!showMsg">{{$t('异常登记')}}</el-button>
</el-row>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="dialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="regCloseDialog" v-bind="$attrs" />
</el-dialog>
</div>
</template>
<script>
import regError from "../../regError";
import dayjs from "dayjs";
import { arrivalCreate } from "@/api/ecw/boxSea";
import { formatDateStr, serviceMsg } from "../utils";
/**
* 到港
*/
export default {
name: "arrival",
inheritAttrs: false,
components: {
regError,
},
data() {
return {
// 到港对象
arrivalObj: {},
// 校验
rules: {
apRealTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
// 弹窗配置
dialogVisible: false,
// 提示消息
showMsg: false,
inspectionTimeArrival: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_ARRIVAL
)[0].value,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(
oldData,
["apRealTime", "apConfirmTime"],
"YYYY-MM-DD HH:mm:ss"
);
oldData = formatDateStr(oldData, ["apUnloadPortTime"]);
this.arrivalObj = oldData;
},
watch: {
// 确认到港时间
"arrivalObj.apConfirmTime"(val) {
this.compareDate(this.getExpectedTime(), val);
},
},
methods: {
regCloseDialog(type) {
this.dialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 获取预计到港时间
getExpectedTime() {
const { shippingInfo } = this.$attrs.shipmentObj;
if (shippingInfo) {
return dayjs(shippingInfo.dtEstArrivalTime).format(
"YYYY-MM-DD HH:mm:ss"
);
}
return null;
},
// 时间比较
compareDate(expectedTime, apConfirmTime) {
this.showMsg = false;
let date1 = null,
date2 = null;
if (expectedTime) date1 = dayjs(expectedTime);
if (apConfirmTime) date2 = dayjs(apConfirmTime);
if (date1 && date2) {
const days = date2.diff(date1, "day");
if (days > this.inspectionTimeArrival) {
this.showMsg = true;
}
}
},
// 异常登记
exceptionReg() {
this.dialogVisible = true;
},
/** 提交 */
onSubmit(operateType) {
this.$refs["arrivalForm"].validate((valid) => {
if (valid) {
arrivalCreate({
...this.arrivalObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
.message-area {
margin: 0;
color: red;
}
</style>
<template>
<div>
<el-form ref="bargeForm" :model="bargeObj" :rules="rules" label-width="80px">
<el-form-item :label="$t('驳船')" prop="bgExmtStatus">
<el-radio-group v-model="bargeObj.bgExmtStatus">
<el-radio v-for="item in bargeStatus" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<div v-show="bargeObj.bgExmtStatus === '2'">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('驳船预计开船时间')" label-width="130px">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="bargeObj.bgEstShipTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('通知人')" label-width="80px">
<userSelect v-model="bargeObj.notifyUser" :placeholder="$t('请选择通知人')" :allUsers="this.$attrs.allUsers" />
</el-form-item>
</el-col>
</el-row>
<el-form-item :label="$t('驳船实际开船时间')" label-width="130px">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="bargeObj.bgRealShipTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</div>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { bargeCreate } from "@/api/ecw/boxSea";
import userSelect from "./common/userSelect.vue";
import { constantDict, formatDateStr, formatNumberString, serviceMsg } from "../utils";
/**
* 驳船
*/
export default {
name: "barge",
inheritAttrs: false,
components: { userSelect },
data() {
return {
// 驳船对象
bargeObj: {},
// 驳船状态
bargeStatus: constantDict.bgExmtStatus,
// 校验
rules: {
bgExmtStatus: [{ required: true, message: this.$t("必填"), trigger: "change" }],
},
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["bgEstShipTime", "bgRealShipTime"]);
oldData = formatNumberString(oldData, ["bgExmtStatus"]);
this.bargeObj = oldData;
},
methods: {
/** 提交 */
onSubmit(operateType) {
this.$refs["bargeForm"].validate((valid) => {
if (valid) {
bargeCreate({
...this.bargeObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-form ref="blCopyForm" :model="blCopyObj" label-width="120px">
<el-form-item :label="$t('提单Copy')">
<FileUpload :limit="1" :isShowTip=false v-model="blCopyObj.copyUrl" :fileType="fileType" />
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { ladingCopyCreate } from "@/api/ecw/boxSea";
import FileUpload from "@/components/FileUpload";
import { fileTypes, serviceMsg } from "../utils";
/**
* 提单copy
*/
export default {
name: "blCopy",
inheritAttrs: false,
components: { FileUpload },
data() {
return {
// 提单copy对象
blCopyObj: {},
// 文件格式
fileType: fileTypes,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
this.blCopyObj = oldData;
},
methods: {
/** 提交 */
onSubmit(operateType) {
this.$refs["blCopyForm"].validate((valid) => {
if (valid) {
ladingCopyCreate({
...this.blCopyObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-form ref="bookingForm" :rules="rules" :model="bookingObj" label-width="140px">
<el-form-item :label="$t('提单号')">
<el-input v-model="bookingObj.blNo" :placeholder="$t('请输入提单号')"></el-input>
</el-form-item>
<el-form-item :label="$t('起运港')">
<dockSelect v-model="bookingObj.departurePortId" :placeholder="$t('请选择起运港')" portType="2" :allDocks="this.$attrs.allDocks" />
</el-form-item>
<el-form-item :label="$t('目的港')">
<dockSelect v-model="bookingObj.destPortId" :placeholder="$t('请选择目的港')" portType="2" :allDocks="this.$attrs.allDocks" />
</el-form-item>
<el-form-item :label="$t('Shipper')">
<supplierSelect v-model="bookingObj.shipperId" :companyType="'5'" :placeholder="$t('请选择Shipper')" :allSupplier="this.$attrs.allSupplier" />
</el-form-item>
<el-form-item :label="$t('航空公司')">
<supplierSelect v-model="bookingObj.airlineCompanyId" :companyType="'7'" :placeholder="$t('请选择航空公司')" :allSupplier="this.$attrs.allSupplier" />
</el-form-item>
<el-form-item :label="$t('预计起飞时间')" prop="flyTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" value-format="yyyy-MM-dd HH:mm:ss" v-model="bookingObj.flyTime"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('截关时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" value-format="yyyy-MM-dd HH:mm:ss" v-model="bookingObj.closingTime"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('截补料时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" value-format="yyyy-MM-dd HH:mm:ss" v-model="bookingObj.replenishmentTime"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('航程')" prop="voyage">
<el-radio-group v-model="bookingObj.voyage">
<el-radio v-for="item in voyageData" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('截止送货时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" value-format="yyyy-MM-dd HH:mm:ss" v-model="bookingObj.deliveryTime"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<el-select v-model="bookingObj.airlineTypeId" :placeholder="$t('请选择出货渠道')">
<el-option v-for="item in channelList" :label="$l(item, 'name')" :value="item.channelId" :key="item.channelId"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { booking } from "@/api/ecw/boxAir";
import supplierSelect from "./common/supplierSelect.vue";
import dockSelect from "./common/dockSelect.vue";
import userSelect from "./common/userSelect.vue";
import { formatStringNumber, formatDateStr, serviceMsg, constantDict } from "../utils";
import { getChannelList } from '@/api/ecw/channel'
/**
* 订舱
*/
export default {
name: "booking",
inheritAttrs: false,
components: {
supplierSelect,
dockSelect,
userSelect,
},
props: {
shipmentObj: Object,
},
data() {
return {
// 订舱对象
bookingObj: {},
channelList: [],
voyageData: constantDict.voyageData,
// 校验
rules: {
flyTime: [{ required: true, message: this.$t("必填"), trigger: "change" }],
voyage: [{ required: true, message: this.$t("必填"), trigger: "change" }],
},
};
},
created() {
getChannelList().then((res) => (this.channelList = res.data))
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.shipmentObj[voName] };
oldData = formatStringNumber(oldData, ["shipCompanyType", "spaceCompany"]);
oldData = formatDateStr(oldData, [
"flyTime",
"closingTime",
"replenishmentTime",
"deliveryTime"
]);
this.bookingObj = oldData;
},
methods: {
/** 提交 */
onSubmit() {
this.$refs["bookingForm"].validate((valid) => {
if (valid) {
booking({
shipmentId: this.shipmentObj.id,
...this.bookingObj,
operateType: 2,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<template>
<div>
<el-form ref="cabinetForm" :rules="rules" :model="cabinetObj" label-width="80px">
<el-form-item :label="$t('到仓时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cabinetObj.ldInWarehouseTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('仓库')">
<el-select v-model="cabinetObj.ldWarehouseType" :placeholder="$t('请选择仓库')" filterable>
<el-option v-for="warehouse in $attrs.warehouseList" :key="warehouse.id" :label="$l(warehouse,'title')" :value="warehouse.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('装柜时间')" prop="ldBoxTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cabinetObj.ldBoxTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('出仓时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cabinetObj.ldOutWarehouseTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('装柜图片')">
<ImageUpload :limit="1" :isShowTip=false v-model="cabinetObj.ldPictures" />
</el-form-item>
</el-form>
<!-- 开始装柜 -->
<el-dialog :title="$t('开始装柜')" :visible.sync="dialogVisible" fullscreen :modal-append-to-body=false append-to-body>
<startPacking v-bind="$attrs" v-if="dialogVisible" v-on="$listeners" @closeDialog1="closeDialog1" />
</el-dialog>
<!-- 操作 -->
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)" :disabled="isSeal">{{$t('封柜')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="danger" @click="startCabinet" :disabled="isStartCabinet">{{$t('开始装柜')}}</el-button>
</el-row>
</div>
</template>
<script>
import startPacking from "./startPacking.vue";
import { cabinetCreate } from "@/api/ecw/boxSea";
import { formatDateStr, serviceMsg } from "../../utils";
import ImageUpload from "@/components/ImageUpload";
/**
* 装柜
*/
export default {
name: "cabinet",
inheritAttrs: false,
components: { startPacking, ImageUpload },
data() {
return {
// 弹窗
dialogVisible: false,
// 装柜对象
cabinetObj: {},
// 校验
rules: {
ldBoxTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, [
"ldInWarehouseTime",
"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: {
/** 提交 */
onSubmit(operateType) {
this.$refs["cabinetForm"].validate((valid) => {
if (valid) {
if (operateType === 2) {
const { currNode, shipmentObj } = this.$attrs;
const status = shipmentObj[currNode.keyName];
if (status !== 46) {
this.$message.error(this.$t("请先进行装柜->审批->确认封柜"));
return;
}
}
const { ldPictures } = this.cabinetObj;
let pictures = ldPictures?.split(",") ?? [];
let newPictures = [];
for (const item of pictures) {
if (item) {
newPictures.push({
type: "image",
url: item,
});
}
}
cabinetCreate({
shipmentId: this.$attrs.shipmentObj.id,
...this.cabinetObj,
ldPictures: newPictures.length ? JSON.stringify(newPictures) : "",
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
closeDialog1(type) {
this.dialogVisible = false;
if (type) this.cancel(type);
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
/** 开始装柜 */
startCabinet() {
this.dialogVisible = true;
},
},
computed: {
isStartCabinet() {
const { currNode, shipmentObj } = this.$attrs;
const status = shipmentObj[currNode.keyName];
return [46, 47].includes(status) ? true : false;
},
isSeal() {
const { currNode, shipmentObj } = this.$attrs;
const status = shipmentObj[currNode.keyName];
return status === 47 ? true : false;
},
},
};
</script>
<style lang="scss" scoped>
</style>
This diff is collapsed.
<template>
<div>
<el-form ref="cDocForm" :model="cDocObj" label-width="100px">
<el-form-item :label="$t('出单方式')">
<el-select v-model="cDocObj.cdOutBillType" :placeholder="$t('请选择出单方式')">
<el-option v-for="item in method" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<template v-if="cDocObj.cdOutBillType === '1'">
<el-form-item :label="$t('电放时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cDocObj.cdElectricTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('电放凭证附件')">
<FileUpload :limit="1" :isShowTip=false v-model="cDocObj.cdElectricVoucher" :fileType="fileType" />
</el-form-item>
</template>
<template v-if="cDocObj.cdOutBillType === '2'">
<el-form-item :label="$t('寄送时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cDocObj.cdSendTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('快递单号')">
<el-input v-model="cDocObj.cdBillNo" :placeholder="$t('请输入快递单号')"></el-input>
</el-form-item>
</template>
<el-form-item label="agent list">
<el-radio-group v-model="cDocObj.cdAgentlistType">
<el-radio v-for="item in status" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cDocObj.cdAgentlistTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item>
<FileUpload :limit="1" :isShowTip=false v-model="cDocObj.cdAgentlistFile" :fileType="fileType" />
</el-form-item>
<el-form-item label="soncap">
<el-radio-group v-model="cDocObj.cdSoncapType">
<el-radio v-for="item in status" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cDocObj.cdSoncapTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item>
<FileUpload :limit="1" :isShowTip=false v-model="cDocObj.cdSoncapFile" :fileType="fileType" />
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { clearanceDocCreate } from "@/api/ecw/boxSea";
import {
constantDict,
formatDateStr,
formatNumberString,
fileTypes,
serviceMsg,
} from "../utils";
import FileUpload from "@/components/FileUpload";
/**
* 清关文件
*/
export default {
name: "clrDocument",
inheritAttrs: false,
components: { FileUpload },
data() {
return {
// 清关文件对象
cDocObj: {},
// 出单方式
method: constantDict.billingMethod,
// 选项
status: constantDict.isFile,
// 文件类型
fileType: fileTypes,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, [
"cdElectricTime",
"cdSendTime",
"cdAgentlistTime",
"cdSoncapTime",
]);
oldData = formatNumberString(oldData, [
"cdOutBillType",
"cdAgentlistType",
"cdSoncapType",
]);
this.cDocObj = {
...oldData,
cdOutBillType:
oldData.cdOutBillType === 0 ? undefined : oldData.cdOutBillType,
};
if(!this.$attrs.shipmentObj.clearanceDocInfo){
this.$set(this.cDocObj,'cdOutBillType',this.$attrs.shipmentObj.clearanceDocInfo?.cdOutBillType||undefined)
}
},
methods: {
/** 提交 */
onSubmit(operateType) {
this.$refs["cDocForm"].validate((valid) => {
if (valid) {
clearanceDocCreate({
...this.cDocObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
</style>
<template>
<el-select filterable :value="value === 0 ? undefined : value" @change="change" v-bind="$attrs" clearable>
<el-option v-for="dock in getDock" :key="dock.id" :label="$l(dock, 'title')" :value="dock.id"></el-option>
</el-select>
</template>
<script>
/**
* 码头
*/
export default {
name: "dockSelect",
inheritAttrs: false,
props: {
value: Number,
allDocks: Array,
portType: String
},
model: {
prop: "value",
event: "change",
},
data() {
return {};
},
computed: {
getDock() {
if(!this.portType) return this.allDocks;
return this.allDocks.filter(item=>item.portType==this.portType)
},
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
<template>
<el-select filterable :value="company === 0 ? undefined : company" @change="change" v-bind="$attrs" clearable>
<el-option v-for="user in getUser" :key="user.id" :value="user.id" :label="$l(user, 'company')"></el-option>
</el-select>
</template>
<script>
/**
* 用户
*/
export default {
name: "userSelect",
inheritAttrs: false,
props: {
value: Number | Array,
allUsers: Array,
},
model: {
prop: "value",
event: "change",
},
data() {
return {};
},
computed: {
getUser() {
this.allUsers.forEach(element => {
if(!element.companyEn) {
element.companyEn = element.companyZh
}
});
return this.allUsers;
},
company: {
get() {
return this.value
},
set(val) {
this.$emit("change", val);
}
}
},
created() {
this.company = this.value
let com = this.getUser.findIndex(item=>item.id==this.company)
if(com == -1){
this.company = 0
}
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
<template>
<el-select
filterable
:value="value === 0 ? undefined : value"
@change="change"
v-bind="$attrs"
clearable
>
<el-option
v-for="supplier in getSuppliers"
:key="supplier.id"
:label="$l(supplier, 'company')"
:value="supplier.id"
></el-option>
</el-select>
</template>
<script>
/**
* 供应商
*/
export default {
name: "supplierSelect",
props: {
companyType: String,
value: Number,
allSupplier: Array,
areaType: {
type: Number,
default: 0
},
},
model: {
prop: "value",
event: "change",
},
data() {
return {};
},
computed: {
getSuppliers() {
let allSupplier = this.allSupplier.filter(
(item) => item.areaType == this.areaType
);
if(this.areaType == 1 || !this.companyType) return allSupplier;
return allSupplier.filter((item) =>
item.companyTypes.includes(this.companyType)
);
},
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
<template>
<el-select filterable :value="value === 0 ? undefined : value" @change="change" v-bind="$attrs" clearable>
<el-option v-for="user in getUser" :key="user.id" :value="user.id" :label="user.nickname"></el-option>
</el-select>
</template>
<script>
/**
* 用户
*/
export default {
name: "userSelect",
inheritAttrs: false,
props: {
value: Number | Array,
allUsers: Array,
},
model: {
prop: "value",
event: "change",
},
data() {
return {};
},
computed: {
getUser() {
return this.allUsers;
},
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
<template>
<div>
<el-form ref="cusClearanceForm" :rules="rules" :model="cusClearanceObj" label-width="120px">
<el-form-item :label="$t('清关代理')">{{getClAgent('label')}}</el-form-item>
<el-form-item :label="$t('预计清关时间')" prop="clEstTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusClearanceObj.clEstTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('清关时间')" prop="clClearTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusClearanceObj.clClearTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<p class="message-area" v-show="showMsg">{{$t('清关时间与预计时间不符,如有异常请登记')}}</p>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!showMsg">{{$t('异常登记')}}</el-button>
</el-row>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="dialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="dialogVisible = false" v-bind="$attrs" />
</el-dialog>
</div>
</template>
<script>
import regError from "../../regError";
import dayjs from "dayjs";
import { clearanceCreate } from "@/api/ecw/boxSea";
import { formatDateStr, serviceMsg } from "../utils";
/**
* 清关
*/
export default {
name: "cusClearance",
inheritAttrs: false,
components: {
regError,
},
data() {
return {
// 清关对象
cusClearanceObj: {},
// 校验
rules: {
clEstTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
clClearTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
// 弹窗配置
dialogVisible: false,
// 提示消息
showMsg: false,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["clEstTime"]);
oldData = formatDateStr(oldData, ["clClearTime"], "YYYY-MM-DD HH:mm:ss");
this.cusClearanceObj = oldData;
},
watch: {
// 预计清关时间
"cusClearanceObj.clEstTime"(val) {
this.compareDate(val, this.cusClearanceObj.clClearTime);
},
// 清关时间
"cusClearanceObj.clClearTime"(val) {
this.compareDate(this.cusClearanceObj.clEstTime, val);
},
},
methods: {
getClAgent(type) {
const agentId = this.$attrs.shipmentObj.agentInfo.agentId;
if (type === "label") {
const selected = this.$attrs.allSupplier.find(
(item) => item.id === agentId
);
return this.$l(selected, "company") ?? agentId;
}
return agentId;
},
// 时间比较
compareDate(clEstTime, clClearTime) {
this.showMsg = false;
let date1 = null,
date2 = null;
if (clEstTime) date1 = dayjs(clEstTime);
if (clClearTime) date2 = dayjs(clClearTime);
if (date1 && date2 && !date2.isSame(date1)) {
this.showMsg = true;
}
},
// 异常登记
exceptionReg() {
this.dialogVisible = true;
},
/** 提交 */
onSubmit(operateType) {
this.$refs["cusClearanceForm"].validate((valid) => {
if (valid) {
clearanceCreate({
...this.cusClearanceObj,
shipmentId: this.$attrs.shipmentObj.id,
clAgentId: this.getClAgent(),
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
.message-area {
margin: 0;
color: red;
}
</style>
This diff is collapsed.
<template>
<div class="app-departure">
<el-form ref="departureForm" :rules="rules" :model="departureObj" label-width="120px">
<el-form-item :label="$t('预计开船时间')">
{{getSailingTime()}}
</el-form-item>
<el-form-item :label="$t('实际开船时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="departureObj.dtRealShipTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<p class="message-area">{{$t('订单状态与短信通知,将到指定时间更新与发送')}}</p>
<p class="message-area" v-show="showMsg">{{$t('实际开船实际与预计时间不符')}}</p>
</el-form-item>
<el-form-item :label="$t('预期到港时间')" prop="dtEstArrivalTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="departureObj.dtEstArrivalTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!isShowError">{{$t('异常登记')}}</el-button>
</el-row>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="dialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="regCloseDialog" v-bind="$attrs" />
</el-dialog>
</div>
</template>
<script>
import regError from "../../regError";
import { shippingCreate } from "@/api/ecw/boxSea";
import dayjs from "dayjs";
import { formatDateStr, serviceMsg } from "../utils";
/**
* 起运
*/
export default {
name: "departure",
inheritAttrs: false,
components: { regError },
data() {
return {
// 起运对象
departureObj: {},
// 校验
rules: {
dtEstArrivalTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
// 弹窗配置
dialogVisible: false,
// 提示消息
showMsg: false,
// 异常登记
isShowError: false,
inspectionTimeShipping: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_SHIPPING
)[0].value,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["dtRealShipTime"], "YYYY-MM-DD HH:mm:ss");
oldData = formatDateStr(oldData, ["dtEstArrivalTime"]);
this.departureObj = oldData;
},
watch: {
// 实际开船时间
"departureObj.dtRealShipTime"(val) {
this.compareDate(val, this.getSailingTime());
this.compareDate1(val, this.getSailingTime());
},
},
methods: {
regCloseDialog(type) {
this.dialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 时间比较
compareDate(dtRealShipTime, sailTime) {
this.showMsg = false;
let date1 = null,
date2 = null;
if (dtRealShipTime) date1 = dayjs(dtRealShipTime);
if (sailTime) date2 = dayjs(sailTime);
if (date1 && date2 && date1.isAfter(date2)) {
this.showMsg = true;
}
},
compareDate1(dtRealShipTime, sailTime) {
this.isShowError = false;
let date1 = null,
date2 = null;
if (dtRealShipTime) date1 = dayjs(dtRealShipTime);
if (sailTime) date2 = dayjs(sailTime);
if (date1 && date2) {
const delayDay = date1.diff(date2, "day");
if (delayDay >= this.inspectionTimeShipping) this.isShowError = true;
}
},
// 异常登记
exceptionReg() {
this.dialogVisible = true;
},
/** 提交 */
onSubmit(operateType) {
this.$refs["departureForm"].validate((valid) => {
if (valid) {
shippingCreate({
...this.departureObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
// 预计开船时间
getSailingTime() {
return dayjs(this.$attrs.shipmentObj.bookSeaInfo.sailTime).format(
"YYYY-MM-DD HH:mm:ss"
);
},
},
};
</script>
<style lang="scss" scoped>
.app-departure {
.message-area {
margin: 0;
color: red;
}
}
</style>
This diff is collapsed.
<template>
<div>
<el-form ref="reviewForm" :model="reviewObj" label-width="120px">
<el-form-item :label="$t('申请理由')">
<el-input v-model="reviewObj.applyReason" type="textarea" rows="2" :placeholder="$t('请输入申请理由')" :disabled="isReview"></el-input>
</el-form-item>
<span v-if="voKey=='preInstallBackInfo'" style="color: red;margin-left: 120px;">{{$t('请注意,预装反审后,全部提单需重新制作')}}</span>
</el-form>
<el-row class="operate-button">
<el-button type="success" @click="onSubmit" v-show="!isReview">{{$t('发起申请')}}</el-button>
<el-button type="primary" @click="jumpReviewDetail" v-show="isReview">{{$t('审核中')}}</el-button>
<el-button plain type="primary" @click="canclAudit" v-show="isReview">{{$t('取消审核')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { approvalCreate, approvalCancel } from "@/api/ecw/boxSea";
import { serviceMsg, toReviewDetail } from "../utils";
/**
* 反审
*/
export default {
name: "review",
inheritAttrs: false,
data() {
return {
// 反审对象
reviewObj: {},
isReview: false,
bpmProcessId: "",
voKey: "",
};
},
created() {
const { currNode, shipmentObj } = this.$attrs;
let voKey = "";
switch (currNode.type) {
case "preinstall":
voKey = "preInstallBackInfo";
break;
case "cabinet":
voKey = "cabinetBackInfo";
break;
case "unloading":
voKey = "cabinetUnloadBackApprovalInfo";
break;
}
if (voKey) {
this.isReview = shipmentObj[voKey] ? true : false;
if (shipmentObj[voKey] && shipmentObj[voKey].approvalStatus !== 1) {
this.isReview = false;
}
if (shipmentObj[voKey]) {
this.bpmProcessId = shipmentObj[voKey].bpmProcessId;
}
if (this.isReview) {
this.$set(
this.reviewObj,
"applyReason",
shipmentObj[voKey].applyReason
);
}
}
this.voKey = voKey;
},
methods: {
/* 取消审核 */
canclAudit() {
const { shipmentObj } = this.$attrs;
approvalCancel({
applyReason: this.$t("取消反审核"),
id: shipmentObj[this.voKey].id,
shipmentId: shipmentObj.id,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.$emit("closeDialog", "submit");
});
});
},
jumpReviewDetail() {
toReviewDetail.apply(this, [this.bpmProcessId]);
this.$emit("closeDialog");
},
/** 提交 */
onSubmit() {
this.$refs["reviewForm"].validate((valid) => {
if (valid) {
const { currNode, shipmentObj } = this.$attrs;
let approvalType = 4; // 预装反审
if (currNode.type === "cabinet") approvalType = 9; // 装柜反审
if (currNode.type === "unloading") approvalType = 7; // 卸柜反审核
approvalCreate({
shipmentId: shipmentObj.id,
...this.reviewObj,
approvalStatus: 0,
approvalType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<template>
<div>
<el-form ref="settlementForm" :model="settlementObj" label-width="80px">
<el-form-item :label="$t('可结算')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="settlementObj.slSettlementTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('已结算')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="settlementObj.slSettledTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { settlementCreate } from "@/api/ecw/boxSea";
import { formatDateStr, serviceMsg } from "../utils";
/**
* 结算
*/
export default {
name: "settlement",
inheritAttrs: false,
data() {
return {
// 结算对象
settlementObj: {},
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["slSettlementTime", "slSettledTime"]);
this.settlementObj = oldData;
},
methods: {
/** 提交 */
onSubmit(operateType) {
this.$refs["settlementForm"].validate((valid) => {
if (valid) {
settlementCreate({
...this.settlementObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-form ref="shipForm" :model="shipObj" :rules="rules" label-width="80px">
<el-form-item :label="$t('状态')" prop="saExmtStatus">
<el-radio-group v-model="shipObj.saExmtStatus">
<el-radio v-for="item in status" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('配船时间')" v-show="shipObj.saExmtStatus === '2'">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="shipObj.configTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { shipConfigure } from "@/api/ecw/boxSea";
import {
formatNumberString,
formatDateStr,
constantDict,
serviceMsg,
} from "../utils";
/**
* 配船
*/
export default {
name: "ship",
inheritAttrs: false,
props: {
shipmentObj: Object,
},
data() {
return {
// 配船对象
shipObj: {},
// 状态
status: constantDict.saExmtStatus,
// 校验
rules: {
saExmtStatus: [{ required: true, message: this.$t("必填"), trigger: "change" }],
},
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.shipmentObj[voName] };
oldData = formatNumberString(oldData, ["saExmtStatus"]);
oldData = formatDateStr(oldData, ["configTime"]);
this.shipObj = oldData;
},
methods: {
/** 提交 */
onSubmit(operateType) {
this.$refs["shipForm"].validate((valid) => {
if (valid) {
shipConfigure({
operateType,
shipmentId: this.shipmentObj.id,
...this.shipObj,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-form ref="subMaterialForm" :model="subMaterialObj" label-width="140px">
<el-form-item :label="$t('代理商AGENT')">
<supplierSelect v-model="subMaterialObj.agentId" :areaType="1" :placeholder="$t('请选择供应商')" :allSupplier="this.$attrs.allSupplier" disabled />
</el-form-item>
<el-form-item :label="$t('提单号M/BL NO.')" class="two-element">
<el-input v-model="subMaterialObj.blMblNo" :placeholder="$t('请输入提单号')"></el-input>
</el-form-item>
<el-form-item label="SO NO.">
<el-input v-model="subMaterialObj.soNo" :placeholder="$t('请输入SO NO')"></el-input>
</el-form-item>
<el-form-item :label="$t('起运港')">
<dockSelect v-model="subMaterialObj.startPortId" :placeholder="$t('请选择起运港')" :allDocks="this.$attrs.allDocks" />
</el-form-item>
<el-form-item :label="$t('目的港')">
<dockSelect v-model="subMaterialObj.destPortId" :placeholder="$t('请选择目的港')" :allDocks="this.$attrs.allDocks" />
</el-form-item>
<el-form-item :label="$t('船公司')">
<supplierSelect v-model="subMaterialObj.shipCompanyId" :companyType="'9'" :placeholder="$t('请选择船公司')" :allSupplier="this.$attrs.allSupplier" />
</el-form-item>
<el-form-item :label="$t('托运人')">
<ladingSelect v-model="subMaterialObj.shipperId" :placeholder="$t('请选择托运人')" :allUsers="this.$attrs.allLading" />
</el-form-item>
<el-form-item :label="$t('收货人')">
<el-input v-model="subMaterialObj.consigneeName" disabled></el-input>
<!-- <userSelect v-model="subMaterialObj.consigneeId" :placeholder="$t('请选择收货人')" :allUsers="this.$attrs.allUsers" /> -->
</el-form-item>
<el-form-item :label="$t('通知方')">
<el-input v-model="subMaterialObj.notifyingName" disabled></el-input>
<!-- <userSelect v-model="subMaterialObj.notifyingId" :placeholder="$t('请选择通知方')" :allUsers="this.$attrs.allUsers" /> -->
</el-form-item>
<el-form-item label="Mark & No.">
<el-input v-model="subMaterialObj.markNo" placeholder="请输入Mark & No."></el-input>
</el-form-item>
<el-form-item :label="$t('包装数量与单位')" class="two-element">
<el-input v-model="subMaterialObj.packageNum" :placeholder="$t('请输入包装数量')"></el-input>
<dict-selector v-model="subMaterialObj.packageUnit" type="packaging_type" />
</el-form-item>
<el-form-item :label="$t('货物毛重(KGS)')">
<el-input v-model="subMaterialObj.kgs" :placeholder="$t('请输入货物毛重') + '(KGS)'"></el-input>
</el-form-item>
<el-form-item :label="$t('立方数(CBM)')">
<el-input v-model="subMaterialObj.cbm" :placeholder="$t('请输入立方数') + '(CBM)'"></el-input>
</el-form-item>
<el-form-item :label="$t('货物描述')">
<el-input v-model="subMaterialObj.goodsDesc" type="textarea" autosize :placeholder="$t('请输入货物描述')"></el-input>
</el-form-item>
<el-form-item :label="$t('柜号') + '/' + $t('封条')">
<el-input v-model="subMaterialObj.containerSealNo" :placeholder="$t('请输入柜号') + '/' + $t('封条')"></el-input>
</el-form-item>
<el-form-item :label="$t('柜型')">
{{cabinetType}}
</el-form-item>
<el-form-item :label="$t('出单方式')">
<el-radio-group v-model="subMaterialObj.issueType">
<el-radio v-for="item in method" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('备注')">
<el-input v-model="subMaterialObj.remarks" type="textarea" rows="2" :placeholder="$t('请输入备注')"></el-input>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button :disabled="shipmentObj.ladingBillInfo == null" @click="download">{{$t('下载提单确认件')}}</el-button>
</el-row>
</div>
</template>
<script>
import supplierSelect from "./common/supplierSelect.vue";
import dockSelect from "./common/dockSelect.vue";
import userSelect from "./common/userSelect.vue";
import ladingSelect from "./common/ladingSelect.vue";
import { getUnitList } from "@/api/ecw/unit";
import { getCabinetPage } from "@/api/ecw/cabinet";
import { billCreate, getBoxLadingBillPdf } from "@/api/ecw/boxSea";
import { getSupplier } from "@/api/ecw/supplier";
import { formatNumberString, constantDict, serviceMsg } from "../utils";
import FileSaver from 'file-saver'
/**
* 提单补料
*/
export default {
name: "subMaterial",
inheritAttrs: false,
components: { supplierSelect, dockSelect, userSelect, ladingSelect },
props: {
shipmentObj: Object,
},
data() {
return {
// 提单补料对象
subMaterialObj: {
markNo: "N/M",
},
// 出单方式
method: constantDict.billingMethod,
// 单位
units: [],
// 柜型
cabinetType: "/",
};
},
created() {
// 获取单位
getUnitList().then((res) => {
const { data } = res;
this.units = data ?? [];
});
// 柜型
getCabinetPage(null).then((response) => {
const cabinetList = response.data.list;
for (let index in cabinetList) {
let cabinetItem = cabinetList[index];
if (cabinetItem.id == this.shipmentObj.cabinetId) {
this.cabinetType = cabinetItem.name;
this.$set(this.subMaterialObj,'cbm',cabinetItem.ladingBill)
}
}
});
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.shipmentObj[voName] };
oldData = formatNumberString(oldData, ["issueType"]);this.subMaterialObj = {
...oldData,
packageUnit: oldData.packageUnit === 0 ? undefined : oldData.packageUnit,
};
if(!this.shipmentObj.ladingBillInfo){
this.$set(this.subMaterialObj,'agentId',this.shipmentObj.agentInfo?.agentId||undefined)
this.$set(this.subMaterialObj,'soNo',this.shipmentObj.bookSeaInfo?.sono||undefined)
this.$set(this.subMaterialObj,'blMblNo',this.shipmentObj.bookSeaInfo?.sono||undefined)
this.$set(this.subMaterialObj,'markNo',"N/M")
this.$set(this.subMaterialObj,'startPortId',this.shipmentObj.bookSeaInfo?.bigPortId||undefined)
this.$set(this.subMaterialObj,'shipCompanyId',Number(this.shipmentObj.bookSeaInfo?.shipCompanyType)||undefined)
this.$set(this.subMaterialObj,'destPortId',this.shipmentObj.bookSeaInfo?.destPortId||undefined)
this.$set(this.subMaterialObj,'kgs',this.shipmentObj.customsInfo?.dcGoodsWgt||undefined)
this.$set(this.subMaterialObj,'containerSealNo',(this.shipmentObj.trailerInfo?.tlContainerNo||'')+'/'+(this.shipmentObj.trailerInfo?.tlStripSeal||'/'))
this.subMaterialObj.containerSealNo = this.subMaterialObj.containerSealNo.replace('//','')
this.getSup(this.subMaterialObj.agentId)
}
},
methods: {
getSup(id) {
getSupplier(id).then(response => {
if(response.data.externalBackVO){
this.$set(this.subMaterialObj,'consigneeName',response.data.externalBackVO?.receiveCompanyName||'/')
this.$set(this.subMaterialObj,'notifyingName',response.data.externalBackVO?.notifyCompanyName||'/')
this.$set(this.subMaterialObj,'packageNum',response.data.externalBackVO?.packNum)
this.$set(this.subMaterialObj,'packageUnit',response.data.externalBackVO?.packUnit)
var goodName = '',baNo = '',fromNo = '',ctnNo = ''
if(response.data.externalBackVO.goodName && response.data.externalBackVO.goodName != '') goodName = response.data.externalBackVO.goodName
if(response.data.externalBackVO.fromNo && response.data.externalBackVO.fromNo != '') fromNo = (goodName!=''?'\n':'')+'FROM M NO:'+response.data.externalBackVO.fromNo
if(response.data.externalBackVO.baNo && response.data.externalBackVO.baNo != '') baNo = '\nBA NO:'+response.data.externalBackVO.baNo
if(response.data.externalBackVO.ctnNo && response.data.externalBackVO.ctnNo != '') ctnNo = '\nCTN NO:'+response.data.externalBackVO.ctnNo
this.$set(this.subMaterialObj,'goodsDesc',goodName+fromNo+baNo+ctnNo)
if(this.subMaterialObj.goodsDesc == null){
this.$set(this.subMaterialObj,'goodsDesc','/')
}
}
})
},
/** 提交 */
onSubmit(operateType) {
this.$refs["subMaterialForm"].validate((valid) => {
if (valid) {
billCreate({
...this.subMaterialObj,
shipmentId: this.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
if(operateType == 2) this.download()
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel(type) {
this.$emit("closeDialog", type);
},
download() {
getBoxLadingBillPdf({shipmentId: this.shipmentObj.id}).then(res=>{
let blob = new Blob([res], {type: "application/vnd.ms-excel"})
FileSaver.saveAs(blob, this.$t('提单确认件.xlsx'));
})
}
},
};
</script>
<style lang="scss">
</style>
<template>
<div class="shipping-batchTally">
<el-row v-if="$attrs.type === 'batchTally'">
<el-button type="text" size="small" @click="()=>openStorage('all')">{{$t('批量修改储位')}}</el-button>
</el-row>
<el-scrollbar viewClass="tally-list">
<el-row class="tally-detail" v-for="(item, index) in storageList" :key="item.id">
<div class="status-number">{{++index}}</div>
<div class="detail-info">
<div>{{$t('入仓单号')}}{{item.orderNo}}</div>
<div>{{$t('入仓统计')}}{{getTotlContent(item)}}</div>
<div class="detail-modify">
<el-tooltip effect="dark" :content="item.positionNo" placement="top">
<div>{{$t('储位')}}{{item.positionNo}}</div>
</el-tooltip>
<el-button type="text" size="small" @click="()=>openStorage('single', item)">{{$t('修改')}}</el-button>
</div>
</div>
</el-row>
</el-scrollbar>
<el-row class="operate-button">
<el-button size="small" type="primary" @click="tallyModify">{{$t('确定')}}</el-button>
<el-button size="small" @click="$emit('closeDialog')">{{$t('关闭')}}</el-button>
</el-row>
<warehouse-area-dialog ref="area" :visible.sync="visible" v-model="storageSpaces" :order-id="orderId" :warehouseId="warehouseId" :modal-append-to-body=false append-to-body />
</div>
</template>
<script>
import { getTotlContent, serviceMsg } from "../../utils";
import WarehouseAreaDialog from "@/components/WarehouseAreaDialog";
import { deepClone } from "@/utils";
import { tallyLocationUpdate } from "@/api/ecw/boxSea";
export default {
name: "batchTally",
inheritAttrs: false,
components: { WarehouseAreaDialog },
props: {
tallyRows: Array,
},
data() {
return {
visible: false,
// 储位
storageSpaces: [],
// 订单ID
orderId: -1,
// 仓位数据
storageList: deepClone(this.tallyRows),
// 仓库id
warehouseId: this.$attrs.shipmentObj.startWarehouseId,
};
},
mounted() {
this.$refs.area.updateArea()
},
methods: {
getTotlContent,
// 打开储位
openStorage(type, item) {
if (type === "all") {
this.orderId = -1;
} else {
this.orderId = item.orderId;
}
this.visible = true;
},
// 修改储位
tallyModify() {
// 查找数据中存在storageList的订单
let orderLocationList = [];
this.storageList.forEach((item) => {
const { storageList } = item;
if (storageList && storageList.length) {
storageList.forEach((sItem) => {
orderLocationList.push({
...sItem,
orderId: item.orderId,
});
});
}
});
if (orderLocationList.length === 0) {
this.$message.error(this.$t("没有需要修改储位的订单"));
return;
}
tallyLocationUpdate({
shipmentId: this.$attrs.shipmentObj.id,
orderLocationList,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.$emit("closeDialog", "query");
});
});
},
},
watch: {
storageSpaces(val) {
let newList = [];
const { selected = [] } = this.$refs.area;
// 批量修改储位
if (this.orderId === -1) {
newList = this.storageList.map((item) => {
item.positionNo = selected.join(",");
item.storageList = val;
return item;
});
} else {
newList = this.storageList.map((item) => {
if (item.orderId === this.orderId) {
item.positionNo = selected.join(",");
item.storageList = val;
}
return item;
});
}
this.storageList = newList;
},
},
};
</script>
<style lang="scss">
.shipping-batchTally {
.el-scrollbar__wrap {
max-height: 500px;
.tally-list {
.tally-detail {
display: flex;
padding: 10px 0px;
border-bottom: 1px solid rgb(223, 230, 236);
.status-number {
width: 26px;
height: 26px;
border: 1px solid #ccc;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20px;
}
.detail-info {
> div {
height: 30px;
line-height: 30px;
}
.detail-modify {
display: flex;
align-items: center;
> :first-child {
width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-right: 10px;
}
}
}
}
> .tally-detail:last-child {
border-bottom: none;
}
}
}
}
</style>
This diff is collapsed.
<template>
<!-- 订单获取入仓记录 -->
<el-dialog :title="title" visible :before-close="closeDialog" :close-on-click-modal="false" width="95%" append-to-body>
<el-table v-if="warehouseItem && warehouseItem.orderWarehouseInBackItemDoList" :data="warehouseItem.orderWarehouseInBackItemDoList">
<el-table-column type="index" :label="$t('序号')" />
<el-table-column :label="$t('箱数')" prop="cartonsNum" />
<el-table-column :label="$t('入仓类型')" prop="cartonsNum">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" :value="row.specificationType" />
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" prop="unit">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="row.unit" />
</template>
</el-table-column>
<el-table-column :label="$t('长')" prop="boxGauge">
<template slot-scope="{row}">
{{row.boxGauge.split('*')[0]}}
</template>
</el-table-column>
<el-table-column :label="$t('宽')" prop="boxGauge">
<template slot-scope="{row}">
{{row.boxGauge.split('*')[1]}}
</template>
</el-table-column>
<el-table-column :label="$t('高')" prop="boxGauge">
<template slot-scope="{row}">
{{row.boxGauge.split('*')[2]}}
</template>
</el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="quantityAll" />
<el-table-column :label="$t('快递单号')" prop="expressNo" />
<el-table-column :label="$t('储位')" align="center" prop="positionNo" width="250px">
<template slot-scope="{row}">{{row.orderLocationBackVOList.map(e => (e.areaName + (e.locationName === null ? '' : e.locationName))).join(',')}}</template>
</el-table-column>
<el-table-column :label="$t('首次入仓时间')" prop="inTime">
<template slot-scope="{row}">{{row.inTime|parseTime}}</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import { getOrder, getOrderWarehouseIn } from "@/api/ecw/order";
import { DICT_TYPE } from "@/utils/dict";
import { parseTime } from "@/utils/ruoyi";
export default {
filters: { parseTime },
props: {
order: Object, // order 和 orderId 二选一
orderId: Number,
orderItemId: Number,
},
data() {
return {
orderDetail: null,
warehouseList: null,
};
},
computed: {
info() {
return this.orderDetail || this.order;
},
orderItem() {
if (!this.info) return null;
return this.info.orderItemVOList.find(
(item) => item.orderItemId == this.orderItemId
);
},
warehouseItem() {
if (!this.warehouseList) return [];
return (
this.warehouseList.find(
(item) => item.orderItemId == this.orderItemId
) || []
);
},
title() {
if (!this.orderItem) return "-";
return this.$l(this.orderItem, "prodTitle") + " - " + this.$t("入仓记录");
}
},
created() {
this.show = true;
if (!this.order && this.orderId) {
getOrder(this.orderId).then((res) => {
this.orderDetail = res.data;
});
}
this.getOrderWarehouseIn();
},
methods: {
closeDialog() {
this.show = false;
this.$emit("close");
},
getOrderWarehouseIn() {
getOrderWarehouseIn(this.info.orderId).then((res) => {
this.warehouseList = res.data;
});
},
},
};
</script>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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