|
@@ -6,8 +6,8 @@ Page({
|
|
|
data: {
|
|
data: {
|
|
|
id: '',
|
|
id: '',
|
|
|
tab: 1,
|
|
tab: 1,
|
|
|
- recordCurrentPage: 1,
|
|
|
|
|
- dischargeCurrentPage: 1,
|
|
|
|
|
|
|
+ shipDischargeCurrentPage: 1,
|
|
|
|
|
+ truckLoadCurrentPage: 1,
|
|
|
coordinates: [],
|
|
coordinates: [],
|
|
|
medias: [],
|
|
medias: [],
|
|
|
policys: [],
|
|
policys: [],
|
|
@@ -16,7 +16,10 @@ Page({
|
|
|
infoType: 'ship',
|
|
infoType: 'ship',
|
|
|
shipDischargeList: [],
|
|
shipDischargeList: [],
|
|
|
truckLoadList: [],
|
|
truckLoadList: [],
|
|
|
- polyline: {}
|
|
|
|
|
|
|
+ shipDischargeTotal: 0,
|
|
|
|
|
+ truckLoadTotal: 0,
|
|
|
|
|
+ polyline: {},
|
|
|
|
|
+ pageSize: 20
|
|
|
},
|
|
},
|
|
|
changeTab(e) {
|
|
changeTab(e) {
|
|
|
let {
|
|
let {
|
|
@@ -49,7 +52,8 @@ Page({
|
|
|
}
|
|
}
|
|
|
let polyline = {
|
|
let polyline = {
|
|
|
points,
|
|
points,
|
|
|
- color: "#ff454d"
|
|
|
|
|
|
|
+ color: "#ff454d",
|
|
|
|
|
+ width: 50
|
|
|
}
|
|
}
|
|
|
this.setData({
|
|
this.setData({
|
|
|
coordinates,
|
|
coordinates,
|
|
@@ -62,27 +66,30 @@ Page({
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async getCarLoadRecordList(isScroll) {
|
|
async getCarLoadRecordList(isScroll) {
|
|
|
|
|
+ if (this.data.truckLoadTotal != 0 && this.data.truckLoadTotal < this.data.pageSize * this.data.truckLoadCurrentPage) return
|
|
|
if (isScroll) {
|
|
if (isScroll) {
|
|
|
- this.data.recordCurrentPage += 1
|
|
|
|
|
|
|
+ this.data.truckLoadCurrentPage += 1
|
|
|
} else {
|
|
} else {
|
|
|
- this.data.recordCurrentPage = 1
|
|
|
|
|
|
|
+ this.data.truckLoadCurrentPage = 1
|
|
|
}
|
|
}
|
|
|
let res = await postApi("/voyage/getCarLoadRecordList", {
|
|
let res = await postApi("/voyage/getCarLoadRecordList", {
|
|
|
voyageId: this.data.id,
|
|
voyageId: this.data.id,
|
|
|
- size: 50,
|
|
|
|
|
- currentPage: this.data.recordCurrentPage
|
|
|
|
|
|
|
+ size: this.data.pageSize,
|
|
|
|
|
+ currentPage: this.data.truckLoadCurrentPage
|
|
|
|
|
+ })
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ truckLoadCurrentPage: this.data.truckLoadCurrentPage,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
if (0 == res.data.status) {
|
|
if (0 == res.data.status) {
|
|
|
if (isScroll) {
|
|
if (isScroll) {
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
let truckLoadList = [...this.data.truckLoadList, ...res.data.result]
|
|
let truckLoadList = [...this.data.truckLoadList, ...res.data.result]
|
|
|
for (let i of truckLoadList) {
|
|
for (let i of truckLoadList) {
|
|
|
i.weighTime = this.cutTimeString(i.weighTime)
|
|
i.weighTime = this.cutTimeString(i.weighTime)
|
|
|
}
|
|
}
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- truckLoadList
|
|
|
|
|
|
|
+ truckLoadList,
|
|
|
|
|
+ truckLoadTotal: res.data.total
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
let truckLoadList = res.data.result
|
|
let truckLoadList = res.data.result
|
|
@@ -91,51 +98,56 @@ Page({
|
|
|
i.weighTime = this.cutTimeString(i.weighTime)
|
|
i.weighTime = this.cutTimeString(i.weighTime)
|
|
|
}
|
|
}
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- truckLoadList
|
|
|
|
|
|
|
+ truckLoadList,
|
|
|
|
|
+ truckLoadTotal: res.data.total
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.setData({
|
|
|
|
|
- truckLoadList: []
|
|
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: res.data.msg,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async getDischargeList(isScroll) {
|
|
async getDischargeList(isScroll) {
|
|
|
if (isScroll) {
|
|
if (isScroll) {
|
|
|
- this.data.dischargeCurrentPage += 1
|
|
|
|
|
|
|
+ this.data.shipDischargeCurrentPage += 1
|
|
|
} else {
|
|
} else {
|
|
|
- this.data.dischargeCurrentPage = 1
|
|
|
|
|
|
|
+ this.data.shipDischargeCurrentPage = 1
|
|
|
}
|
|
}
|
|
|
let res = await postApi("/voyage/getDischargeList", {
|
|
let res = await postApi("/voyage/getDischargeList", {
|
|
|
voyageId: this.data.id,
|
|
voyageId: this.data.id,
|
|
|
- size: 50,
|
|
|
|
|
- currentPage: this.data.dischargeCurrentPage
|
|
|
|
|
|
|
+ size: this.data.pageSize,
|
|
|
|
|
+ currentPage: this.data.shipDischargeCurrentPage
|
|
|
|
|
+ })
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ shipDischargeCurrentPage: this.data.shipDischargeCurrentPage,
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
if (0 == res.data.status) {
|
|
if (0 == res.data.status) {
|
|
|
if (isScroll) {
|
|
if (isScroll) {
|
|
|
-
|
|
|
|
|
let shipDischargeList = [...this.data.shipDischargeList, ...res.data.result]
|
|
let shipDischargeList = [...this.data.shipDischargeList, ...res.data.result]
|
|
|
for (let i of shipDischargeList) {
|
|
for (let i of shipDischargeList) {
|
|
|
i.dischargeTime = this.cutTimeString(i.dischargeTime)
|
|
i.dischargeTime = this.cutTimeString(i.dischargeTime)
|
|
|
}
|
|
}
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- shipDischargeList
|
|
|
|
|
|
|
+ shipDischargeList,
|
|
|
|
|
+ shipDischargeTotal: res.data.total
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
-
|
|
|
|
|
let shipDischargeList = res.data.result
|
|
let shipDischargeList = res.data.result
|
|
|
for (let i of shipDischargeList) {
|
|
for (let i of shipDischargeList) {
|
|
|
i.dischargeTime = this.cutTimeString(i.dischargeTime)
|
|
i.dischargeTime = this.cutTimeString(i.dischargeTime)
|
|
|
}
|
|
}
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- shipDischargeList
|
|
|
|
|
|
|
+ shipDischargeList,
|
|
|
|
|
+ shipDischargeTotal: res.data.total
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.setData({
|
|
|
|
|
- shipDischargeList: []
|
|
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ icon: "none",
|
|
|
|
|
+ title: res.data.msg,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -156,8 +168,19 @@ Page({
|
|
|
type
|
|
type
|
|
|
} = e.currentTarget.dataset
|
|
} = e.currentTarget.dataset
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- infoType: type
|
|
|
|
|
|
|
+ infoType: type,
|
|
|
|
|
+ truckLoadCurrentPage: 1,
|
|
|
|
|
+ shipDischargeCurrentPage: 1,
|
|
|
|
|
+ shipDischargeList: [],
|
|
|
|
|
+ truckLoadList: [],
|
|
|
|
|
+ shipDischargeTotal: 0,
|
|
|
|
|
+ truckLoadTotal: 0,
|
|
|
})
|
|
})
|
|
|
|
|
+ if (type == "ship") {
|
|
|
|
|
+ this.getDischargeList()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.getCarLoadRecordList()
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
cutTimeString(str) {
|
|
cutTimeString(str) {
|
|
@@ -173,6 +196,15 @@ Page({
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ scrollShip() {
|
|
|
|
|
+ if (this.data.shipDischargeTotal == 0 || this.data.shipDischargeTotal <= this.data.pageSize * this.data.shipDischargeCurrentPage) return
|
|
|
|
|
+ this.getDischargeList(true)
|
|
|
|
|
+ },
|
|
|
|
|
+ scrollTruck() {
|
|
|
|
|
+ if (this.data.truckLoadTotal == 0 || this.data.truckLoadTotal <= this.data.pageSize * this.data.truckLoadCurrentPage) return
|
|
|
|
|
+ this.getCarLoadRecordList(true)
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
this.setData({
|
|
this.setData({
|