wangchen 2023-07-21 17:28:30 +08:00
parent b67436cb0b
commit 5306759741
2 changed files with 251 additions and 98 deletions

View File

@ -6,26 +6,24 @@
<view class="content"> <view class="content">
<view class="form"> <view class="form">
<view class="end"> <view class="end">
<superwei-combox :candidates="candidates_json" :isJSON="true" keyName="name" <superwei-combox class="input" :candidates="portList" :isJSON="true" keyName="pamName"
placeholder="请选择或输入" v-model="inputValue_json" @input="input_json" placeholder="港区" v-model="portName" @input="portInput"
@select="select_json"></superwei-combox> @select="portSelect"></superwei-combox>
<superwei-combox class="input" :candidates="shipList" :isJSON="true" keyName="vvyName"
<uni-easyinput class="input" suffixIcon="search" v-model="value1" placeholder="港区" placeholder="船名/航次" v-model="shipName" @input="shipInput"
@iconClick="iconClick"> @select="shipSelect"></superwei-combox>
</uni-easyinput>
<uni-easyinput class="input" suffixIcon="search" v-model="value2" placeholder="船名/航次"
@iconClick="iconClick">
</uni-easyinput> </uni-easyinput>
<button class="btn" @click="onSearch"></button>
</view> </view>
</view> </view>
<view class="itemList"> <view class="itemList">
<view v-for="(item, index) in ltemList" :key="index" class="item" @click="toDetails"> <view v-for="(item, index) in ltemList" :key="index" class="item" @click="toDetails(item.spmId)">
<view class="title"> <view class="title">
<view class="name"> <view class="name">
海王星领袖 海王星领袖
</view> </view>
<view class="status"> <view class="status">
<text v-if="item==1" class="green"> </text> <text v-if="item.vvyStatus==2" class="green"> </text>
<text v-else> </text> <text v-else> </text>
</view> </view>
</view> </view>
@ -35,15 +33,15 @@
航次: <text>735546</text> 航次: <text>735546</text>
</view> </view>
<view class="nitem"> <view class="nitem">
贸易类型: <text>内贸</text> 贸易类型: <text>{{item.tradeType}}</text>
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="nitem"> <view class="nitem">
进出口: <text>进口</text> 进出口: <text>{{item.importExportFlag}}</text>
</view> </view>
<view class="nitem"> <view class="nitem">
泊位: <text>一泊位</text> 泊位: <text>{{item.actualBerthage}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -58,52 +56,123 @@
<script> <script>
import SideBar from '@/components/sider-bar/slider-bar'; import SideBar from '@/components/sider-bar/slider-bar';
import HeadInfo from '@/components/head-info/head-info'; import HeadInfo from '@/components/head-info/head-info';
import {
mapActions
} from 'vuex'
let timers = null;
export default { export default {
data() { data() {
return { return {
value1: '', ltemList: [],
value2: '', portName: '',
ltemList: [1, 1, 1, 1, 2, 1, 1, 1, 1], portItem: {},
inputValue_json: '', portList: [],
candidates_json: [{ shipName: '',
id: '1', shipItem: {},
name: '选项一' shipList: []
}, {
id: '2',
name: '选项二',
disabled: true // disabled
}, {
id: '3',
name: '选项三'
}, {
id: '4',
name: '选项四'
}, {
id: '5',
name: '选项五',
disabled: true // disabled
}, {
id: '6',
name: '...'
}]
} }
}, },
onLoad() { onLoad() {
// this.loadList()
}, },
components: { components: {
SideBar, SideBar,
HeadInfo HeadInfo
}, },
methods: { methods: {
toDetails() { ...mapActions([
'majax',
'najax'
]),
portInput(e) {
clearTimeout(timers)
timers = setTimeout(() => {
this.getPort(e)
}, 500)
},
portSelect(e) {
this.portItem = e
this.shipName = ''
this.shipItem = {}
},
//
getPort(keyWords) {
let data = {}
data.pamName = keyWords
this.majax({
url: this.$local + "/api/miniapp/portAreaManage/getPortArea",
params: data,
method: 'GET'
}).then(res => {
this.portList = res.data
})
//
this.portList = [{
potId: 1123,
pamName: '测试港口'
}]
},
shipInput(e) {
clearTimeout(timers)
timers = setTimeout(() => {
this.getShip(e)
}, 500)
},
shipSelect(e) {
this.shipItem = e
},
//
getShip(keyWords) {
console.log(this.portName);
let data = {}
data.ieType = 'I' // I E
data.key = keyWords
data.pamId = this.portItem.pamId
this.majax({
url: this.$local + "/api/shipInstructions/queryByKey",
params: data,
method: 'GET'
}).then(res => {
this.shipList = res.data
})
//
this.shipList = [{
vvyId: 1123,
vvyName: '测试航次'
}]
},
onSearch() {
let data = {}
data.tradeType = '外贸' // I E
data.vvyId = this.shipItem.vvyId
data.pamId = this.portItem.pamId
this.majax({
url: this.$local + "/api/shipInstructions/queryStowageVoyages",
params: data,
method: 'GET'
}).then(res => {
this.ltemList = res.data.records
})
//
this.ltemList = [{
actualBerthage: "一号位置",
actualBerthageDesc: "",
importExportFlag: "出口",
spmId: "spm1112",
spmIdDesc: "331122",
tradeType: "内贸",
vvyId: "11231",
vvyName: "海王星领袖",
vvyStatus: "2",
vvyStatusName: "作业中",
}]
},
toDetails(id) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/instruct' url: '/pages/index/instruct?id=' + id
}) })
}, },
input_json() {},
select_json() {},
} }
}; };
</script> </script>
@ -133,6 +202,12 @@
padding-left: 10px; padding-left: 10px;
margin-left: 15px; margin-left: 15px;
} }
.btn {
height: 35px;
line-height: 35px;
margin-left: 20px;
}
} }
} }

