pad-app/pages/shipWork/mixWork.vue

187 lines
3.8 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-11 15:28:40 +08:00
<ul v-if="tabsType == 1">
2023-07-11 17:29:53 +08:00
<li v-for="(item,index) in peopleInfo" :key="index" @click="add('look')">
2023-07-11 15:28:40 +08:00
<view class="title">航次{{item.val1}}</view>
<p>贸易类型{{item.val2}}</p>
<p>进出口{{item.val3}}</p>
<p>作业组数{{item.val4}}</p>
<p>单船人数{{item.val5}}</p>
<p>状态{{item.val6}}</p>
</li>
</ul>
2023-07-11 17:29:53 +08:00
<!-- 工班信息列表 -->
2023-07-11 15:28:40 +08:00
<ul v-if="tabsType == 2">
2023-07-12 13:48:01 +08:00
<li v-for="(item,index) in shiftInfo" :key="index" @click="lookShift">
2023-07-11 15:28:40 +08:00
<view class="title">航次{{item.val1}}</view>
<view class="shift">
<p>一工班</p>
<span>作业时间2023/09/09 13:00:00</span>
</view>
<view class="shift">
<p>二工班</p>
<span>作业时间2023/09/09 13:00:00</span>
</view>
<view class="shift">
<p>三工班</p>
<span>作业时间2023/09/09 13:00:00</span>
</view>
<view class="state">状态{{item.val6}}</view>
</li>
</ul>
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 {
tabsList: ["人员信息", "工班信息"],
2023-07-11 17:29:53 +08:00
tabsType: 1, // 1是人员信息 2是工班信息
2023-07-11 15:28:40 +08:00
tabsIndex: 0,
2023-07-11 17:29:53 +08:00
// 人员信息列表
2023-07-11 15:28:40 +08:00
peopleInfo: [{
val1: "JK9795799",
val2: "内贸",
val3: "进口",
val4: "100",
val5: "100",
val6: "未上传",
}, {
val1: "JK9795799",
val2: "内贸",
val3: "进口",
val4: "100",
val5: "100",
val6: "未上传",
}, {
val1: "JK9795799",
val2: "内贸",
val3: "进口",
val4: "100",
val5: "100",
val6: "未上传",
}],
2023-07-11 17:29:53 +08:00
// 工班信息列表
2023-07-11 15:28:40 +08:00
shiftInfo: [{
val1: "JK9795799",
val6: "未上传",
}, ]
}
},
methods: {
tabsClick(item, index) {
this.tabsIndex = index;
if (item == "人员信息") {
this.tabsType = 1;
} else {
this.tabsType = 2;
}
},
2023-07-11 17:29:53 +08:00
add(state) {
const obj = {
state: state,
}
const params = encodeURIComponent(JSON.stringify(obj));
if (this.tabsType == 1) {
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-12 13:48:01 +08:00
lookShift() {
uni.navigateTo({
url: `/pages/shipWork/shiftDetails`
})
}
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;
}
}
ul {
padding: 20px 0;
li {
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>