Commit 71dc860b authored by huhaiqing's avatar huhaiqing

出货功能开发

parent ef72f4e0
import request from "@/utils/request"; import request from "@/utils/request";
// booking /**
* 订舱
*
* @export
* @param {*} data
* @return {*}
*/
export function booking(data) { export function booking(data) {
return request({ return request({
url: "/ecw/box-book-sea/create", url: "/ecw/box-book-sea/create",
...@@ -9,7 +15,13 @@ export function booking(data) { ...@@ -9,7 +15,13 @@ export function booking(data) {
}); });
} }
// trailer /**
* 拖车
*
* @export
* @param {*} data
* @return {*}
*/
export function trailer(data) { export function trailer(data) {
return request({ return request({
url: "/ecw/box-trailer/create", url: "/ecw/box-trailer/create",
...@@ -18,7 +30,54 @@ export function trailer(data) { ...@@ -18,7 +30,54 @@ export function trailer(data) {
}); });
} }
/***************************** 预装 **********************************/ /**
* agent
*
* @export
* @param {*} data
* @return {*}
*/
export function agentSet(data) {
return request({
url: "/shipment/box/agentSet",
method: "post",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
data: jsonToFormData(data),
});
}
/**
* 配船
*
* @export
* @param {*} data
* @return {*}
*/
export function shipConfigure(data) {
return request({
url: "/shipment/box/shipConfigure",
method: "post",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
data: jsonToFormData(data),
});
}
/**
* 提单补料
*
* @export
* @param {*} data
* @return {*}
*/
export function billCreate(data) {
return request({
url: "/ecw/box-lading-bill/create",
method: "post",
data,
});
}
/***************************** 预装 start **********************************/
/** /**
* 获得已预装部分列表 * 获得已预装部分列表
...@@ -108,6 +167,8 @@ export function createGoods(data) { ...@@ -108,6 +167,8 @@ export function createGoods(data) {
}); });
} }
/***************************** 预装 end **********************************/
/** /**
* 服务提示消息回调 * 服务提示消息回调
* *
...@@ -120,7 +181,7 @@ export function serviceMsg(result, _vue) { ...@@ -120,7 +181,7 @@ export function serviceMsg(result, _vue) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const { code, msg } = result; const { code, msg } = result;
if (code === 0) { if (code === 0) {
_vue.$message.success("提交成功"); _vue.$message.success("操作成功");
resolve(); resolve();
} else { } else {
_vue.$message.error(msg); _vue.$message.error(msg);
...@@ -128,3 +189,11 @@ export function serviceMsg(result, _vue) { ...@@ -128,3 +189,11 @@ export function serviceMsg(result, _vue) {
} }
}); });
} }
function jsonToFormData(params) {
const formData = new FormData();
for (const [key, value] of Object.entries(params)) {
formData.append(key, value);
}
return formData;
}
<template> <template>
<div> <div>
<el-form ref="agentForm" :model="agentObj" label-width="120px"> <el-form ref="agentForm" :model="agentObj" :rules="rules" label-width="120px">
<el-form-item label="代理商Agent"> <el-form-item label="代理商Agent" prop="agentId">
<el-select v-model="agentObj.agent" placeholder="请选择代理商"> <supplierSelect v-model="agentObj.agentId" placeholder="请选择代理商" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row class="operate-button"> <el-row class="operate-button">
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button type="success" @click="onSubmit">提交</el-button> <el-button type="success" @click="onSubmit">提交</el-button>
<el-button @click="cancel">关闭</el-button> <el-button @click="cancel">关闭</el-button>
</el-row> </el-row>
...@@ -15,15 +13,22 @@ ...@@ -15,15 +13,22 @@
</template> </template>
<script> <script>
import { agentSet, serviceMsg } from "@/api/ecw/boxSea";
import supplierSelect from "./common/supplierSelect.vue";
/** /**
* agent * agent
*/ */
export default { export default {
name: "agent", name: "agent",
components: { supplierSelect },
data() { data() {
return { return {
// agent对象 // agent对象
agentObj: {}, agentObj: {},
// 校验
rules: {
agentId: [{ required: true, message: "必填", trigger: "change" }],
},
}; };
}, },
methods: { methods: {
...@@ -31,7 +36,14 @@ export default { ...@@ -31,7 +36,14 @@ export default {
onSubmit() { onSubmit() {
this.$refs["agentForm"].validate((valid) => { this.$refs["agentForm"].validate((valid) => {
if (valid) { if (valid) {
alert("submit!"); agentSet({
shipmentId: this.$attrs.shipmentObj.id,
...this.agentObj,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
});
});
} }
}); });
}, },
......
...@@ -5,29 +5,19 @@ ...@@ -5,29 +5,19 @@
<el-input v-model="bookingObj.sono" placeholder="请输入SO NO."></el-input> <el-input v-model="bookingObj.sono" placeholder="请输入SO NO."></el-input>
</el-form-item> </el-form-item>
<el-form-item label="船公司类型"> <el-form-item label="船公司类型">
<el-select v-model="bookingObj.shipCompanyType" placeholder="请选择船公司类型"> <supplierSelect v-model="bookingObj.shipCompanyType" :companyType="'9'" placeholder="请选择船公司类型" v-bind="$attrs" />
<el-option v-for="supplier in shipCompany" :key="supplier.id" :label="supplier.companyZh" :value="supplier.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="驳船港"> <el-form-item label="驳船港">
<el-select v-model="bookingObj.bargePort" placeholder="请选择驳船港"> <dockSelect v-model="bookingObj.bargePort" placeholder="请选择驳船港" v-bind="$attrs" />
<el-option v-for="dock in docks" :key="dock.id" :label="dock.titleZh" :value="dock.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="大船港"> <el-form-item label="大船港">
<el-select v-model="bookingObj.bigPort" placeholder="请选择大船港"> <dockSelect v-model="bookingObj.bigPort" placeholder="请选择大船港" v-bind="$attrs" />
<el-option v-for="dock in docks" :key="dock.id" :label="dock.titleZh" :value="dock.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="目的港"> <el-form-item label="目的港">
<el-select v-model="bookingObj.destPort" placeholder="请选择目的港"> <dockSelect v-model="bookingObj.destPort" placeholder="请选择目的港" v-bind="$attrs" />
<el-option v-for="dock in docks" :key="dock.id" :label="dock.titleZh" :value="dock.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="订舱公司"> <el-form-item label="订舱公司">
<el-select v-model="bookingObj.spaceCompany" placeholder="请选择订舱公司"> <supplierSelect v-model="bookingObj.spaceCompany" :companyType="'1'" placeholder="请选择订舱公司" v-bind="$attrs" />
<el-option v-for="supplier in suppliers" :key="supplier.id" :label="supplier.companyZh" :value="supplier.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="预计驳船时间" prop="bargeTime"> <el-form-item label="预计驳船时间" prop="bargeTime">
<el-date-picker type="date" placeholder="请选择日期" value-format="yyyy-MM-dd" v-model="bookingObj.bargeTime"></el-date-picker> <el-date-picker type="date" placeholder="请选择日期" value-format="yyyy-MM-dd" v-model="bookingObj.bargeTime"></el-date-picker>
...@@ -41,8 +31,7 @@ ...@@ -41,8 +31,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="通知人" label-width="80px"> <el-form-item label="通知人" label-width="80px">
<el-select v-model="bookingObj.feedTimePerson1" placeholder="请选择通知人"> <userSelect v-model="bookingObj.feedTimePerson1" placeholder="请选择通知人" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -55,8 +44,7 @@ ...@@ -55,8 +44,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="通知人" label-width="80px"> <el-form-item label="通知人" label-width="80px">
<el-select v-model="bookingObj.feedTimePerson" placeholder="请选择通知人"> <userSelect v-model="bookingObj.feedTimePerson2" placeholder="请选择通知人" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -69,8 +57,7 @@ ...@@ -69,8 +57,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="通知人" label-width="80px"> <el-form-item label="通知人" label-width="80px">
<el-select v-model="bookingObj.feedTimePerson" placeholder="请选择通知人"> <userSelect v-model="bookingObj.feedTimePerson3" placeholder="请选择通知人" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -83,8 +70,7 @@ ...@@ -83,8 +70,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="通知人" label-width="80px"> <el-form-item label="通知人" label-width="80px">
<el-select v-model="bookingObj.feedTimePerson" placeholder="请选择通知人"> <userSelect v-model="bookingObj.feedTimePerson4" placeholder="请选择通知人" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -99,16 +85,22 @@ ...@@ -99,16 +85,22 @@
</template> </template>
<script> <script>
import { getDockPage } from "@/api/ecw/dock";
import { booking, serviceMsg } from "@/api/ecw/boxSea"; import { booking, serviceMsg } from "@/api/ecw/boxSea";
import supplierSelect from "./common/supplierSelect.vue";
import dockSelect from "./common/dockSelect.vue";
import userSelect from "./common/userSelect.vue";
/** /**
* 订舱 * 订舱
*/ */
export default { export default {
name: "booking", name: "booking",
components: {
supplierSelect,
dockSelect,
userSelect,
},
props: { props: {
shipmentObj: Object, shipmentObj: Object,
allSupplier: Array,
}, },
data() { data() {
return { return {
...@@ -119,31 +111,16 @@ export default { ...@@ -119,31 +111,16 @@ export default {
bargeTime: [{ required: true, message: "必填", trigger: "change" }], bargeTime: [{ required: true, message: "必填", trigger: "change" }],
sailTime: [{ required: true, message: "必填", trigger: "change" }], sailTime: [{ required: true, message: "必填", trigger: "change" }],
}, },
// 码头
docks: [],
// 供应商
suppliers: this.allSupplier.filter((item) =>
item.companyTypes.includes("1")
),
// 船公司
shipCompany: this.allSupplier.filter((item) =>
item.companyTypes.includes("9")
),
}; };
}, },
created() { created() {},
getDockPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res;
this.docks = data.list;
});
},
methods: { methods: {
/** 提交 */ /** 提交 */
onSubmit() { onSubmit() {
this.$refs["bookingForm"].validate((valid) => { this.$refs["bookingForm"].validate((valid) => {
if (valid) { if (valid) {
booking({ booking({
shipmentId: shipmentObj.id, shipmentId: this.$attrs.shipmentObj.id,
...this.bookingObj, ...this.bookingObj,
operateType: 2, operateType: 2,
}).then((res) => { }).then((res) => {
......
<template>
<el-select filterable :value="value" @change="change" v-bind="$attrs">
<el-option v-for="dock in getDock" :key="dock.id" :label="dock.titleZh" :value="dock.id"></el-option>
</el-select>
</template>
<script>
/**
* 码头
*/
export default {
name: "dockSelect",
props: {
value: Number,
},
model: {
prop: "value",
event: "change",
},
data() {
return {
supplier: [],
};
},
computed: {
getDock() {
return this.$attrs.allDocks;
},
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
<template>
<el-select filterable :value="value" @change="change" v-bind="$attrs">
<el-option v-for="supplier in getSuppliers" :key="supplier.id" :label="supplier.companyZh" :value="supplier.id"></el-option>
</el-select>
</template>
<script>
/**
* 供应商
*/
export default {
name: "supplierSelect",
props: {
companyType: String,
value: Number,
},
model: {
prop: "value",
event: "change",
},
data() {
return {
supplier: [],
};
},
computed: {
getSuppliers() {
if (!this.companyType) return this.$attrs.allSupplier;
return this.$attrs.allSupplier.filter((item) =>
item.companyTypes.includes(this.companyType)
);
},
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
<template>
<el-select filterable :value="value" @change="change" v-bind="$attrs">
<el-option v-for="user in getUser" :key="user.id" :value="user.id">{{user.nickname}}</el-option>
</el-select>
</template>
<script>
/**
* 用户
*/
export default {
name: "userSelect",
props: {
value: Number,
},
model: {
prop: "value",
event: "change",
},
data() {
return {
supplier: [],
};
},
computed: {
getUser() {
return this.$attrs.allUsers;
},
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
...@@ -248,8 +248,7 @@ ...@@ -248,8 +248,7 @@
<el-row> <el-row>
<el-form ref="operatorForm" :model="operatorData" size="small" :inline="true" label-width="120px" :rules="rules"> <el-form ref="operatorForm" :model="operatorData" size="small" :inline="true" label-width="120px" :rules="rules">
<el-form-item label="目的地操作员" prop="operator"> <el-form-item label="目的地操作员" prop="operator">
<el-select v-model="operatorData.operator" placeholder="请选择目的地操作员" clearable size="small"> <userSelect v-model="operatorData.operator" placeholder="请选择目的地操作员" v-bind="$attrs" size="small" />
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>
...@@ -272,16 +271,14 @@ import { ...@@ -272,16 +271,14 @@ import {
createGoods, createGoods,
deleteGoods, deleteGoods,
} from "@/api/ecw/boxSea"; } from "@/api/ecw/boxSea";
import userSelect from "./common/userSelect.vue";
/** /**
* 预装 * 预装
*/ */
export default { export default {
name: "preinstall", name: "preinstall",
props: { components: { userSelect },
shipmentObj: Object,
allSupplier: Array,
},
data() { data() {
return { return {
// 状态 // 状态
...@@ -322,6 +319,8 @@ export default { ...@@ -322,6 +319,8 @@ export default {
rules: { rules: {
operator: [{ required: true, message: "必填", trigger: "change" }], operator: [{ required: true, message: "必填", trigger: "change" }],
}, },
// 出货信息
shipmentObj: this.$attrs.shipmentObj,
}; };
}, },
computed: { computed: {
...@@ -341,6 +340,7 @@ export default { ...@@ -341,6 +340,7 @@ export default {
created() { created() {
// 查询仓库数据 // 查询仓库数据
getWarehouseList().then((res) => (this.warehouseList = res.data)); getWarehouseList().then((res) => (this.warehouseList = res.data));
// 查询待预装
this.handleQuery("toBePre"); this.handleQuery("toBePre");
}, },
methods: { methods: {
......
<template> <template>
<div> <div>
<el-form ref="shipForm" :model="shipObj" label-width="80px"> <el-form ref="shipForm" :model="shipObj" :rules="rules" label-width="80px">
<el-form-item label="状态"> <el-form-item label="状态" prop="saExmtStatus">
<el-radio-group v-model="shipObj.status"> <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 v-for="item in status" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="配船时间" v-show="shipObj.status === '2'"> <el-form-item label="配船时间" v-show="shipObj.saExmtStatus === '2'">
<el-date-picker type="date" placeholder="请选择日期" v-model="shipObj.shipTime"></el-date-picker> <el-date-picker type="date" placeholder="请选择日期" v-model="shipObj.shipTime"></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row class="operate-button"> <el-row class="operate-button">
<el-button type="primary">保存</el-button> <el-button type="primary" @click="onSubmit(1)">保存</el-button>
<el-button type="success" @click="onSubmit">提交</el-button> <el-button type="success" @click="onSubmit(2)">提交</el-button>
<el-button @click="cancel">关闭</el-button> <el-button @click="cancel">关闭</el-button>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import { shipConfigure, serviceMsg } from "@/api/ecw/boxSea";
/** /**
* 配船 * 配船
*/ */
export default { export default {
name: "ship", name: "ship",
props: {
shipmentObj: Object,
},
data() { data() {
return { return {
// 配船对象 // 配船对象
...@@ -40,14 +44,26 @@ export default { ...@@ -40,14 +44,26 @@ export default {
label: "已配", label: "已配",
}, },
], ],
// 校验
rules: {
saExmtStatus: [{ required: true, message: "必填", trigger: "change" }],
},
}; };
}, },
methods: { methods: {
/** 提交 */ /** 提交 */
onSubmit() { onSubmit(operateType) {
this.$refs["shipForm"].validate((valid) => { this.$refs["shipForm"].validate((valid) => {
if (valid) { if (valid) {
alert("submit!"); shipConfigure({
operateType,
shipmentId: this.shipmentObj.id,
...this.shipObj,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
});
});
} }
}); });
}, },
......
...@@ -2,39 +2,32 @@ ...@@ -2,39 +2,32 @@
<div> <div>
<el-form ref="subMaterialForm" :model="subMaterialObj" label-width="140px"> <el-form ref="subMaterialForm" :model="subMaterialObj" label-width="140px">
<el-form-item label="代理商AGENT"> <el-form-item label="代理商AGENT">
<el-select v-model="subMaterialObj.agent" placeholder="请选择供应商"> <supplierSelect v-model="subMaterialObj.agentId" placeholder="请选择供应商" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="提单号M/BL NO." class="two-element"> <el-form-item label="提单号M/BL NO." class="two-element">
<el-input v-model="subMaterialObj.billNo" placeholder="请输入提单号"></el-input> <el-input v-model="subMaterialObj.blMblNo" placeholder="请输入提单号"></el-input>
<el-button type="primary">提单确认</el-button> <el-button type="primary">提单确认件</el-button>
</el-form-item> </el-form-item>
<el-form-item label="SO NO."> <el-form-item label="SO NO.">
<el-input v-model="subMaterialObj.soNo" placeholder="请输入SO NO"></el-input> <el-input v-model="subMaterialObj.soNo" placeholder="请输入SO NO"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="装货港"> <el-form-item label="装货港">
<el-select v-model="subMaterialObj.loadingPort" placeholder="请选择装货港"> <dockSelect v-model="subMaterialObj.startPortId" placeholder="请选择装货港" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="目的港"> <el-form-item label="目的港">
<el-select v-model="subMaterialObj.destination" placeholder="请选择目的港"> <dockSelect v-model="subMaterialObj.destPortId" placeholder="请选择目的港" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="船公司"> <el-form-item label="船公司">
<el-select v-model="subMaterialObj.shippingCompany" placeholder="请选择船公司"> <supplierSelect v-model="subMaterialObj.shipCompanyId" :companyType="'9'" placeholder="请选择船公司" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="托运人"> <el-form-item label="托运人">
<el-select v-model="subMaterialObj.shipper" placeholder="请选择托运人"> <userSelect v-model="subMaterialObj.shipperId" placeholder="请选择托运人" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="收货人"> <el-form-item label="收货人">
<el-select v-model="subMaterialObj.consignee" placeholder="请选择收货人"> <userSelect v-model="subMaterialObj.consigneeId" placeholder="请选择收货人" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="通知方"> <el-form-item label="通知方">
<el-select v-model="subMaterialObj.notifyParty" placeholder="请选择通知方"> <userSelect v-model="subMaterialObj.notifyingId" placeholder="请选择通知方" v-bind="$attrs" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="Mark & No."> <el-form-item label="Mark & No.">
<el-input v-model="subMaterialObj.markNo"></el-input> <el-input v-model="subMaterialObj.markNo"></el-input>
...@@ -42,47 +35,58 @@ ...@@ -42,47 +35,58 @@
<el-form-item label="包装数量与单位" class="two-element"> <el-form-item label="包装数量与单位" class="two-element">
<el-input v-model="subMaterialObj.quantity" placeholder="请输入包装数量"></el-input> <el-input v-model="subMaterialObj.quantity" placeholder="请输入包装数量"></el-input>
<el-select v-model="subMaterialObj.unit" placeholder="请选择单位"> <el-select v-model="subMaterialObj.unit" placeholder="请选择单位">
<el-option v-for="unit in units" :key="unit.id" :value="unit.fuhao">{{unit.titleZh}}</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="毛重(KGS)"> <el-form-item label="毛重(KGS)">
<el-input v-model="subMaterialObj.grossWeight" placeholder="请输入毛重(KGS)"></el-input> <el-input v-model="subMaterialObj.kgs" placeholder="请输入毛重(KGS)"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="立方数(CBM)"> <el-form-item label="立方数(CBM)">
<el-input v-model="subMaterialObj.mesaurement" placeholder="请输入立方数(CBM)"></el-input> <el-input v-model="subMaterialObj.mesaurement" placeholder="请输入立方数(CBM)"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="货物描述"> <el-form-item label="货物描述">
<el-input v-model="subMaterialObj.description" placeholder="请输入货物描述"></el-input> <el-input v-model="subMaterialObj.goodsDesc" placeholder="请输入货物描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="柜号/封条"> <el-form-item label="柜号/封条">
<el-input v-model="subMaterialObj.container" placeholder="请输入柜号/封条"></el-input> <el-input v-model="subMaterialObj.containerSealNo" placeholder="请输入柜号/封条"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="柜型"> <el-form-item label="柜型">
111 {{getCabinetName(shipmentObj.cabinetId)}}
</el-form-item> </el-form-item>
<el-form-item label="出单方式"> <el-form-item label="出单方式">
<el-radio-group v-model="subMaterialObj.billingMethod"> <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 v-for="item in method" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="subMaterialObj.remark" type="textarea" rows="2" placeholder="请输入备注"></el-input> <el-input v-model="subMaterialObj.remarks" type="textarea" rows="2" placeholder="请输入备注"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row class="operate-button"> <el-row class="operate-button">
<el-button type="primary">保存</el-button> <el-button type="primary" @click="onSubmit(1)">保存</el-button>
<el-button type="success" @click="onSubmit">提交</el-button> <el-button type="success" @click="onSubmit(2)">提交</el-button>
<el-button @click="cancel">关闭</el-button> <el-button @click="cancel">关闭</el-button>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import supplierSelect from "./common/supplierSelect.vue";
import dockSelect from "./common/dockSelect.vue";
import userSelect from "./common/userSelect.vue";
import { getUnitList } from "@/api/ecw/unit";
import { getCabinetPage } from "@/api/ecw/cabinet";
import { billCreate, serviceMsg } from "@/api/ecw/boxSea";
/** /**
* 提单补料 * 提单补料
*/ */
export default { export default {
name: "subMaterial", name: "subMaterial",
components: { supplierSelect, dockSelect, userSelect },
props: {
shipmentObj: Object,
},
data() { data() {
return { return {
// 提单补料对象 // 提单补料对象
...@@ -100,14 +104,36 @@ export default { ...@@ -100,14 +104,36 @@ export default {
label: "电放", label: "电放",
}, },
], ],
// 单位
units: [],
}; };
}, },
created() {
// 获取单位
getUnitList().then((res) => {
const { data } = res;
this.units = data ?? [];
});
// 柜型
getCabinetPage(null).then((response) => {
this.cabinetList = response.data.list;
});
},
computed: {},
methods: { methods: {
/** 提交 */ /** 提交 */
onSubmit() { onSubmit(operateType) {
this.$refs["subMaterialForm"].validate((valid) => { this.$refs["subMaterialForm"].validate((valid) => {
if (valid) { if (valid) {
alert("submit!"); billCreate({
...this.subMaterialObj,
shipmentId: this.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
});
});
} }
}); });
}, },
...@@ -115,6 +141,16 @@ export default { ...@@ -115,6 +141,16 @@ export default {
cancel() { cancel() {
this.$emit("closeDialog"); this.$emit("closeDialog");
}, },
/* 获取柜名 */
getCabinetName(cabinetId) {
for (let index in this.cabinetList) {
let cabinetItem = this.cabinetList[index];
if (cabinetItem.id == cabinetId) {
return cabinetItem.name;
}
}
return "/";
},
}, },
}; };
</script> </script>
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="拖车公司"> <el-form-item label="拖车公司">
<el-select v-model="trailerObj.tlCompanyId" placeholder="请选择拖车公司"> <supplierSelect v-model="trailerObj.tlCompanyId" :companyType="'4'" placeholder="请选择拖车公司" v-bind="$attrs" />
<el-option v-for="supplier in suppliers" :key="supplier.id" :label="supplier.companyZh" :value="supplier.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="拖车时间" prop="tlTime"> <el-form-item label="拖车时间" prop="tlTime">
<el-date-picker type="date" placeholder="请选择日期" value-format="yyyy-MM-dd" v-model="trailerObj.tlTime"></el-date-picker> <el-date-picker type="date" placeholder="请选择日期" value-format="yyyy-MM-dd" v-model="trailerObj.tlTime"></el-date-picker>
...@@ -40,15 +38,13 @@ ...@@ -40,15 +38,13 @@
<script> <script>
import { trailer, serviceMsg } from "@/api/ecw/boxSea"; import { trailer, serviceMsg } from "@/api/ecw/boxSea";
import supplierSelect from "./common/supplierSelect.vue";
/** /**
* 拖车 * 拖车
*/ */
export default { export default {
name: "trailer", name: "trailer",
props: { components: { supplierSelect },
shipmentObj: Object,
allSupplier: Array,
},
data() { data() {
return { return {
// 拖车对象 // 拖车对象
...@@ -57,10 +53,6 @@ export default { ...@@ -57,10 +53,6 @@ export default {
rules: { rules: {
tlTime: [{ required: true, message: "必填", trigger: "change" }], tlTime: [{ required: true, message: "必填", trigger: "change" }],
}, },
// 拖车公司
suppliers: this.allSupplier.filter((item) =>
item.companyTypes.includes("4")
),
}; };
}, },
methods: { methods: {
...@@ -70,7 +62,7 @@ export default { ...@@ -70,7 +62,7 @@ export default {
if (valid) { if (valid) {
trailer({ trailer({
...this.trailerObj, ...this.trailerObj,
shipmentId: shipmentObj.id, shipmentId: this.$attrs.shipmentObj.id,
operateType, operateType,
}).then((res) => { }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog custom-class="shipping-dialog" :title="dialogConfig.title" :visible.sync="dialogConfig.dialogVisible" :width="dialogConfig.width" :fullscreen="dialogConfig.fullscreen" :close-on-click-modal=false :modal-append-to-body=false append-to-body destroy-on-close> <el-dialog custom-class="shipping-dialog" :title="dialogConfig.title" :visible.sync="dialogConfig.dialogVisible" :width="dialogConfig.width" :fullscreen="dialogConfig.fullscreen" :close-on-click-modal=false :modal-append-to-body=false append-to-body destroy-on-close>
<component v-bind:is="currentComponent" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :allSupplier="allSupplier"></component> <component v-bind:is="currentComponent" @closeDialog="closeDialog" v-bind="$attrs" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers"></component>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -45,6 +45,8 @@ import cusClearanceWidget from "./nodePage/cusClearance.vue"; ...@@ -45,6 +45,8 @@ import cusClearanceWidget from "./nodePage/cusClearance.vue";
import unloadingWidget from "./nodePage/unloading/index.vue"; import unloadingWidget from "./nodePage/unloading/index.vue";
import settlementWidget from "./nodePage/settlement.vue"; import settlementWidget from "./nodePage/settlement.vue";
import { getSupplierPage } from "@/api/ecw/supplier"; import { getSupplierPage } from "@/api/ecw/supplier";
import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user";
/** /**
* 海运流程图 * 海运流程图
...@@ -198,9 +200,14 @@ export default { ...@@ -198,9 +200,14 @@ export default {
currentComponent: "", currentComponent: "",
// 供应商 // 供应商
allSupplier: [], allSupplier: [],
// 码头
allDocks: [],
// 用户
allUsers: [],
}; };
}, },
created() { created() {
// 供应商
getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => { getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res; const { data } = res;
this.allSupplier = data.list.map((item) => { this.allSupplier = data.list.map((item) => {
...@@ -210,6 +217,16 @@ export default { ...@@ -210,6 +217,16 @@ export default {
return item; return item;
}); });
}); });
// 码头
getDockPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res;
this.allDocks = data.list;
});
// 用户
listUser({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res;
this.allUsers = data.list ?? [];
});
}, },
methods: { methods: {
/** 关闭弹窗 */ /** 关闭弹窗 */
......
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