2023-07-11 15:28:40 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view class="mixWork">
|
2023-08-23 17:42:44 +08:00
|
|
|
|
<head-view :title="title"></head-view>
|
2023-07-11 15:28:40 +08:00
|
|
|
|
<view class="container">
|
2023-07-24 16:56:46 +08:00
|
|
|
|
<view class="signBox">
|
|
|
|
|
<p class="sign" @click="sign">点击签名</p>
|
|
|
|
|
</view>
|
2023-07-11 15:28:40 +08:00
|
|
|
|
<view class="tabsList">
|
|
|
|
|
<view class="tabsBox" v-for="(item,index) in tabsList" :key="index" :class="{active:tabsIndex == index}"
|
|
|
|
|
@click="tabsClick(item,index)">{{item}}</view>
|
|
|
|
|
</view>
|
2023-07-11 17:29:53 +08:00
|
|
|
|
<!-- 人员信息列表 -->
|
2023-07-19 18:12:19 +08:00
|
|
|
|
<view class="ul" v-if="tabsType == 0">
|
2023-07-24 16:56:46 +08:00
|
|
|
|
<template v-if="peopleInfo.length > 0">
|
|
|
|
|
<view class="li" v-for="(item,index) in peopleInfo" :key="index" @click="add('look',item,index)">
|
2023-08-23 17:42:44 +08:00
|
|
|
|
<view class="title">
|
|
|
|
|
<image src="../../static/images/shipWork/hc.png" mode=""></image>
|
|
|
|
|
<text>航次:{{item.vvyName}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="liInfo">
|
|
|
|
|
<p>贸易类型:<text>{{item.tradeTypeName}}</text></p>
|
|
|
|
|
<p>进出口:<text>{{item.importExportFlagName}}</text></p>
|
|
|
|
|
<p>作业组数:<text>{{item.workSuite}}</text></p>
|
|
|
|
|
<p>单船人数:<text>{{item.shipPerson}}</text></p>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="status didNot">
|
|
|
|
|
<p>未上传</p>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="status success">
|
|
|
|
|
<p>已上传</p>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="status fail">
|
|
|
|
|
<p>上传失败</p>
|
|
|
|
|
</view> -->
|
2023-07-24 16:56:46 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
2023-08-23 17:42:44 +08:00
|
|
|
|
<template v-else>
|
|
|
|
|
<o-empty height="70vh" bg="#f5f6fa" width="100vw" />
|
|
|
|
|
</template>
|
2023-07-18 17:37:15 +08:00
|
|
|
|
</view>
|
2023-08-15 09:18:52 +08:00
|
|
|
|
|
2023-07-11 17:29:53 +08:00
|
|
|
|
<!-- 工班信息列表 -->
|
2023-08-23 17:42:44 +08:00
|
|
|
|
<view class="ul shiftUl" v-if="tabsType == 1">
|
2023-07-24 16:56:46 +08:00
|
|
|
|
<template v-if="shiftInfo.length > 0">
|
|
|
|
|
<view class="li" v-for="(item,index) in shiftInfo" :key="index" @click="lookShift(item,index)">
|
2023-08-23 17:42:44 +08:00
|
|
|
|
<view class="title">
|
|
|
|
|
<image src="../../static/images/shipWork/hc.png" mode=""></image>
|
|
|
|
|
<text>航次:{{item[0].vvyName}}</text>
|
|
|
|
|
</view>
|
2023-08-15 09:18:52 +08:00
|
|
|
|
<view class="shift" v-for="(item2,index2) in item" :key="index2">
|
2023-08-23 17:42:44 +08:00
|
|
|
|
<text>{{item2.pwcTypeName}}</text>
|
|
|
|
|
<text class="text">作业开始时间:</text><text
|
|
|
|
|
class="time">{{item2.workStartTime.substring(0,item2.workStartTime.length - 3)}}</text>
|
|
|
|
|
<text class="text">作业结束时间:</text><text
|
|
|
|
|
class="time">{{item2.workEndTime.substring(0,item2.workEndTime.length - 3)}}</text>
|
2023-07-24 16:56:46 +08:00
|
|
|
|
</view>
|
2023-08-23 17:42:44 +08:00
|
|
|
|
<view class="status didNot">
|
|
|
|
|
<p>未上传</p>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="status success">
|
|
|
|
|
<p>已上传</p>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="status fail">
|
|
|
|
|
<p>上传失败</p>
|
|
|
|
|
</view> -->
|
2023-07-11 15:28:40 +08:00
|
|
|
|
</view>
|
2023-07-24 16:56:46 +08:00
|
|
|
|
</template>
|
|
|
|
|
<o-empty v-else height="70vh" bg="#f5f6fa" />
|
2023-07-18 17:37:15 +08:00
|
|
|
|
</view>
|
2023-07-11 17:29:53 +08:00
|
|
|
|
<view class="addBtn" @click="add('add')">+ 新增</view>
|
2023-07-11 15:28:40 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-08-01 09:32:45 +08:00
|
|
|
|
import sqlite from "../../common/sqlite.js"
|
2023-07-11 15:28:40 +08:00
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2023-08-24 16:22:29 +08:00
|
|
|
|
title: "船只 - 杂项作业单",
|
|
|
|
|
shipInfo: {},
|
2023-07-11 15:28:40 +08:00
|
|
|
|
tabsList: ["人员信息", "工班信息"],
|
2023-07-19 18:12:19 +08:00
|
|
|
|
tabsType: 0, // 0是人员信息 1是工班信息
|
2023-07-11 15:28:40 +08:00
|
|
|
|
tabsIndex: 0,
|
2023-07-11 17:29:53 +08:00
|
|
|
|
// 人员信息列表
|
2023-07-18 17:37:15 +08:00
|
|
|
|
peopleInfo: [],
|
2023-07-11 17:29:53 +08:00
|
|
|
|
// 工班信息列表
|
2023-08-15 09:18:52 +08:00
|
|
|
|
shiftInfo: [],
|
2023-07-11 15:28:40 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2023-07-18 17:37:15 +08:00
|
|
|
|
mounted() {
|
2023-07-26 14:34:20 +08:00
|
|
|
|
this.tabsType = uni.getStorageSync('tabsType')
|
2023-08-15 09:18:52 +08:00
|
|
|
|
this.executeSql1('shipInfoTable')
|
2023-07-20 17:16:08 +08:00
|
|
|
|
if (this.tabsType != 0 && this.tabsType != 1) {
|
2023-07-19 18:12:19 +08:00
|
|
|
|
this.tabsType = 0
|
|
|
|
|
this.tabsIndex = 0
|
|
|
|
|
} else {
|
|
|
|
|
this.tabsIndex = this.tabsType
|
|
|
|
|
}
|
2023-08-01 09:32:45 +08:00
|
|
|
|
if (this.tabsType == 0) {
|
|
|
|
|
this.executeSql1('messageRespList')
|
2023-08-04 17:06:33 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.executeSql1('workMessageRespList')
|
|
|
|
|
this.executeSql1('workMessageRespInfoList')
|
2023-08-15 09:18:52 +08:00
|
|
|
|
this.executeSql1('retallyMessageRespList')
|
|
|
|
|
this.executeSql1('infoRespList')
|
2023-08-01 09:32:45 +08:00
|
|
|
|
}
|
2023-07-17 17:10:05 +08:00
|
|
|
|
},
|
2023-07-11 15:28:40 +08:00
|
|
|
|
methods: {
|
2023-08-01 09:32:45 +08:00
|
|
|
|
// 查
|
2023-08-01 14:35:05 +08:00
|
|
|
|
executeSql1(tableName) {
|
|
|
|
|
let sql = `select * from ${tableName}`
|
2023-08-01 09:32:45 +08:00
|
|
|
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
2023-08-15 09:18:52 +08:00
|
|
|
|
if (tableName == 'shipInfoTable') {
|
2023-08-24 16:22:29 +08:00
|
|
|
|
this.shipInfo = value[0]
|
|
|
|
|
this.title = `${this.shipInfo.vslCnname} - 杂项作业单`
|
2023-08-15 09:18:52 +08:00
|
|
|
|
}
|
2023-08-01 09:32:45 +08:00
|
|
|
|
if (this.tabsType == 0) {
|
|
|
|
|
this.peopleInfo = value
|
2023-08-04 17:06:33 +08:00
|
|
|
|
} else {
|
2023-08-15 09:18:52 +08:00
|
|
|
|
// console.log(value)
|
|
|
|
|
if (tableName == 'workMessageRespList' && value.length > 0) {
|
|
|
|
|
this.shiftInfo = Object.values(value.reduce((res, item) => {
|
2023-08-23 17:42:44 +08:00
|
|
|
|
res[item.aId] ? res[item.aId].push(item) : res[item
|
|
|
|
|
.aId] = [item];
|
2023-08-15 09:18:52 +08:00
|
|
|
|
return res;
|
|
|
|
|
}, {}));
|
|
|
|
|
}
|
2023-08-01 09:32:45 +08:00
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
// 在reject时执行的回调函数
|
|
|
|
|
console.error(error);
|
|
|
|
|
});
|
|
|
|
|
},
|
2023-07-24 16:56:46 +08:00
|
|
|
|
// 点击签名
|
|
|
|
|
sign() {
|
2023-08-23 17:42:44 +08:00
|
|
|
|
const objType = {
|
|
|
|
|
signType: "mixWork"
|
|
|
|
|
}
|
|
|
|
|
const dataType = encodeURIComponent(JSON.stringify(objType));
|
2023-07-24 16:56:46 +08:00
|
|
|
|
uni.navigateTo({
|
2023-08-23 17:42:44 +08:00
|
|
|
|
url: `/pages/shipWork/sign?dataType=${dataType}`
|
2023-07-24 16:56:46 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
2023-07-11 15:28:40 +08:00
|
|
|
|
tabsClick(item, index) {
|
|
|
|
|
this.tabsIndex = index;
|
|
|
|
|
if (item == "人员信息") {
|
2023-07-19 18:12:19 +08:00
|
|
|
|
this.tabsType = 0;
|
2023-08-04 17:06:33 +08:00
|
|
|
|
this.executeSql1('messageRespList')
|
2023-07-11 15:28:40 +08:00
|
|
|
|
} else {
|
2023-07-19 18:12:19 +08:00
|
|
|
|
this.tabsType = 1;
|
2023-08-04 17:06:33 +08:00
|
|
|
|
this.executeSql1('workMessageRespList')
|
|
|
|
|
this.executeSql1('workMessageRespInfoList')
|
2023-08-15 09:18:52 +08:00
|
|
|
|
this.executeSql1('retallyMessageRespList')
|
|
|
|
|
this.executeSql1('infoRespList')
|
2023-07-11 15:28:40 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2023-07-24 16:56:46 +08:00
|
|
|
|
// 点击新增
|
2023-07-18 17:37:15 +08:00
|
|
|
|
add(state, item, index) {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
if (state != 'add') {
|
|
|
|
|
uni.setStorageSync('peopleRow', item);
|
|
|
|
|
uni.setStorageSync('peopleRowIndex', index);
|
|
|
|
|
}
|
2023-07-18 17:37:15 +08:00
|
|
|
|
let obj = {
|
|
|
|
|
state: state
|
|
|
|
|
}
|
|
|
|
|
const params = encodeURIComponent(JSON.stringify(obj));
|
2023-07-19 18:12:19 +08:00
|
|
|
|
if (this.tabsType == 0) {
|
2023-07-11 17:29:53 +08:00
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/shipWork/peopleAdd?params=${params}`
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/shipWork/shiftAdd?params=${params}`
|
|
|
|
|
})
|
|
|
|
|
}
|
2023-07-11 15:28:40 +08:00
|
|
|
|
},
|
2023-07-19 18:12:19 +08:00
|
|
|
|
lookShift(item, index) {
|
|
|
|
|
uni.setStorageSync('shiftRow', item);
|
2023-07-12 13:48:01 +08:00
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/shipWork/shiftDetails`
|
|
|
|
|
})
|
2023-07-18 17:37:15 +08:00
|
|
|
|
},
|
2023-07-26 14:34:20 +08:00
|
|
|
|
},
|
2023-07-11 15:28:40 +08:00
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.mixWork {
|
2023-08-23 17:42:44 +08:00
|
|
|
|
.headInfo {
|
|
|
|
|
/deep/.uniui-bottom {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-11 15:28:40 +08:00
|
|
|
|
.container {
|
2023-08-23 17:42:44 +08:00
|
|
|
|
padding: 30px 10px;
|
2023-08-24 16:22:29 +08:00
|
|
|
|
min-height: calc(100vh - 68px);
|
2023-07-11 15:28:40 +08:00
|
|
|
|
|
2023-07-24 16:56:46 +08:00
|
|
|
|
.signBox {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
|
|
.sign {
|
|
|
|
|
text-align: right;
|
|
|
|
|
color: #2979ff;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-11 15:28:40 +08:00
|
|
|
|
.tabsList {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
.tabsBox {
|
|
|
|
|
width: 100px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
margin: 0px 10px;
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.active {
|
|
|
|
|
background: #2979ff;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-18 17:37:15 +08:00
|
|
|
|
.ul {
|
2023-07-11 15:28:40 +08:00
|
|
|
|
padding: 20px 0;
|
2023-08-23 17:42:44 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
2023-07-11 15:28:40 +08:00
|
|
|
|
|
2023-07-18 17:37:15 +08:00
|
|
|
|
.li {
|
2023-08-23 17:42:44 +08:00
|
|
|
|
width: 33%;
|
|
|
|
|
padding: 16px;
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
position: relative;
|
|
|
|
|
margin-bottom: 10px;
|
2023-07-11 15:28:40 +08:00
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
display: flex;
|
2023-08-23 17:42:44 +08:00
|
|
|
|
|
|
|
|
|
text {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
margin-left: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
width: 32px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
}
|
2023-07-11 15:28:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-08-23 17:42:44 +08:00
|
|
|
|
.liInfo {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
|
2023-07-11 15:28:40 +08:00
|
|
|
|
p {
|
2023-08-23 17:42:44 +08:00
|
|
|
|
width: 49%;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
|
|
|
|
|
text {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
2023-07-11 15:28:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-23 17:42:44 +08:00
|
|
|
|
.status {
|
|
|
|
|
padding: 5px;
|
|
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 16px;
|
|
|
|
|
right: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.didNot {
|
|
|
|
|
background-color: #FFF7EE;
|
|
|
|
|
color: #FC8300;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.success {
|
|
|
|
|
background: #F1F8FF;
|
|
|
|
|
color: #0067CF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.fail {
|
|
|
|
|
background: #FFF0F0;
|
|
|
|
|
color: #E50101;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shift {
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 16px 4px;
|
|
|
|
|
background-color: #f7f7f7;
|
|
|
|
|
margin: 5px 0;
|
|
|
|
|
|
|
|
|
|
text:first-child {
|
|
|
|
|
color: #0067CF;
|
|
|
|
|
margin: 0 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.text {
|
|
|
|
|
color: #999;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.time {
|
|
|
|
|
color: #23262E;
|
|
|
|
|
margin-top: 3px;
|
|
|
|
|
margin-right: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-11 15:28:40 +08:00
|
|
|
|
.state {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-08-23 17:42:44 +08:00
|
|
|
|
|
|
|
|
|
.li:nth-of-type(3n - 1) {
|
|
|
|
|
margin: 0 0.5% 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/.o-empty {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shiftUl {
|
|
|
|
|
.li {
|
|
|
|
|
width: 49%;
|
|
|
|
|
margin-right: 0.5%;
|
|
|
|
|
}
|
2023-07-11 15:28:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.addBtn {
|
|
|
|
|
position: fixed;
|
|
|
|
|
right: 50px;
|
|
|
|
|
bottom: 50px;
|
|
|
|
|
width: 100px;
|
|
|
|
|
height: 100px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background-color: #2979ff;
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 100px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|