HTML
//第一层循环---------------------------------------------
//------------------------------------------------------
<view style="border-bottom: 1px solid #eee;" v-for=" (item,index) in zxhInfo" :key="index">
<view class="cu-bar bg-white solid-bottom margin-top">
<view class="action">
<text class="cuIcon-titles text-orange "></text>货物信息
</view>
<view class="action">
<button class="cu-btn round sm bg-blue" v-if="index > 0" :data-id="index" @click="delGoods(index)">删除</button>
</view>
</view>
<!-- 货物信息 -->
//第二层循环-------------------------------------------------------
//----------------------------------------------------------------
<view class="" v-for="(item2,index2) in item.goodList" :key="index2">
<view class="cu-form-group" @click="selectGood(index2,index)" style="border-top: none">
<view class="title">机型:</view>
<view class="indexList" style="margin-right: 36px;">
<view class="indexList_content">
{{item2.goodModel}}
</view>
</view>
<!-- <uni-number-box :value='item.number' :index="index" @change="numChange"></uni-number-box>台 -->
</view>
<view class="cu-form-group" style="border-top: none">
<view class="title">机号:</view>
<input v-model='item2.goodNo' placeholder="请输入机号" name="input"></input>
</view>
<view class="flex solid-bottom padding justify-center bg-white" v-if="index2 == 0" style="border-bottom: 1rpx solid #F1F1F1">
<view class="cuIcon-roundaddfill text-blue" @click="addGoods(index,index2)">添加货物</view>
</view>
<view class="flex solid-bottom padding justify-center bg-white" v-if="index2 > 0" style="border-bottom: 1rpx solid #F1F1F1">
<view class="cuIcon-roundclosefill text-blue" @click="del(index,index2)" >删除货物</view>
</view>
</view>
<view class="cu-form-group">
<view class="title">装货点:</view>
<picker class="picker" mode="selector" :value="zxhInfo[index].startGpsIndex" :range="gpsList" range-key="addressName" @change="bindStartGpsPickerChange($event,index)">
<view class="picker">
{{zxhInfo[index].startGpsIndex>-1?gpsList[zxhInfo[index].startGpsIndex].addressName:'请选择装货点'}}
</view>
</picker>
</view>
<view class="cu-form-group" >
<view class="title">卸货点:</view>
<picker class="picker" mode="selector" :value="zxhInfo[index].endGpsIndex" :range="gpsList" range-key="addressName" @change="bindEndGpsPickerChange($event,index)">
<view class="picker">
{{zxhInfo[index].endGpsIndex>-1?gpsList[zxhInfo[index].endGpsIndex].addressName:'请选择卸货点'}}
</view>
</picker>
</view>
</view>
JS
addGoods(index,index2) {
this.zxhInfo[index].goodList.push({
"goodId": 0,
"goodModel": "请选择机型",
"goodNo": ""
})
},
del(index,index2) {
this.zxhInfo[index].goodList.splice(index2,1)
},