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

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

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

File diff suppressed because it is too large Load Diff

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

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

Loading…
Cancel
Save