Commit d68af4f6 authored by youjie's avatar youjie

优化包车列表

parent 56b0c251
......@@ -448,7 +448,7 @@
<el-table-column min-width="350" label="行程信息" style="background:#EAEAEA;" >
<template slot-scope="scope">
<div class="RoomList">
<div class="fz12 c9e" v-for="(x, i) in item.DetailList">
<div class="fz12 c9e" v-for="(x, i) in item.NewDetailList">
<span class="mr"
>{{ x.UseDate }}</span
>
......@@ -509,6 +509,7 @@
OP备注:{{item.Remark}}
<i v-if="item.OfferState!=1&&item.OfferState!=3&&pagesTitle=='OP'" class="el-icon-edit cursor-pointer c059FF6 mx" @click="editRemark(item)"></i>
</div>
<more v-if="item.isMore" @change="ViewMore(item,index)" :upIcon="item.upIcon"></more>
</template>
</el-table>
</div>
......@@ -964,9 +965,11 @@
</template>
<script>
import offset from '../../../public/offset.vue';
import more from '../../../public/more.vue';
export default {
components: {
offset
offset,
more
},
props: ["OrderList","pagesTitle"],
data() {
......@@ -1096,6 +1099,20 @@
}
},
methods: {
ViewMore(x,index){
x.upIcon = !x.upIcon
if(x.upIcon){
x.NewDetailList = JSON.parse(JSON.stringify(x.DetailList))
}else{
x.NewDetailList = []
x.DetailList.forEach((y,index)=>{
if(index<2){
x.NewDetailList.push(y)
}
})
}
},
isOffset(row, index, num){
this.makeAdocument(row, index, num,'Offset')
setTimeout(()=>{
......
......@@ -503,8 +503,23 @@
this.apipost(url, this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
let data = res.data.data.pageData
let addList = function(arr){
arr.forEach(x=>{
x.isMore = false
x.upIcon = false
x.NewDetailList = []
// x.Tax = 0
// x.Tax2 = 0
})
}
addList(data)
this.total = res.data.data.count;
res.data.data.pageData.forEach(x=>{
res.data.data.pageData.forEach((x,index)=>{
if(x.DetailList.length>2){
x.isMore = true
}
let dataLists = []
x.Money = 0
x.totalMoney = 0
x.DetailList.forEach(y=>{
......@@ -512,6 +527,12 @@
x.Money +=y.Money
})
x.totalMoney += x.Money
x.DetailList.forEach((item,i)=>{
if(i<1){
dataLists.push(item)
}
})
x.NewDetailList = JSON.parse(JSON.stringify(dataLists))
})
this.DataList = res.data.data.pageData;
this.$forceUpdate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment