|
@@ -18,135 +18,139 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="button_box">
|
|
|
- <el-button type="primary" :loading="isLoading" @click="makeSure">新增卸船作业</el-button>
|
|
|
+ <el-button type="primary" :loading="isLoading" @click="makeSure"
|
|
|
+ >新增卸船作业</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import PageTitle from "@/components/Page/Title";
|
|
|
-import { sjTime } from "@/utils/sharedJsFile";
|
|
|
+import PageTitle from '@/components/Page/Title'
|
|
|
+import { sjTime } from '@/utils/sharedJsFile'
|
|
|
+import { getCookie } from '@/utils/util.js'
|
|
|
export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
- input: "",
|
|
|
- isLoading:false,
|
|
|
+ input: '',
|
|
|
+ isLoading: false,
|
|
|
restaurants: [],
|
|
|
- state: "",
|
|
|
+ state: '',
|
|
|
form: {},
|
|
|
option: {
|
|
|
// 表格请求数据的地址
|
|
|
- requestUrl: "/api/v1/tms/getCapacityList?apiId=138",
|
|
|
+ requestUrl: '/api/v1/tms/getCapacityList?apiId=138',
|
|
|
// 控制显示当选列
|
|
|
- selectionType: "radio"
|
|
|
+ selectionType: 'radio'
|
|
|
},
|
|
|
unloadMap: {}
|
|
|
- };
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
a1() {
|
|
|
- return this.form.resultEndTime;
|
|
|
+ return this.form.resultEndTime
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
a1() {
|
|
|
- this.unloadShipMes();
|
|
|
+ this.unloadShipMes()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
unloadShipMes() {
|
|
|
if (
|
|
|
- typeof this.form.resultStartTime == "undefined" ||
|
|
|
+ typeof this.form.resultStartTime == 'undefined' ||
|
|
|
this.form.resultStartTime == null ||
|
|
|
- this.form.resultStartTime == "null" ||
|
|
|
- this.form.resultStartTime == "undefined"
|
|
|
+ this.form.resultStartTime == 'null' ||
|
|
|
+ this.form.resultStartTime == 'undefined'
|
|
|
) {
|
|
|
- this.$message.warning("请先填写卸船开始时间!");
|
|
|
- this.form.resultEndTime = null;
|
|
|
+ this.$message.warning('请先填写卸船开始时间!')
|
|
|
+ this.form.resultEndTime = null
|
|
|
}
|
|
|
- return;
|
|
|
+ return
|
|
|
},
|
|
|
currentRadioChange(row) {
|
|
|
- this.unloadMap = {};
|
|
|
- this.unloadMap = row;
|
|
|
- console.log(row);
|
|
|
+ this.unloadMap = {}
|
|
|
+ this.unloadMap = row
|
|
|
+ console.log(row)
|
|
|
},
|
|
|
onclick() {
|
|
|
this.option.requestUrl =
|
|
|
- "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input;
|
|
|
+ '/api/v1/tms/getCapacityList?apiId=138&con=' + this.input
|
|
|
},
|
|
|
// 新增
|
|
|
makeSure() {
|
|
|
- this.isLoading=true;
|
|
|
- console.log(this.unloadMap);
|
|
|
+ this.isLoading = true
|
|
|
+ console.log(this.unloadMap)
|
|
|
if (JSON.stringify(this.unloadMap).length == 2) {
|
|
|
- this.$message.error("请先选择卸船的船只!");
|
|
|
- this.isLoading=false;
|
|
|
- return;
|
|
|
+ this.$message.error('请先选择卸船的船只!')
|
|
|
+ this.isLoading = false
|
|
|
+ return
|
|
|
}
|
|
|
if (
|
|
|
this.form.resultEndTime != null &&
|
|
|
- this.form.resultEndTime != "undefined" &&
|
|
|
- typeof this.form.resultEndTime != "undefined" &&
|
|
|
- this.form.resultEndTime != "null"
|
|
|
+ this.form.resultEndTime != 'undefined' &&
|
|
|
+ typeof this.form.resultEndTime != 'undefined' &&
|
|
|
+ this.form.resultEndTime != 'null'
|
|
|
) {
|
|
|
- this.unloadShipMes();
|
|
|
+ this.unloadShipMes()
|
|
|
}
|
|
|
- let resultArrivalDate = null;
|
|
|
- let resultStartTime = null;
|
|
|
- let resultEndTime = null;
|
|
|
+ let resultArrivalDate = null
|
|
|
+ let resultStartTime = null
|
|
|
+ let resultEndTime = null
|
|
|
if (
|
|
|
- typeof this.form.resultArrivalDate != "undefined" &&
|
|
|
+ typeof this.form.resultArrivalDate != 'undefined' &&
|
|
|
this.form.resultArrivalDate != null
|
|
|
) {
|
|
|
- resultArrivalDate = sjTime(this.form.resultArrivalDate);
|
|
|
+ resultArrivalDate = sjTime(this.form.resultArrivalDate)
|
|
|
}
|
|
|
if (
|
|
|
- typeof this.form.resultStartTime != "undefined" &&
|
|
|
+ typeof this.form.resultStartTime != 'undefined' &&
|
|
|
this.form.resultStartTime != null
|
|
|
) {
|
|
|
- resultStartTime = sjTime(this.form.resultStartTime);
|
|
|
+ resultStartTime = sjTime(this.form.resultStartTime)
|
|
|
}
|
|
|
if (
|
|
|
- typeof this.form.resultEndTime != "undefined" &&
|
|
|
+ typeof this.form.resultEndTime != 'undefined' &&
|
|
|
this.form.resultEndTime != null
|
|
|
) {
|
|
|
- resultEndTime = sjTime(this.form.resultEndTime);
|
|
|
+ resultEndTime = sjTime(this.form.resultEndTime)
|
|
|
}
|
|
|
let mapVal = {
|
|
|
resultArrivalDate: resultArrivalDate,
|
|
|
resultStartTime: resultStartTime,
|
|
|
resultEndTime: resultEndTime,
|
|
|
resultStatus: this.form.resultStatus
|
|
|
- };
|
|
|
+ }
|
|
|
this.axios
|
|
|
- .post("/api/v1/tms/addUnLoadShip", {
|
|
|
+ .post('/api/v1/tms/addUnLoadShip', {
|
|
|
mapVal: mapVal,
|
|
|
- unloadMap: this.unloadMap
|
|
|
+ unloadMap: this.unloadMap,
|
|
|
+ userId: getCookie('userId')
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: "新增成功!"
|
|
|
- });
|
|
|
+ type: 'success',
|
|
|
+ message: '新增成功!'
|
|
|
+ })
|
|
|
// this.$refs.table.refreshData();
|
|
|
- this.$router.go(-1);
|
|
|
+ this.$router.go(-1)
|
|
|
} else {
|
|
|
- this.$message.error("新增失败!");
|
|
|
+ this.$message.error('新增失败!')
|
|
|
}
|
|
|
- this.isLoading=false;
|
|
|
- });
|
|
|
+ this.isLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
loadAll() {
|
|
|
- return [];
|
|
|
+ return []
|
|
|
},
|
|
|
handleSelect(item) {
|
|
|
- console.log(item);
|
|
|
+ console.log(item)
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
.shipTransport {
|
|
@@ -186,7 +190,7 @@ export default {
|
|
|
}
|
|
|
.button_box {
|
|
|
margin-left: 45%;
|
|
|
- width:160px;
|
|
|
+ width: 160px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|