414 lines
9.0 KiB
Vue
414 lines
9.0 KiB
Vue
<template>
|
|
<view class="supplySign">
|
|
<head-view :title="title" url="/pages/shipWork/supply"></head-view>
|
|
<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 style="padding: 16px; padding-bottom: 0; height: calc(100% - 66px);">
|
|
<view class="container">
|
|
<view class="head">
|
|
<view class="leftHead">
|
|
<image id="HT-logo" src="../../static/images/theme/logo.png" mode="widthFix" />
|
|
</view>
|
|
<view class="rightHead">
|
|
<p>上海海通国际汽车码头有限公司</p>
|
|
<text>SHANGHAI HAITONG INTERNATIONAL AUTOMOTIVE TERMINAL CO. LTD.</text>
|
|
</view>
|
|
</view>
|
|
<view class="headTItle">
|
|
<view class="titleLeft"></view>
|
|
<view class="title">
|
|
<p>供给作业单</p>
|
|
<text>FRESH WTAER SUPPLIED EX WHARF</text>
|
|
</view>
|
|
<view class="titleRight">
|
|
<view>
|
|
<text>编号/N0:</text>
|
|
<text>QR-7.5.1-01-05-M</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="ul">
|
|
<view class="li">
|
|
<p>船名/Name of Ship:</p>
|
|
<p>{{shipInfo.vslEnname}}</p>
|
|
</view>
|
|
<view class="li">
|
|
<p>{{tableInfo.supplyType}}/Fresh Supply:</p>
|
|
<p>{{tableInfo.supplyAmount}}吨</p>
|
|
</view>
|
|
<view class="li">
|
|
<p>航次/voy No:</p>
|
|
<p>{{tableInfo.vvyName}}</p>
|
|
</view>
|
|
<view class="li">
|
|
<p>泊位/Berth:</p>
|
|
<p>{{tableInfo.stopBerthageName}}</p>
|
|
</view>
|
|
<view class="li">
|
|
<p>日期/Date:</p>
|
|
<p>{{tableInfo.supplyDate}}</p>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
<view class="signBox">
|
|
<view class="signContent">
|
|
<view class="signTitle">
|
|
<p>船长/大副:</p>
|
|
<p>Captain/Chief Officer:</p>
|
|
</view>
|
|
<view class="signInfo" v-if="czSign.signFile == ''" @click="togoSign('1')">
|
|
去签名/Signature
|
|
</view>
|
|
<view class="signImg" v-else @click="togoSign('1')">
|
|
<image :src="czSign.signFile"></image>
|
|
<!-- <text class="del" @click="delSign(czSign.id)">删除</text> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</custom-tab-pane>
|
|
</custom-tabs>
|
|
</view>
|
|
<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: "",
|
|
vtpId: "",
|
|
bthList:[]
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
if ('params' in option) {
|
|
this.tabsValue = JSON.parse(decodeURIComponent(option.params)).tabsValue
|
|
}
|
|
},
|
|
mounted() {
|
|
this.vtpId = uni.getStorageSync('vtpId')
|
|
this.executeSql('shipInfoTable')
|
|
this.executeSql('shipOption')
|
|
},
|
|
methods: {
|
|
// 查船舶信息
|
|
executeSql(tableName) {
|
|
let sql = `select * from ${tableName} WHERE vtpId='${this.vtpId}'`
|
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
|
if(tableName == 'shipInfoTable') {
|
|
// 在resolve时执行的回调函数
|
|
this.shipInfo = value[0]
|
|
this.executeSql1('shipmentShipSupplyRespList', this.tabsValue)
|
|
} else if(tableName == 'shipOption') {
|
|
value.forEach(item => {
|
|
if(item.dictionariesName == 'bthList') {
|
|
this.bthList.push(item)
|
|
}
|
|
})
|
|
}
|
|
}).catch((error) => {
|
|
// 在reject时执行的回调函数
|
|
console.error(error);
|
|
});
|
|
},
|
|
// 查供给信息
|
|
executeSql1(tableName, tabsValue) {
|
|
let sql = `select * from ${tableName} WHERE vtpId='${this.vtpId}'`
|
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
|
// 在resolve时执行的回调函数
|
|
this.tabsList = []
|
|
this.tableInfo = value[tabsValue]
|
|
console.log(this.tableInfo)
|
|
value.forEach((v, index) => {
|
|
let obj = {
|
|
name: `供给${index + 1}`,
|
|
}
|
|
this.tabsList.push(obj)
|
|
})
|
|
this.bthList.forEach(item => {
|
|
if(item.ptrDesc == this.tableInfo.stopBerthageName) {
|
|
this.tableInfo.stopBerthageName = item.ptrEnDesc
|
|
}
|
|
|
|
})
|
|
this.executeSql2()
|
|
}).catch((error) => {
|
|
// 在reject时执行的回调函数
|
|
console.error(error);
|
|
});
|
|
},
|
|
// 查单证签字表
|
|
executeSql2() {
|
|
let sql = `select * from workSignTable WHERE bizId = '${this.tableInfo.sssId}';`
|
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
|
// 在resolve时执行的回调函数
|
|
if (value.length > 0) {
|
|
this.czSign = value[0]
|
|
} else {
|
|
this.czSign = {
|
|
signFile: ""
|
|
}
|
|
}
|
|
}).catch((error) => {
|
|
// 在reject时执行的回调函数
|
|
console.error(error);
|
|
});
|
|
},
|
|
// 标签切换
|
|
tabsChange(e) {
|
|
this.tabsValue = e.value
|
|
this.executeSql1('shipmentShipSupplyRespList', e.value)
|
|
},
|
|
// 点击签名
|
|
togoSign(signType) {
|
|
let obj = {
|
|
id: this.tableInfo.sssId,
|
|
url: "supplySign",
|
|
signType: Number(signType), // 0 指导员 1 船长/大副
|
|
signTable: "7",
|
|
tabsValue: this.tabsValue,
|
|
vvyId: this.tableInfo.vvyId,
|
|
}
|
|
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";
|
|
|
|
.contentFixed {
|
|
margin-top: 68px !important;
|
|
|
|
/deep/.tab .tab-bar {
|
|
height: 66px;
|
|
line-height: 66px;
|
|
position: relative;
|
|
}
|
|
|
|
/deep/.tab .tab-bar-item {
|
|
height: 66px;
|
|
line-height: 66px;
|
|
font-size: 18px;
|
|
color: #23262E;
|
|
font-weight: bold;
|
|
font-family: PingFangSC-Semibold;
|
|
padding: 0 24px !important;
|
|
}
|
|
|
|
/deep/.tab .tab-bar-item.active {
|
|
color: #0067CF
|
|
}
|
|
|
|
/deep/.tab .tab-bar-item .active-line {
|
|
color: #0067CF;
|
|
width: 54px;
|
|
height: 4px;
|
|
}
|
|
|
|
/deep/.tab-pane {
|
|
width: 100%;
|
|
height: calc(100vh - 66px - 68px);
|
|
overflow: hidden;
|
|
}
|
|
|
|
/deep/.tab .tab-cont {
|
|
padding-bottom: 0;
|
|
}
|
|
}
|
|
|
|
.container {
|
|
padding: 0px 16px;
|
|
background: #FFFFFF;
|
|
border-radius: 8px;
|
|
|
|
.head {
|
|
height: 85px;
|
|
padding: 16px 0;
|
|
margin: 0 8px;
|
|
border-bottom: 1px solid #999;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
.rightHead {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
text-align: right;
|
|
|
|
p {
|
|
font-size: 22px;
|
|
color: #0052A4;
|
|
font-weight: bold;
|
|
}
|
|
|
|
text {
|
|
font-size: 14px;
|
|
color: #666666;
|
|
}
|
|
}
|
|
}
|
|
|
|
.headTItle {
|
|
display: flex;
|
|
justify-content: space-around;
|
|
padding: 24px 0;
|
|
margin: 0 8px;
|
|
border-bottom: 1px solid #EEEEEE;
|
|
|
|
.title {
|
|
flex: 3;
|
|
text-align: center;
|
|
|
|
p {
|
|
font-size: 24px;
|
|
color: #23262E;
|
|
font-weight: bold;
|
|
}
|
|
|
|
text {
|
|
font-size: 18px;
|
|
color: #23262E;
|
|
}
|
|
}
|
|
|
|
.titleLeft {
|
|
flex: 1;
|
|
}
|
|
|
|
.titleRight {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-end;
|
|
|
|
text:first-child {
|
|
font-size: 14px;
|
|
color: #666666;
|
|
}
|
|
|
|
text:last-child {
|
|
font-size: 18px;
|
|
color: #0052A4;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
}
|
|
|
|
.ul {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
padding: 15px 0;
|
|
|
|
.li {
|
|
min-width: 33%;
|
|
display: flex;
|
|
justify-content: center;
|
|
margin-bottom: 24px;
|
|
|
|
p {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
}
|
|
|
|
p:last-child {
|
|
color: #23262E;
|
|
font-weight: bold;
|
|
font-size: 14px;
|
|
margin-left: 8px;
|
|
margin-top: 2px;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
.signBox {
|
|
width: 100%;
|
|
height: 66px;
|
|
background: #FFFFFF;
|
|
border: 1px solid #E1E5ED;
|
|
box-shadow: 0 -1px 4px 0 rgba(0, 0, 0, 0.05);
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
padding: 0 70px;
|
|
|
|
.row {
|
|
width: 1px;
|
|
height: 30px;
|
|
background-color: #ccc;
|
|
margin-top: 18px;
|
|
}
|
|
|
|
.signContent {
|
|
display: flex;
|
|
margin: 0 54px;
|
|
|
|
.signTitle {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
text-align: right;
|
|
}
|
|
|
|
.signInfo {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
font-size: 18px;
|
|
color: #0052A4;
|
|
margin-left: 16px;
|
|
}
|
|
|
|
.signImg {
|
|
width: 100px;
|
|
height: 54px;
|
|
margin-top: 5px;
|
|
margin-left: 10px;
|
|
}
|
|
}
|
|
|
|
.signContent:last-child {
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
</style> |