pad-app/pages/shipWork/mixWork.vue

173 lines
3.9 KiB
Vue
Raw Normal View History

2023-07-11 15:28:40 +08:00
<template>
<view class="mixWork">
<view class="container">
<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-18 17:37:15 +08:00
<view class="li" v-for="(item,index) in peopleInfo" :key="index" @click="add('look',item,index)">
<view class="title">航次{{item.vvyName}}</view>
<p>贸易类型{{item.tradeTypeName}}</p>
<p>进出口{{item.importExportFlagName}}</p>
<p>作业组数{{item.workSuite}}</p>
<p>单船人数{{item.shipPerson}}</p>
<p>状态未上传</p>
</view>
</view>
2023-07-11 17:29:53 +08:00
<!-- 工班信息列表 -->
2023-07-19 18:12:19 +08:00
<view class="ul" v-if="tabsType == 1">
<view class="li" v-for="(item,index) in shiftInfo" :key="index" @click="lookShift(item,index)">
2023-07-18 17:37:15 +08:00
<view class="title">航次{{item.vvyName}}</view>
2023-07-19 18:12:19 +08:00
<view class="shift" v-for="(item2,index2) in item.shiftList" :key="index2">
<p>{{item2.gbTextValue}}</p>
<span>作业开始时间{{item2.startTime}}</span>
2023-07-11 15:28:40 +08:00
</view>
2023-07-18 17:37:15 +08:00
<view class="state">状态未上传</view>
</view>
</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>
export default {
data() {
return {
2023-07-18 17:37:15 +08:00
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-07-19 18:12:19 +08:00
shiftInfo: []
2023-07-11 15:28:40 +08:00
}
},
2023-07-18 17:37:15 +08:00
mounted() {
2023-07-19 18:12:19 +08:00
this.tabsType = this.$route.query.infoType
if (this.tabsType != 0 || this.tabsType != 1) {
this.tabsType = 0
this.tabsIndex = 0
} else {
this.tabsIndex = this.tabsType
}
this.peopleInfo = uni.getStorageSync('addPeopleArr')
this.shiftInfo = uni.getStorageSync('addShiftArr')
console.log(this.shiftInfo)
2023-07-18 17:37:15 +08:00
this.shipInfo = uni.getStorageSync('shipInfo')
2023-07-17 17:10:05 +08:00
},
2023-07-11 15:28:40 +08:00
methods: {
tabsClick(item, index) {
this.tabsIndex = index;
if (item == "人员信息") {
2023-07-19 18:12:19 +08:00
this.tabsType = 0;
2023-07-11 15:28:40 +08:00
} else {
2023-07-19 18:12:19 +08:00
this.tabsType = 1;
2023-07-11 15:28:40 +08:00
}
},
2023-07-18 17:37:15 +08:00
add(state, item, index) {
uni.setStorageSync('peopleRow', item);
uni.setStorageSync('peopleRowIndex', index);
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);
uni.setStorageSync('shiftRowIndex', index);
2023-07-12 13:48:01 +08:00
uni.navigateTo({
url: `/pages/shipWork/shiftDetails`
})
2023-07-18 17:37:15 +08:00
},
2023-07-11 15:28:40 +08:00
}
}
</script>
<style lang="less" scoped>
.mixWork {
.container {
padding: 30px 20px;
.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-07-18 17:37:15 +08:00
.li {
2023-07-11 15:28:40 +08:00
display: flex;
justify-content: space-between;
border-bottom: 1px solid #ccc;
padding: 20px;
.title {
font-size: 16px;
font-weight: bold;
display: flex;
flex-direction: column;
justify-content: center;
}
.shift {
p {
font-size: 16px;
}
}
.state {
display: flex;
flex-direction: column;
justify-content: center;
}
}
}
.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>