View File

@ -88,7 +88,7 @@
</view> </view>
</view> </view>
<view class="fs blue"> <view class="fs blue">
<text v-show="active==1"></text> <text v-show="active==1" @click="onSend"></text>
<text v-show="active==2">{{item.status}}</text> <text v-show="active==2">{{item.status}}</text>
</view> </view>
</view> </view>
@ -168,8 +168,8 @@
</view> </view>
</view> </view>
<view class="fs blue"> <view class="fs blue">
<text v-show="active==1"></text> <text v-show="active==1" @click="onSend"></text>
<text v-show="active==2">{{item.status}}</text> <text v-show="active==2" @click="onPause">{{item.status}}</text>
</view> </view>
</view> </view>
<view class="details"> <view class="details">
@ -262,61 +262,18 @@
</template> </template>
<script> <script>
import {
mapActions
} from 'vuex'
import HeadView from '@/components/head-view/head-view.vue'; import HeadView from '@/components/head-view/head-view.vue';
import HeadInfo from '@/components/head-info/head-info'; import HeadInfo from '@/components/head-info/head-info';
export default { export default {
data() { data() {
return { return {
id: "",// id
value1: "", value1: "",
value: '', value: '',
itemList: [], itemList: [],
goList: [{ //
sum: 300,
xq: 2
},
{
sum: 600,
xq: 3
},
{
sum: 900,
xq: 1
},
{
sum: 100,
xq: 2
},
{
sum: 200,
xq: 2
}
],
noList: [{ //
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: '暂停'
}
],
range: [1], range: [1],
items: [{ items: [{
value: '1', value: '1',
@ -350,19 +307,96 @@
} }
}, },
onLoad() { onLoad() {
this.tabChange(1) this.id = this.$route.query.id;
this.loadSumOrder() //
}, },
components: { components: {
HeadView, HeadView,
HeadInfo HeadInfo
}, },
methods: { 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 = [{ //
sum: 300,
xq: 2
},
{
sum: 600,
xq: 3
},
{
sum: 900,
xq: 1
},
{
sum: 100,
xq: 2
},
{
sum: 200,
xq: 2
}
]
},
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 = [{ //
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: '暂停'
}
]
},
tabChange(tag) { tabChange(tag) {
this.active = tag this.active = tag
if (this.active == 1) { if (this.active == 1) {
this.itemList = this.goList console.log(1);
} else { } else {
this.itemList = this.noList console.log(2);
} }
}, },
change() {}, change() {},
@ -370,13 +404,57 @@
for (let i = 0; i < this.items.length; i++) { for (let i = 0; i < this.items.length; i++) {
if (this.items[i].value === evt.detail.value) { if (this.items[i].value === evt.detail.value) {
this.current = i; this.current = i;
switch(this.current) {
case 1:
this.loadSumOrder()
break;
case 2:
this.loadOtherOrder()
break;
default:
}
break; break;
} }
} }
}, },
isActive(e) { isActive(e) {
this.itemActive = e this.itemActive = e
}, },
//
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);
})
},
toDetails() { toDetails() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/instructDetails' url: '/pages/index/instructDetails'