pad-app/pages/shipWork/untieSign.vue

264 lines
6.8 KiB
Vue
Raw Normal View History

2023-09-23 20:16:54 +08:00
<template>
<view class="untieSign">
<head-view :title="title" url="/pages/shipWork/untieCord"></head-view>
2023-11-01 18:40:05 +08:00
<view class="contentFixed">
<custom-tabs type="c1" :value="tabsValue" @change="tabsChange">
<custom-tab-pane :label="item.name" v-for="(item,index) in tabsList" :name="'c1_'+index" :key="index">
<view></view>
<view class="container">
<table>
<tbody>
<tr>
<td class="h-l1r1">
<image id="HT-logo" src="../../static/images/theme/logo.png" mode="widthFix">
</image>
</td>
<td class="h-l1r2">&nbsp;</td>
<td class="h-l1r3">
<p>上海海通国际汽车码头有限公司</p>
<p>Shanghai HaiTong International Automotive Terminal Co.,Ltd.</p>
</td>
</tr>
<tr>
<td colspan="3">
<p class="bh-dz">QR-7.5.1-01-11-M</p>
</td>
</tr>
<tr>
<td colspan="3" class="h-l2r1">
<p class="name-dz">海通码头系解缆签证单</p>
<p class="ename-dz">MOONRING AND UNMOONRING RECORD</p>
</td>
</tr>
</tbody>
</table>
<table id="t-main2">
<tbody>
<tr>
<td class="td1">
<p>船名</p>
<p>Name of Ship&nbsp;&nbsp;</p>
</td>
<td class="td2">{{shipInfo.vslCnname}}</td>
<td class="td1">
<p>船舶净吨</p>
<p>Net tonnage&nbsp;&nbsp;</p>
</td>
<td class="td2">{{tableInfo.shipDeadWeight}}</td>
<td class="td3">
<p></p>
<p>Tons</p>
</td>
</tr>
<tr>
<td colspan="6" class="tr0">&nbsp;</td>
</tr>
<tr>
<td class="td1">
<p>航次</p>
<p>voy No&nbsp;&nbsp;</p>
</td>
<td class="td2">{{tableInfo.vvyName}}</td>
<td class="td1">
<p>泊位</p>
<p>Berth&nbsp;&nbsp;</p>
</td>
<td class="td2">{{tableInfo.bthIdName}}</td>
<td class="td1">
<p>系缆时间</p>
<p>Time of Moonring&nbsp;&nbsp;</p>
</td>
<td class="td2">{{tableInfo.attachTime}}</td>
</tr>
<tr>
<td colspan="6" class="tr0">&nbsp;</td>
</tr>
<tr>
<td class="td1">
<p>解缆时间</p>
<p>Time of Unmoonring&nbsp;&nbsp;</p>
</td>
<td class="td2">{{tableInfo.unmoorTime}}</td>
<td class="td1">
<p>移泊时间</p>
<p>Time of Shifting&nbsp;&nbsp;</p>
</td>
<td class="td2">{{tableInfo.shiftingBerthTime}}</td>
<td class="td1">
<p>停泊时间</p>
<p>Time of Shifting&nbsp;&nbsp;</p>
</td>
<td class="td2">{{tableInfo.noProductBerthTime}}</td>
</tr>
</tbody>
</table>
<view class="sginBox">
<view class="box">
<p>Capt/Chief Mate(船长/大副):</p>
<p class="sign" @click="togoSign('1')" v-if="czSign.signFile == ''"></p>
<template v-else>
<image :src="czSign.signFile" mode="widthFix"></image>
<!-- <text class="del" @click="delSign(czSign.webId)"></text> -->
</template>
</view>
2023-09-23 20:16:54 +08:00
</view>
</view>
2023-11-01 18:40:05 +08:00
</custom-tab-pane>
</custom-tabs>
</view>
2023-09-23 20:16:54 +08:00
<uni-popup ref="delPopup" type="dialog">
<uni-popup-dialog type="error" confirmText="确定" title="通知" content="是否删除此条数据"
@confirm="delConfirm"></uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
import sqlite from "../../common/sqlite.js"
export default {
data() {
return {
title: "系解缆签名",
tabsValue: 0,
tabsList: [],
// 船舶信息
shipInfo: {},
// 表内数据
tableInfo: [],
// 签名信息
czSign: {},
delId: "",
2023-11-01 18:40:05 +08:00
vtpId: "",
2023-09-23 20:16:54 +08:00
}
},
onLoad(option) {
if ('params' in option) {
this.tabsValue = JSON.parse(decodeURIComponent(option.params)).tabsValue
}
},
mounted() {
2023-11-01 18:40:05 +08:00
this.vtpId = uni.getStorageSync('vtpId')
2023-09-23 20:16:54 +08:00
this.executeSql('shipInfoTable')
},
methods: {
// 查船舶信息
executeSql(tableName) {
2023-11-01 18:40:05 +08:00
let sql = `select * from ${tableName} WHERE vtpId = '${this.vtpId}'`
2023-09-23 20:16:54 +08:00
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
this.shipInfo = value[0]
this.executeSql1('attachUnmoorRespList', this.tabsValue)
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
// 查系解缆信息
executeSql1(tableName, tabsValue) {
2023-11-01 18:40:05 +08:00
let sql = `select * from ${tableName} WHERE vtpId='${this.vtpId}'`
2023-09-23 20:16:54 +08:00
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
this.tabsList = []
this.tableInfo = value[tabsValue]
value.forEach((v, index) => {
let obj = {
name: `系解缆${index + 1}`,
}
this.tabsList.push(obj)
})
this.executeSql2()
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
// 查单证签字表
executeSql2() {
2023-11-01 18:40:05 +08:00
let sql = `select * from workSignTable WHERE bizId = '${this.tableInfo.sauId}';`
2023-09-23 20:16:54 +08:00
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
if (value.length > 0) {
this.czSign = value[0]
} else {
this.czSign = {
2023-11-01 18:40:05 +08:00
signFile: ""
2023-09-23 20:16:54 +08:00
}
}
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
// 标签切换
tabsChange(e) {
this.tabsValue = e.value
this.executeSql1('attachUnmoorRespList', e.value)
},
// 点击签名
togoSign(signType) {
let obj = {
2023-11-01 18:40:05 +08:00
id: this.tableInfo.sauId,
2023-09-23 20:16:54 +08:00
url: "untieSign",
2023-11-01 18:40:05 +08:00
signType: Number(signType), // 0 指导员 1 船长/大副
signTable: "1",
2023-09-23 20:16:54 +08:00
tabsValue: this.tabsValue,
2023-11-01 18:40:05 +08:00
vvyId: this.tableInfo.vvyId,
2023-09-23 20:16:54 +08:00
}
const params = encodeURIComponent(JSON.stringify(obj));
uni.navigateTo({
url: `/pages/shipWork/sign?params=${params}`
})
},
// 删除当前签名
delSign(id) {
this.$refs.delPopup.open()
this.delId = id
},
// 弹框删除
delConfirm() {
let sql = `DELETE FROM workSignTable WHERE webId = '${this.delId}';`
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
this.executeSql2()
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
}
}
</script>
<style lang="less" scoped>
@import "../../style/css/main-dz.css";
.container {
2023-11-01 18:40:05 +08:00
padding: 0px 20px;
2023-09-23 20:16:54 +08:00
}
.sginBox {
width: 100%;
display: flex;
justify-content: flex-end;
.box {
display: flex;
margin-right: 80px;
image {
width: 200px;
height: 50px;
}
.del {
color: red;
}
}
.sign {
color: #2979ff;
margin-left: 10px;
}
}
</style>