|
@@ -1,24 +1,24 @@
|
|
|
<template>
|
|
|
-<!-- 新增卸船作业 -->
|
|
|
+ <!-- 新增卸船作业 -->
|
|
|
<div class="shipTransport">
|
|
|
<page-title>返回</page-title>
|
|
|
<!-- 第一部分 -->
|
|
|
- <div class="top">
|
|
|
- <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
|
|
|
- <el-button type="primary" class="btn" @click="onclick()">
|
|
|
- <i class="el-icon-search"></i>查询
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <dilTable v-bind.sync="option" @radio-change="currentRadioChange">
|
|
|
- </dilTable>
|
|
|
+ <div class="top">
|
|
|
+ <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
|
|
|
+ <el-button type="primary" class="btn" @click="onclick()">
|
|
|
+ <i class="el-icon-search"></i>查询
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <dilTable v-bind.sync="option" @radio-change="currentRadioChange">
|
|
|
+ </dilTable>
|
|
|
<div class="form">
|
|
|
<!-- 第二部分 -->
|
|
|
<div class="form_box">
|
|
|
- <dil-form :formId="121" v-model="form"></dil-form>
|
|
|
+ <dil-form :formId="121" v-model="form"></dil-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="button_box">
|
|
|
- <el-button type="primary" @click="makeSure" >新增卸船作业</el-button>
|
|
|
+ <el-button type="primary" @click="makeSure">新增卸船作业</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
- input:'',
|
|
|
+ input: "",
|
|
|
restaurants: [],
|
|
|
state: "",
|
|
|
form: {},
|
|
@@ -38,98 +38,134 @@ export default {
|
|
|
// 表格请求数据的地址
|
|
|
requestUrl: "/api/v1/tms/getCapacityList?apiId=138",
|
|
|
// 控制显示当选列
|
|
|
- selectionType: "radio",
|
|
|
- unloadMap:{},
|
|
|
+ selectionType: "radio"
|
|
|
},
|
|
|
+ unloadMap: {}
|
|
|
};
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ computed: {
|
|
|
+ a1() {
|
|
|
+ return this.form.resultEndTime;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ a1() {
|
|
|
+ this.unloadShipMes();
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ unloadShipMes() {
|
|
|
+ if (
|
|
|
+ typeof this.form.resultStartTime == "undefined" ||
|
|
|
+ this.form.resultStartTime == null ||
|
|
|
+ this.form.resultStartTime == "null" ||
|
|
|
+ this.form.resultStartTime == "undefined"
|
|
|
+ ) {
|
|
|
+ this.$message.warning("请先填写卸船开始时间!");
|
|
|
+ this.form.resultEndTime = null;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ },
|
|
|
currentRadioChange(row) {
|
|
|
- this.unloadMap=row
|
|
|
+ this.unloadMap = {};
|
|
|
+ this.unloadMap = row;
|
|
|
console.log(row);
|
|
|
},
|
|
|
- onclick(){
|
|
|
- console.log(this.input);
|
|
|
- this.option.requestUrl = "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input;
|
|
|
+ onclick() {
|
|
|
+ this.option.requestUrl =
|
|
|
+ "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input;
|
|
|
},
|
|
|
// 新增
|
|
|
makeSure() {
|
|
|
+ console.log(this.unloadMap);
|
|
|
+ if (JSON.stringify(this.unloadMap).length == 2) {
|
|
|
+ this.$message.error("请先选择卸船的船只!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.form.resultEndTime != null &&
|
|
|
+ this.form.resultEndTime != "undefined" &&
|
|
|
+ typeof this.form.resultEndTime != "undefined" &&
|
|
|
+ this.form.resultEndTime != "null"
|
|
|
+ ) {
|
|
|
+ this.unloadShipMes();
|
|
|
+ }
|
|
|
+ let resultArrivalDate = null;
|
|
|
+ let resultStartTime = null;
|
|
|
+ let resultEndTime = null;
|
|
|
+ if (
|
|
|
+ typeof this.form.resultArrivalDate != "undefined" &&
|
|
|
+ this.form.resultArrivalDate != null
|
|
|
+ ) {
|
|
|
+ resultArrivalDate = sjTime(this.form.resultArrivalDate);
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ typeof this.form.resultStartTime != "undefined" &&
|
|
|
+ this.form.resultStartTime != null
|
|
|
+ ) {
|
|
|
+ resultStartTime = sjTime(this.form.resultStartTime);
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ typeof this.form.resultEndTime != "undefined" &&
|
|
|
+ this.form.resultEndTime != null
|
|
|
+ ) {
|
|
|
+ resultEndTime = sjTime(this.form.resultEndTime);
|
|
|
+ }
|
|
|
let mapVal = {
|
|
|
- resultArrivalDate: sjTime(
|
|
|
- this.form.resultArrivalDate
|
|
|
- ),
|
|
|
- resultStartTime: sjTime(
|
|
|
- this.form.resultStartTime
|
|
|
- ),
|
|
|
- resultEndTime: sjTime(
|
|
|
- this.form.resultEndTime
|
|
|
- ),
|
|
|
- resultStatus: this.form.resultStatus,
|
|
|
+ resultArrivalDate: resultArrivalDate,
|
|
|
+ resultStartTime: resultStartTime,
|
|
|
+ resultEndTime: resultEndTime,
|
|
|
+ resultStatus: this.form.resultStatus
|
|
|
};
|
|
|
- console.log(mapVal);
|
|
|
- if (
|
|
|
- mapVal.resultArrivalDate==null||
|
|
|
- mapVal.resultStartTime==null||
|
|
|
- mapVal.resultEndTime==null||
|
|
|
- mapVal.resultStatus==null
|
|
|
- ) this.$message.error("存在空值!");
|
|
|
- else
|
|
|
+ debugger;
|
|
|
this.axios
|
|
|
- .post(
|
|
|
- "/api/v1/tms/addUnLoadShip",
|
|
|
- {
|
|
|
- mapVal: mapVal,
|
|
|
- unloadMap: this.unloadMap
|
|
|
- }
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
+ .post("/api/v1/tms/addUnLoadShip", {
|
|
|
+ mapVal: mapVal,
|
|
|
+ unloadMap: this.unloadMap
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "新增成功!",
|
|
|
+ message: "新增成功!"
|
|
|
});
|
|
|
// this.$refs.table.refreshData();
|
|
|
this.$router.go(-1);
|
|
|
} else {
|
|
|
this.$message.error("新增失败!");
|
|
|
}
|
|
|
- this.$refs['table'].resetField();
|
|
|
});
|
|
|
},
|
|
|
loadAll() {
|
|
|
- return [
|
|
|
-
|
|
|
- ];
|
|
|
+ return [];
|
|
|
},
|
|
|
handleSelect(item) {
|
|
|
console.log(item);
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
-<style lang='scss'>
|
|
|
-.shipTransport{
|
|
|
- .form{
|
|
|
+<style lang="scss">
|
|
|
+.shipTransport {
|
|
|
+ .form {
|
|
|
display: flex;
|
|
|
- .form_box{
|
|
|
+ .form_box {
|
|
|
width: 320px;
|
|
|
margin-left: 35%;
|
|
|
margin-top: 30px;
|
|
|
margin-right: 20px;
|
|
|
- .el-form{
|
|
|
- .preview-group{
|
|
|
- .el-form-item{
|
|
|
- .el-form-item__label{
|
|
|
+ .el-form {
|
|
|
+ .preview-group {
|
|
|
+ .el-form-item {
|
|
|
+ .el-form-item__label {
|
|
|
display: inline-block;
|
|
|
width: 70px !important;
|
|
|
}
|
|
|
- .el-form-item__content{
|
|
|
- .el-select{
|
|
|
+ .el-form-item__content {
|
|
|
+ .el-select {
|
|
|
width: 250px;
|
|
|
}
|
|
|
- .el-input{
|
|
|
+ .el-input {
|
|
|
width: 250px;
|
|
|
}
|
|
|
}
|
|
@@ -145,8 +181,8 @@ export default {
|
|
|
margin-right: 1.25rem;
|
|
|
}
|
|
|
}
|
|
|
- .button_box{
|
|
|
+ .button_box {
|
|
|
margin-left: 45%;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|