pad-app/pages/index/instruct.vue

638 lines
15 KiB
Vue
Raw Normal View History

2023-07-06 17:08:59 +08:00
<template>
<view class="app">
2023-07-12 18:06:16 +08:00
<head-view v-show="current!=2" title="船名/航次"></head-view>
<head-info v-show="current==2"></head-info>
2023-07-06 17:08:59 +08:00
<view class="content">
<view class="form">
<view class="input">
<uni-easyinput class="input" suffixIcon="search" v-model="value1" placeholder="船名/航次"
@iconClick="iconClick">
</uni-easyinput>
</view>
2023-07-12 18:06:16 +08:00
<view class="select" v-show="current!=0">
2023-07-06 17:08:59 +08:00
<uni-data-select v-model="value" :localdata="range" @change="change" placeholder="港区">
</uni-data-select>
</view>
2023-07-12 18:06:16 +08:00
<view class="select" v-show="current!=0">
2023-07-06 17:08:59 +08:00
<uni-data-select v-model="value" :localdata="range" @change="change" placeholder="贸易类型">
</uni-data-select>
</view>
<view class="select">
<uni-data-select v-model="value" :localdata="range" @change="change" placeholder="品牌">
</uni-data-select>
</view>
2023-07-12 18:06:16 +08:00
<view class="select" v-show="current!=0">
2023-07-06 17:08:59 +08:00
<uni-data-select v-model="value" :localdata="range" @change="change" placeholder="车型">
</uni-data-select>
</view>
<view class="select">
<uni-data-select v-model="value" :localdata="range" @change="change" placeholder="港口">
</uni-data-select>
</view>
2023-07-12 18:06:16 +08:00
<view class="select" v-show="current!=0">
2023-07-06 17:08:59 +08:00
<uni-data-select v-model="value" :localdata="range" @change="change" placeholder="计划状态">
</uni-data-select>
</view>
</view>
<view class="uni-list">
<radio-group class="group" @change="radioChange">
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value">
<view>
<radio :value="item.value" :checked="index === current" />{{item.name}}
</view>
</label>
</radio-group>
</view>
<view class="buttonlist">
2023-07-12 18:06:16 +08:00
<button v-show="current==0" class="button" type="default"></button>
<button v-show="current!=2" class="button" type="default"></button>
2023-07-06 17:08:59 +08:00
<button class="button" type="default">刷新</button>
2023-07-12 18:06:16 +08:00
<button v-show="current==2" class="button" type="default"></button>
2023-07-06 17:08:59 +08:00
</view>
2023-07-12 18:06:16 +08:00
<view class="itemList" v-show="current==0">
<view class="exp" v-for="(item,index) in itemList" :key="item.index">
<view class="item">
<view class="rowHead" v-show="active==1">
<radio :value="item.value" />
2023-07-10 09:27:39 +08:00
</view>
2023-07-12 18:06:16 +08:00
<view class="row">
<view class="col weight">
船舱层数5层3舱
</view>
<view class="col">
数量1,000
</view>
<view class="col">
港口厦门港
</view>
2023-07-10 09:27:39 +08:00
</view>
2023-07-12 18:06:16 +08:00
<view class="row">
<view class="col weight">
计划状态已发送
</view>
<view class="col">
负责人我是一个负责人
</view>
<view class="col">
发送时间2023/09/09 16:00
</view>
2023-07-10 09:27:39 +08:00
</view>
2023-07-12 18:06:16 +08:00
<view class="rowFoot">
<view class="col">
装船进度
</view>
<view class="col">
<view class="progress-box">
<van-progress :percentage="itemSum(item.sum)" :pivot-text="'60/' + item.sum" />
</view>
</view>
2023-07-10 09:27:39 +08:00
</view>
2023-07-12 18:06:16 +08:00
<view class="fs blue">
2023-07-21 17:28:30 +08:00
<text v-show="active==1" @click="onSend"></text>
2023-07-12 18:06:16 +08:00
<text v-show="active==2">{{item.status}}</text>
2023-07-10 09:27:39 +08:00
</view>
2023-07-12 18:06:16 +08:00
</view>
<view class="details">
<uni-icons v-show="itemActive != index" class="jt" type="top" size="24" color="#108ee9"
@click="isActive(index)"></uni-icons>
<view class="itemDetails" v-show="itemActive == index">
<view class="row" v-for="cell in item.xq">
<view class="cell">
TD90959749495
</view>
<view class="cell">
中转港厦门港
</view>
<view class="cell">
数量100
</view>
<view class="cell">
品牌特斯拉
</view>
<view class="cell">
车型电动车
</view>
<view class="cell">
型号特斯拉plus
</view>
<view class="cell blue" @click="toDetails">
详情
</view>
</view>
<uni-icons class="jt" type="bottom" size="24" color="#108ee9"
@click="itemActive = '-1'"></uni-icons>
2023-07-10 09:27:39 +08:00
</view>
</view>
2023-07-12 18:06:16 +08:00
</view>
</view>
<view class="tablist" v-show="current==1">
<view class="tab" :class="active==1?'active':''" type="default" @click="tabChange(1)"></view>
<view class="tab" :class="active==2?'active':''" type="default" @click="tabChange(2)"></view>
</view>
<view class="itemList" v-show="current==1">
<view class="exp" v-for="(item,index) in itemList" :key="item.index">
<view class="item">
<view class="rowHead" v-if="active==1">
<radio :value="item.value" />
2023-07-10 09:27:39 +08:00
</view>
2023-07-12 18:06:16 +08:00
<view class="row">
<view class="col weight">
船舱层数5层3舱
</view>
<view class="col">
数量1,000
</view>
<view class="col">
港口厦门港
2023-07-10 09:27:39 +08:00
</view>
</view>
2023-07-12 18:06:16 +08:00
<view class="row">
<view class="col weight">
计划状态已发送
</view>
<view class="col">
负责人我是一个负责人
</view>
<view class="col">
发送时间2023/09/09 16:00
</view>
</view>
<view class="rowFoot">
<view class="col">
装船进度
</view>
<view class="col">
<view class="progress-box">
<van-progress :percentage="itemSum(item.sum)" :pivot-text="'60/' + item.sum" />
</view>
</view>
</view>
<view class="fs blue">
2023-07-21 17:28:30 +08:00
<text v-show="active==1" @click="onSend"></text>
<text v-show="active==2" @click="onPause">{{item.status}}</text>
2023-07-12 18:06:16 +08:00
</view>
</view>
<view class="details">
<uni-icons v-show="itemActive != index" class="jt" type="top" size="24" color="#108ee9"
@click="isActive(index)"></uni-icons>
<view class="itemDetails" v-show="itemActive == index">
<view class="row" v-for="cell in item.xq">
<view class="cell">
TD90959749495
</view>
<view class="cell">
中转港厦门港
</view>
<view class="cell">
数量100
</view>
<view class="cell">
品牌特斯拉
</view>
<view class="cell">
车型电动车
</view>
<view class="cell">
型号特斯拉plus
</view>
<view class="cell blue" @click="toDetails">
详情
</view>
</view>
<uni-icons class="jt" type="bottom" size="24" color="#108ee9"
@click="itemActive = '-1'"></uni-icons>
</view>
2023-07-10 09:27:39 +08:00
</view>
</view>
</view>
2023-07-12 18:06:16 +08:00
<view class="currentList" v-show="current==2">
<view class="imgLi">
<image src="@/static/images/u176.png" mode="widthFix">
</view>
<view class="title">
第一层
</view>
<view class="nr">
<text class="text">是否可调夹板: </text>
<text class="text">是否有跳板: 双尾跳</text>
</view>
<view class="imgLi">
<image src="@/static/images/u86.png" mode="widthFix">
</view>
<view class="tableHead">
<text>明细(100)</text>
<uni-icons class="jt" type="bottom" size="24"></uni-icons>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr class="gray">
<uni-th align="center" width="20">提单号</uni-th>
<uni-th align="center" width="20">港口</uni-th>
<uni-th align="center" width="20">品牌</uni-th>
<uni-th align="center" width="20">车型</uni-th>
<uni-th align="center" width="20">型号</uni-th>
<uni-th align="center" width="20">车型明细</uni-th>
<uni-th align="center" width="20">数量</uni-th>
<uni-th align="center" width="20"></uni-th>
<uni-th align="center" width="20"></uni-th>
<uni-th align="center" width="20"></uni-th>
<uni-th align="center" width="20">位置</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr>
<uni-td>1123</uni-td>
<uni-td>2</uni-td>
<uni-td>3</uni-td>
<uni-td>4</uni-td>
<uni-td>1</uni-td>
<uni-td>2</uni-td>
<uni-td>3</uni-td>
<uni-td>4</uni-td>
<uni-td>1</uni-td>
<uni-td>2</uni-td>
<uni-td>3</uni-td>
</uni-tr>
</uni-table>
</view>
2023-07-06 17:08:59 +08:00
</view>
</view>
</template>
<script>
2023-07-21 17:28:30 +08:00
import {
mapActions
} from 'vuex'
2023-07-06 17:08:59 +08:00
import HeadView from '@/components/head-view/head-view.vue';
2023-07-12 18:06:16 +08:00
import HeadInfo from '@/components/head-info/head-info';
2023-07-06 17:08:59 +08:00
export default {
data() {
return {
2023-07-21 17:28:30 +08:00
id: "",// 进入页面的初始id
2023-07-06 17:08:59 +08:00
value1: "",
value: '',
2023-07-12 18:06:16 +08:00
itemList: [],
2023-07-21 17:28:30 +08:00
range: [1],
items: [{
value: '1',
name: '总指令',
checked: 'true'
},
{
value: '2',
name: '分指令'
},
{
value: '3',
name: '配载图'
},
{
value: '4',
name: '场位图'
},
],
current: 0,
active: 1,
itemActive: -1,
}
},
computed: {
itemSum() {
return function(item) {
let sum = (60 / item) * 100
return sum
};
}
},
onLoad() {
this.id = this.$route.query.id;
this.loadSumOrder() // 总指令:分页查询
},
components: {
HeadView,
HeadInfo
},
methods: {
...mapActions([
'majax',
'najax'
]),
loadSumOrder() {
let data = {}
data.bvmId = this.id
this.majax({
url: this.$local + "/api/shipInstructions/page",
params: data,
method: 'GET'
}).then(res => {
this.itemList = res.data.records
})
// 模拟
this.itemList = [{ //已发送
2023-07-12 18:06:16 +08:00
sum: 300,
xq: 2
},
{
sum: 600,
xq: 3
},
{
sum: 900,
xq: 1
},
{
sum: 100,
xq: 2
},
{
sum: 200,
xq: 2
}
2023-07-21 17:28:30 +08:00
]
},
loadOtherOrder() {
let data = {}
data.bvmId = this.id
this.majax({
url: this.$local + "/api/shipInstructions/pageCommandForBranch",
params: data,
method: 'GET'
}).then(res => {
this.itemList = res.data.records
})
// 模拟分指令
this.itemList = [{ //已发送
2023-07-12 18:06:16 +08:00
sum: 100,
xq: 2,
status: '暂停'
},
{
sum: 300,
xq: 3,
status: '重新发送'
},
{
sum: 200,
xq: 1,
status: '重新发送'
},
{
sum: 500,
xq: 2,
status: '暂停'
},
{
sum: 800,
xq: 2,
status: '暂停'
}
2023-07-21 17:28:30 +08:00
]
},
2023-07-12 18:06:16 +08:00
tabChange(tag) {
this.active = tag
if (this.active == 1) {
2023-07-21 17:28:30 +08:00
console.log(1);
2023-07-12 18:06:16 +08:00
} else {
2023-07-21 17:28:30 +08:00
console.log(2);
2023-07-12 18:06:16 +08:00
}
},
2023-07-06 17:08:59 +08:00
change() {},
radioChange: function(evt) {
for (let i = 0; i < this.items.length; i++) {
if (this.items[i].value === evt.detail.value) {
this.current = i;
2023-07-21 17:28:30 +08:00
switch(this.current) {
case 1:
this.loadSumOrder()
break;
case 2:
this.loadOtherOrder()
break;
default:
}
2023-07-06 17:08:59 +08:00
break;
}
}
2023-07-21 17:28:30 +08:00
2023-07-12 18:06:16 +08:00
},
isActive(e) {
this.itemActive = e
},
2023-07-21 17:28:30 +08:00
// 发送指令
onSend() {
let data = {}
this.majax({
url: this.$local + "/api/shipInstructions/commandSendForBranch",
params: data,
method: 'GET'
}).then(res => {
console.log(res);
})
},
// 重新发送指令
onReissued() {
let data = {}
this.majax({
url: this.$local + "/api/shipInstructions/commandReissuedForBranch",
params: data,
method: 'GET'
}).then(res => {
console.log(res);
})
},
// 暂停指令
onPause() {
let data = {}
data.lwpId = '111'
this.majax({
url: this.$local + "/api/shipInstructions/commandPause",
params: data,
method: 'GET'
}).then(res => {
console.log(res);
})
},
2023-07-12 18:06:16 +08:00
toDetails() {
uni.navigateTo({
url: '/pages/index/instructDetails'
})
2023-07-06 17:08:59 +08:00
}
}
};
</script>
<style>
2023-07-12 18:06:16 +08:00
.blue {
color: #108ee9;
}
2023-07-06 17:08:59 +08:00
.content {
padding: 20px;
2023-07-12 18:06:16 +08:00
background-color: #fff;
2023-07-06 17:08:59 +08:00
.form {
display: flex;
.select {
width: 100px;
margin-left: 15px;
}
.input {
width: 200px;
height: 35px;
line-height: 35px;
}
}
.uni-list {
margin-top: 20px;
.group {
width: 360px;
height: 50px;
display: flex;
justify-content: space-between;
}
}
.buttonlist {
width: 340px;
.button {
2023-07-12 18:06:16 +08:00
display: inline-block;
2023-07-06 17:08:59 +08:00
width: 100px;
height: 40px;
line-height: 40px;
2023-07-12 18:06:16 +08:00
margin-right: 20rpx;
2023-07-06 17:08:59 +08:00
}
}
.tablist {
width: 175px;
height: 60px;
line-height: 60px;
font-size: 21px;
display: flex;
justify-content: space-between;
.tabs {
width: 80px;
height: 60px;
border-bottom: 2rpx solid #ebebeb;
}
.active {
color: #1890ff;
border-bottom: 2rpx solid #1890ff;
}
}
2023-07-10 09:27:39 +08:00
.itemList {
margin-top: 30px;
2023-07-12 18:06:16 +08:00
.exp {
2023-07-10 09:27:39 +08:00
border-bottom: 2px solid #e9e9e9;
2023-07-12 18:06:16 +08:00
text-align: center;
padding-bottom: 10px;
2023-07-10 09:27:39 +08:00
2023-07-12 18:06:16 +08:00
.item {
height: 110px;
padding: 20px 20px 0;
2023-07-10 09:27:39 +08:00
display: flex;
justify-content: space-between;
2023-07-12 18:06:16 +08:00
text-align: left;
.weight {
font-weight: 900;
}
.rowHead {
width: 4%;
}
.row {
width: 28%;
flex-direction: column;
display: flex;
justify-content: space-between;
}
.rowFoot {
width: 34%;
flex-direction: column;
display: flex;
justify-content: space-around;
}
.fs {
width: 6%;
text-align: right;
line-height: 110px;
}
2023-07-10 09:27:39 +08:00
}
2023-07-12 18:06:16 +08:00
.details {
padding: 20px;
.itemDetails {
border-top: 2px dotted #7d7d7d;
.row {
display: flex;
justify-content: space-between;
height: 50px;
line-height: 50px;
}
}
}
}
}
.currentList {
width: 85%;
margin: 10px auto;
.tableHead {
margin-top: 10px;
height: 50px;
line-height: 50px;
background-color: #fff;
display: flex;
justify-content: space-between;
padding: 0 12px;
font-size: 20px;
border: 1px solid #f2f2f2;
}
.gray {
background-color: #f9f9f9;
}
.imgLi {
margin-bottom: 5px;
}
.title {
line-height: 50px;
font-size: 21px;
font-weight: 900;
}
.nr {
font-size: 16px;
.text {
display: inline-block;
margin-right: 50px;
2023-07-10 09:27:39 +08:00
}
}
}
2023-07-06 17:08:59 +08:00
}
2023-07-12 18:06:16 +08:00
</style>