main
张同海 1 year ago
parent e154771969
commit 44290b8767

@ -1,6 +1,16 @@
<template>
<div class="BookingAddMain">
<div class="BookingAddButtonBox">
<el-button
type="primary"
@click="
() => {
router.push('/Booking');
}
"
>
返回
</el-button>
<el-button type="primary" @click="ClickSave"> </el-button>
<el-button
type="primary"
@ -80,7 +90,7 @@
@change="
(e) => {
store.state.Data.portlist.forEach((i) => {
if (e == i.code) {
if (e == i.ediCode) {
form.portDischarge = i.name;
}
});
@ -89,9 +99,9 @@
>
<el-option
v-for="item in store.state.Data.portlist"
:key="item.code"
:key="item.ediCode"
:label="item.name"
:value="item.code"
:value="item.ediCode"
/>
</el-select>
</el-form-item>
@ -325,6 +335,11 @@
<el-input v-model="form.pkgs" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="品名">
<el-input v-model="form.goodsDescription" />
</el-form-item>
</el-col>
<template v-if="form.cargoId == 'R'">
<el-col :span="24">
<span class="cargoS">冻柜信息</span>
@ -522,7 +537,7 @@
</div>
</template>
<script>
import { onMounted, ref } from "vue";
import { onMounted, ref, watch } from "vue";
import {
bookingCustomSave,
bookingCustomInfo,
@ -556,10 +571,10 @@ export default {
resource: "",
desc: "",
ctnList: [],
cargoData: {},
});
const serviceItemList = ref([]);
store.state.Data.cobServiceItemTenantList.forEach((item) => {
console.log(item);
if (item.defaultSelected == 1) {
serviceItemList.value.push(item.serviceCode);
form.value.serviceItemList.push({
@ -570,12 +585,40 @@ export default {
});
const viweType = ref("");
watch(
() => router.currentRoute.value,
(newValue) => {
// console.log(newValue);
viweType.value = newValue.query.type;
},
{ immediate: true }
);
onMounted(() => {
let query = router.currentRoute.value.query;
viweType.value = query.type;
if (query.type == "Edit" || query.type == "Copy") {
bookingCustomInfo({ id: query.id }).then((res) => {
form.value = { ...res.data };
form.value.cargoData = {
temperature: res.data.temperature,
minTemperature: res.data.minTemperature,
maxTemperature: res.data.maxTemperature,
ventilationRate: res.data.ventilationRate,
temperatureUnit: res.data.temperatureUnit,
dangerClass: res.data.dangerClass,
dangerLable: res.data.dangerLable,
dangerLineTel: res.data.dangerLineTel,
dangerLinkMan: res.data.dangerLinkMan,
dangerPage: res.data.dangerPage,
dangerUnNo: res.data.dangerUnNo,
limitedContainerHeight: res.data.limitedContainerHeight,
limitedContainerLength: res.data.limitedContainerLength,
limitedContainerWidth: res.data.limitedContainerWidth,
};
serviceItemList.value = [];
form.value.serviceItemList.forEach((item) => {
serviceItemList.value.push(item.code);
});
fileList.value = [];
res.data.bookingFileList.forEach((item) => {
fileList.value.push({ ...item, name: item.fileName });
@ -587,21 +630,18 @@ export default {
});
}
});
const handleClick = (data) => {
setTimeout(() => {
form.value.ctnList.splice(data.$index, 1);
}, 100);
};
const TableAdd = () => {
console.log("TableAdd");
setTimeout(() => {
form.value.ctnList.push({});
}, 100);
};
const ClickSave = () => {
console.log(form.value);
let ApiData = form.value;
// fileList
ApiData = {
@ -611,12 +651,29 @@ export default {
};
bookingCustomSave(ApiData).then((res) => {
if (res.code == 200) {
console.log(res);
ElMessage({
message: "保存成功",
type: "success",
});
router.push("/Booking");
form.value = res.data;
form.value.cargoData = {
dangerClass: res.data.dangerClass,
dangerLable: res.data.dangerLable,
dangerLineTel: res.data.dangerLineTel,
dangerLinkMan: res.data.dangerLinkMan,
dangerPage: res.data.dangerPage,
dangerUnNo: res.data.dangerUnNo,
limitedContainerHeight: res.data.limitedContainerHeight,
limitedContainerLength: res.data.limitedContainerLength,
limitedContainerWidth: res.data.limitedContainerWidth,
};
router.push({
path: "/AddBooking",
query: {
type: "Edit",
id: res.data.id,
},
});
}
});
};
@ -692,7 +749,9 @@ export default {
}
});
};
const ChangeCargoId = () => {
const ChangeCargoId = (e) => {
console.log(e);
console.log("ChangeCargoId");
form.value.cargoData = {};
};
const ChangecarrierCode = (e) => {
@ -727,6 +786,7 @@ export default {
store,
form,
serviceItemList,
router,
handleClick,
TableAdd,
ClickSave,

@ -187,7 +187,7 @@ export default {
const ClickDelete = (e) => {
if (e) {
bookingCustomDelete({ id: e.id }).then((res) => {
if (res.data == 200) {
if (res.code == 200) {
SearchBoxRef.value.Search();
}
});
@ -196,7 +196,7 @@ export default {
if (table.length) {
table.forEach((item) => {
bookingCustomDelete({ id: item.id }).then((res) => {
if (res.data == 200) {
if (res.code == 200) {
SearchBoxRef.value.Search();
}
});

File diff suppressed because it is too large Load Diff

@ -61,12 +61,12 @@
</el-menu>
</el-aside>
<el-main class="IndexMain">
<el-breadcrumb separator="/" class="IndexMainBreadcrumb">
<!-- <el-breadcrumb separator="/" class="IndexMainBreadcrumb">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<!-- <el-breadcrumb-item :to="{ path: '/About' }">
<el-breadcrumb-item :to="{ path: '/About' }">
</el-breadcrumb-item> -->
</el-breadcrumb>
</el-breadcrumb-item>
</el-breadcrumb> -->
<div class="IndexMainView">
<router-view />
</div>
@ -152,7 +152,7 @@ export default {
}
.IndexMain {
background: #e9ecf5;
padding: 0 20px 0 30px;
padding: 10px 20px 0 30px;
box-sizing: border-box;
.IndexMainBreadcrumb {
padding: 12px;

@ -38,17 +38,12 @@ export default createStore({
store.commit("XGetData", { Carrierlist: RData });
});
GetCtnlist().then((res) => {
let RData = [];
res.data.forEach((item) => {
item.name = item.code;
RData.push(item);
});
store.commit("XGetData", { Ctnlist: RData });
store.commit("XGetData", { Ctnlist: res.data });
});
Getportloadlist().then((res) => {
let RData = [];
res.data.forEach((item) => {
item.name = item.cnName;
item.name = item.enName;
RData.push(item);
});
store.commit("XGetData", { portloadlist: RData });
@ -72,7 +67,7 @@ export default createStore({
Getfrtlist().then((res) => {
let RData = [];
res.data.forEach((item) => {
item.name = item.cnName;
item.name = item.enName;
RData.push(item);
});
store.commit("XGetData", { frtlist: RData });

Loading…
Cancel
Save