|
@@ -3,31 +3,18 @@
|
|
|
<view class="content">
|
|
|
<view class="content1" v-for="(item,index) in dataList" :key="index">
|
|
|
<view class="top">
|
|
|
- <view class="left">{{item.warehouseName}}</view>
|
|
|
- <view class="right">{{item.validityDate}}</view>
|
|
|
+ <view class="left">{{item.currectDate}}</view>
|
|
|
</view>
|
|
|
- <view v-for="(item1,index) in item.shippingInformationList">
|
|
|
- <view class="hz-content">
|
|
|
- <view class="row1">
|
|
|
- <view class="hz-name">
|
|
|
- {{item1.shipperName}}
|
|
|
- </view>
|
|
|
- <view class="car">
|
|
|
- ({{item1.carList.length}}车)
|
|
|
- </view>
|
|
|
+ <view v-for="(item1,index) in item.carList">
|
|
|
+ <view class="flex justify-between">
|
|
|
+ <view class="hz-name">
|
|
|
+ {{item1.shipperName}}
|
|
|
</view>
|
|
|
- <view class="car-list">
|
|
|
- <view v-for="(item2,index) in item1.carList" class="number">
|
|
|
- {{item2}}
|
|
|
- </view>
|
|
|
+ <view class="car">
|
|
|
+ {{item1.carNo}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="del-row">
|
|
|
- <view>{{item.createDate}}</view>
|
|
|
- <view class="del" @click='del(item)'>删除</view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
<u-modal v-model="isShowAlert1" :title-style="{fontSize: '18px',fontWeight:'500'}"
|
|
|
:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定'
|
|
@@ -105,48 +92,61 @@
|
|
|
methods: {
|
|
|
getData(size, page, type) {
|
|
|
let _obj = {
|
|
|
- commonId: uni.getStorageSync("userInfo").id
|
|
|
+ commonId: uni.getStorageSync("userInfo").id,
|
|
|
+ callFlag:2
|
|
|
}
|
|
|
this.$api.doRequest('get', '/grainDeliveryRegistration/selectGrainDeliveryRegistration', _obj)
|
|
|
.then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
- let curPageData = []
|
|
|
for (let i = 0; i < res.data.data.length; i++) {
|
|
|
let _data = res.data.data[i];
|
|
|
- //判断是记录是否失效
|
|
|
- let _isUserd = function() {
|
|
|
- let _startTime = new Date((_data.validityDate + ' 00:00:00')).getTime();
|
|
|
- let _endTime = Date.parse(new Date());
|
|
|
- if (_endTime - _startTime > 0) {
|
|
|
- _data.validityDate = '已失效'
|
|
|
- } else {
|
|
|
- _data.validityDate = _data.validityDate + ' 0时前有效'
|
|
|
- }
|
|
|
- }()
|
|
|
- let _carNumberList=[]
|
|
|
+ let date = new Date(_data.createDate)
|
|
|
+ _data.currectDate = date.getFullYear()+'-'+((date.getMonth()+1)>=10?(date.getMonth()+1):'0'+(date.getMonth()+1))+'-'+(date.getDate()>=10?date.getDate():'0'+date.getDate())
|
|
|
for (var q = 0; q < _data.shippingInformationList.length; q++) {
|
|
|
console.log(_data.shippingInformationList[q].carNo.split(','))
|
|
|
- _data.shippingInformationList[q].carList = _data.shippingInformationList[q].carNo.split(',')
|
|
|
- }
|
|
|
- let __obj = {
|
|
|
- warehouseName: _data.warehouseName,
|
|
|
- id: _data.id,
|
|
|
- shipperName: _data.shipperName,
|
|
|
- shippingInformationList: _data.shippingInformationList,
|
|
|
- validityDate: _data.validityDate,
|
|
|
- createDate:_data.createDate
|
|
|
-
|
|
|
+ var carArr=_data.shippingInformationList[q].carNo.split(',')
|
|
|
+ _data.shippingInformationList[q].carList = carArr.map(item=>{return {carNo:item,shipperName:_data.shippingInformationList[q].shipperName}})
|
|
|
}
|
|
|
- curPageData.push(__obj)
|
|
|
}
|
|
|
+ let newList = res.data.data.map(item=>{return {currectDate:item.currectDate,carList:[]}})
|
|
|
+ let hash={};
|
|
|
+ newList = newList.reduce((item,next)=>{
|
|
|
+ console.log(item,next,11111)
|
|
|
+ hash[next.currectDate]?"":hash[next.currectDate]=true && item.push(next)
|
|
|
+ return item
|
|
|
+ },[])
|
|
|
+ // console.log(newList)
|
|
|
+ res.data.data.forEach((item,index)=>{
|
|
|
+ for(let i in newList){
|
|
|
+ if(item.currectDate==newList[i].currectDate){
|
|
|
+ newList[i].carList.push(...item.shippingInformationList[0].carList)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(newList)
|
|
|
+ // let _carNumberList=[]
|
|
|
+ // for (var q = 0; q < _data.shippingInformationList.length; q++) {
|
|
|
+ // console.log(_data.shippingInformationList[q].carNo.split(','))
|
|
|
+ // _data.shippingInformationList[q].carList = _data.shippingInformationList[q].carNo.split(',')
|
|
|
+ // }
|
|
|
+ // let __obj = {
|
|
|
+ // warehouseName: _data.warehouseName,
|
|
|
+ // id: _data.id,
|
|
|
+ // shipperName: _data.shipperName,
|
|
|
+ // shippingInformationList: _data.shippingInformationList,
|
|
|
+ // validityDate: _data.validityDate,
|
|
|
+ // createDate:_data.createDate
|
|
|
+
|
|
|
+ // }
|
|
|
+ // curPageData.push(__obj)
|
|
|
if (type == 'down') {
|
|
|
this.mescroll.endSuccess();
|
|
|
this.dataList = []
|
|
|
} else {
|
|
|
- this.mescroll.endBySize(curPageData.length, curPageData.length); //必传参数(当前页的数据个数, 总数据量)
|
|
|
+ this.mescroll.endBySize(newList.length, newList.length); //必传参数(当前页的数据个数, 总数据量)
|
|
|
}
|
|
|
- console.log(curPageData)
|
|
|
- this.dataList = this.dataList.concat(curPageData);
|
|
|
+ console.log(newList)
|
|
|
+ this.dataList = this.dataList.concat(newList);
|
|
|
}
|
|
|
})
|
|
|
},
|