|
@@ -288,6 +288,16 @@ export default {
|
|
|
ColumnItem
|
|
|
},
|
|
|
props: {
|
|
|
+ //截止时间戳
|
|
|
+ endTime: {
|
|
|
+ type: String,
|
|
|
+ default:() => ''
|
|
|
+ },
|
|
|
+ //截止时间字符串
|
|
|
+ deadline: {
|
|
|
+ type: String,
|
|
|
+ default:() => ''
|
|
|
+ },
|
|
|
// 表格数据
|
|
|
tableData: {
|
|
|
type: Array,
|
|
@@ -332,34 +342,34 @@ export default {
|
|
|
runStockStringArr: [],
|
|
|
spanArr: [],
|
|
|
loadTable: [],
|
|
|
- controlLinesTable: [],
|
|
|
- deadline:null
|
|
|
+ controlLinesTable: []
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getStockString()
|
|
|
- this.getDownStockString()
|
|
|
- this.getRunStockList()
|
|
|
- this.searchLoadData()
|
|
|
- this.getControlLines()
|
|
|
- this.initialDate()
|
|
|
+ this.getStockString()//万港
|
|
|
+ this.getDownStockString()//下游
|
|
|
+ this.getRunStockList()//在途
|
|
|
+ this.searchLoadData()//装车
|
|
|
+ this.getControlLines()//控制线
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ endTime(){
|
|
|
+ this.getStockString()//万港
|
|
|
+ this.getDownStockString()//下游
|
|
|
+ this.getRunStockList()//在途
|
|
|
+ this.searchLoadData()//装车
|
|
|
+ this.getControlLines()//控制线
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- initialDate(){
|
|
|
- let now=new Date();
|
|
|
- this.deadline=now.getFullYear()+'年'+(now.getMonth()+1)+'月'+now.getDate()+'日';
|
|
|
- if(now.getHours()>=8&&now.getHours()<18){
|
|
|
- this.deadline+='(数据截止于8:00)';
|
|
|
- }else{
|
|
|
- this.deadline+='(数据截止于18:00)';
|
|
|
- }
|
|
|
- console.log("deadline:",this.deadline);
|
|
|
- },
|
|
|
getStockString() {
|
|
|
- let that = this
|
|
|
+ let stockStringArr=[]
|
|
|
+ let map={
|
|
|
+ oneDate:this.endTime
|
|
|
+ }
|
|
|
this.axios
|
|
|
.post(
|
|
|
- '/api/v1/wmsh/getLoadPortStockList?apiId=158&pageSize=1000&pageNum=1'
|
|
|
+ '/api/v1/wmsh/getLoadPortStockList?apiId=158&pageSize=1000&pageNum=1',map
|
|
|
)
|
|
|
.then(res => {
|
|
|
console.log(res)
|
|
@@ -397,7 +407,7 @@ export default {
|
|
|
console.log(arr1, 'arr1')
|
|
|
let index = 2.1
|
|
|
arr1.forEach(e => {
|
|
|
- this.stockStringArr.push({
|
|
|
+ stockStringArr.push({
|
|
|
class: 'type',
|
|
|
value: `${index.toFixed(1)}${e[0]['type']}${
|
|
|
e[0]['typeTotalTonnage']
|
|
@@ -405,12 +415,13 @@ export default {
|
|
|
})
|
|
|
index = index + 0.1
|
|
|
e.forEach(e1 => {
|
|
|
- this.stockStringArr.push({
|
|
|
+ stockStringArr.push({
|
|
|
class: 'normal',
|
|
|
value: `${e1['materialName']}/“${e1['resultForeignShipName']}”/${e1['gmTonnage']}吨;`
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
+ this.stockStringArr=stockStringArr;
|
|
|
//处理打印字符串
|
|
|
this.stockString =
|
|
|
'万港库存:' + this.stockMap.stockTonnage + '吨:'
|
|
@@ -421,8 +432,11 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getDownStockString() {
|
|
|
- let that = this
|
|
|
- this.axios.post('/api/v1/wmsh/getDownPortStockList').then(res => {
|
|
|
+ let downStockStringArr=[]
|
|
|
+ let map={
|
|
|
+ oneDate:this.endTime
|
|
|
+ }
|
|
|
+ this.axios.post('/api/v1/wmsh/getDownPortStockList',map).then(res => {
|
|
|
console.log('下游港口吨位')
|
|
|
console.log(res.data.data)
|
|
|
if (res.status == '200') {
|
|
@@ -457,7 +471,7 @@ export default {
|
|
|
console.log(arr1, 'arr1')
|
|
|
let index = 1.1
|
|
|
arr1.forEach(e => {
|
|
|
- this.downStockStringArr.push({
|
|
|
+ downStockStringArr.push({
|
|
|
class: 'type',
|
|
|
value: `${index.toFixed(1)}${e[0]['type']}${
|
|
|
e[0]['typeTotalTonnage']
|
|
@@ -465,12 +479,13 @@ export default {
|
|
|
})
|
|
|
index = index + 0.1
|
|
|
e.forEach(e1 => {
|
|
|
- this.downStockStringArr.push({
|
|
|
+ downStockStringArr.push({
|
|
|
class: 'normal',
|
|
|
value: `${e1['portName']}/${e1['materialName']}/“${e1['resultForeignShipName']}”/${e1['gmTonnage']}吨;`
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
+ this.downStockStringArr=downStockStringArr;
|
|
|
//处理打印字符串
|
|
|
this.downStockString =
|
|
|
'下游港口库存:' + this.downStockMap.downStockTonnage + '吨:'
|
|
@@ -481,8 +496,11 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getRunStockList() {
|
|
|
- let that = this
|
|
|
- this.axios.post('/api/v1/wmsh/getRunStockList').then(res => {
|
|
|
+ let runStockStringArr=[]
|
|
|
+ let map={
|
|
|
+ oneDate:this.endTime
|
|
|
+ }
|
|
|
+ this.axios.post('/api/v1/wmsh/getRunStockList',map).then(res => {
|
|
|
console.log(res)
|
|
|
if (res.status == '200') {
|
|
|
let resultActualInstallations = 0
|
|
@@ -515,7 +533,7 @@ export default {
|
|
|
console.log(arr1, 'arr1')
|
|
|
let index = 3.1
|
|
|
arr1.forEach(e => {
|
|
|
- this.runStockStringArr.push({
|
|
|
+ runStockStringArr.push({
|
|
|
class: 'type',
|
|
|
value: `${index.toFixed(1)}${e[0]['type']}${
|
|
|
e[0]['typeTotalTonnage']
|
|
@@ -525,12 +543,13 @@ export default {
|
|
|
//按物资分
|
|
|
let temp = [];
|
|
|
e.forEach(e1 => {
|
|
|
- this.runStockStringArr.push({
|
|
|
+ runStockStringArr.push({
|
|
|
class: 'normal',
|
|
|
value: `${e1['materialName']}:/“${e1['resultForeignShipName']}”/${e1['gmTonnage']}吨;`
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
+ this.runStockStringArr=runStockStringArr;
|
|
|
//处理打印字符串
|
|
|
this.runStockString =
|
|
|
'在途货物:' + this.runStockMap.runStockTonnage + '吨:'
|
|
@@ -651,7 +670,14 @@ export default {
|
|
|
},
|
|
|
//查询装车数据
|
|
|
searchLoadData() {
|
|
|
- let map = {}
|
|
|
+ let startTime=new Date(this.endTime-1000*60*60*24);
|
|
|
+ let endTime=new Date(this.endTime);
|
|
|
+ startTime.setHours(8);
|
|
|
+ endTime.setHours(8);
|
|
|
+ let map = {
|
|
|
+ startTime:startTime.getTime(),
|
|
|
+ endTime:endTime.getTime()
|
|
|
+ }
|
|
|
this.axios.post('/api/v1/tms/getLoadData', map).then(res => {
|
|
|
if (res.data.code == '200') {
|
|
|
this.getSpanArr(res.data.data)
|
|
@@ -704,9 +730,10 @@ export default {
|
|
|
},
|
|
|
//查询控制线数据
|
|
|
getControlLines() {
|
|
|
+ let endTime=new Date(this.endTime);
|
|
|
let map = {
|
|
|
- year: new Date().getFullYear(),
|
|
|
- month: new Date().getMonth() + 1
|
|
|
+ year: endTime.getFullYear(),
|
|
|
+ month: endTime.getMonth() + 1
|
|
|
}
|
|
|
this.axios.post('/api/v1/tms/getControlLinesTable', map).then(res => {
|
|
|
if (res.data.code == '200') {
|