259 lines
6.6 KiB
Vue
259 lines
6.6 KiB
Vue
<template>
|
||
<view class="untieSign">
|
||
<head-view :title="title" url="/pages/shipWork/untieCord"></head-view>
|
||
<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"> </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 </p>
|
||
</td>
|
||
<td class="td2">{{shipInfo.vslCnname}}</td>
|
||
<td class="td1">
|
||
<p>船舶净吨:</p>
|
||
<p>Net tonnage </p>
|
||
</td>
|
||
<td class="td2">{{tableInfo.shipDeadWeight}}</td>
|
||
<td class="td3">
|
||
<p>吨</p>
|
||
<p>Tons</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="6" class="tr0"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="td1">
|
||
<p>航次:</p>
|
||
<p>voy No </p>
|
||
</td>
|
||
<td class="td2">{{shipInfo.vvyName}}</td>
|
||
<td class="td1">
|
||
<p>泊位:</p>
|
||
<p>Berth </p>
|
||
</td>
|
||
<td class="td2">{{tableInfo.bthIdName}}</td>
|
||
<td class="td1">
|
||
<p>系缆时间:</p>
|
||
<p>Time of Moonring </p>
|
||
</td>
|
||
<td class="td2">{{tableInfo.attachTime}}</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="6" class="tr0"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="td1">
|
||
<p>解缆时间:</p>
|
||
<p>Time of Unmoonring </p>
|
||
</td>
|
||
<td class="td2">{{tableInfo.unmoorTime}}</td>
|
||
<td class="td1">
|
||
<p>移泊时间:</p>
|
||
<p>Time of Shifting </p>
|
||
</td>
|
||
<td class="td2">{{tableInfo.shiftingBerthTime}}</td>
|
||
<td class="td1">
|
||
<p>停泊时间:</p>
|
||
<p>Time of Shifting </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.url == ''">点击签名</p>
|
||
<template v-else>
|
||
<image :src="czSign.url" mode="widthFix"></image>
|
||
<text class="del" @click="delSign(czSign.webId)">删除</text>
|
||
</template>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</custom-tab-pane>
|
||
</custom-tabs>
|
||
<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: "",
|
||
}
|
||
},
|
||
onLoad(option) {
|
||
if ('params' in option) {
|
||
this.tabsValue = JSON.parse(decodeURIComponent(option.params)).tabsValue
|
||
}
|
||
},
|
||
mounted() {
|
||
this.executeSql('shipInfoTable')
|
||
},
|
||
methods: {
|
||
// 查船舶信息
|
||
executeSql(tableName) {
|
||
let sql = `select * from ${tableName}`
|
||
sqlite.executeSqlCeshi(sql).then((value) => {
|
||
// 在resolve时执行的回调函数
|
||
this.shipInfo = value[0]
|
||
this.executeSql1('attachUnmoorRespList', this.tabsValue)
|
||
}).catch((error) => {
|
||
// 在reject时执行的回调函数
|
||
console.error(error);
|
||
});
|
||
},
|
||
// 查系解缆信息
|
||
executeSql1(tableName, tabsValue) {
|
||
let sql = `select * from ${tableName} WHERE vvyId='${this.shipInfo.vvyId}'`
|
||
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() {
|
||
let sql = `select * from workSignTable WHERE signId = '${this.tableInfo.webId}';`
|
||
sqlite.executeSqlCeshi(sql).then((value) => {
|
||
// 在resolve时执行的回调函数
|
||
if (value.length > 0) {
|
||
this.czSign = value[0]
|
||
} else {
|
||
this.czSign = {
|
||
url: ""
|
||
}
|
||
}
|
||
}).catch((error) => {
|
||
// 在reject时执行的回调函数
|
||
console.error(error);
|
||
});
|
||
},
|
||
// 标签切换
|
||
tabsChange(e) {
|
||
this.tabsValue = e.value
|
||
this.executeSql1('attachUnmoorRespList', e.value)
|
||
},
|
||
// 点击签名
|
||
togoSign(signType) {
|
||
let obj = {
|
||
id: this.tableInfo.webId,
|
||
url: "untieSign",
|
||
signType: signType, // 0 指导员 1 船长/大副
|
||
signTable: "untieCord",
|
||
tabsValue: this.tabsValue,
|
||
}
|
||
const params = encodeURIComponent(JSON.stringify(obj));
|
||
uni.navigateTo({
|
||
url: `/pages/shipWork/sign?params=${params}`
|
||
})
|
||
},
|
||
// 删除当前签名
|
||
delSign(id) {
|
||
this.$refs.delPopup.open()
|
||
console.log(id)
|
||
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 {
|
||
padding: 10px 20px;
|
||
}
|
||
|
||
.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> |