| | |
| | | </view> |
| | | <scroll-view id="#BillListPanel" scroll-y="true" style="height: 55vh;"> |
| | | <view class="options-wrapper" v-show="HBillList.length != 0"> |
| | | <uni-card :is-active="bill.isActive" :class="bill.isActive?'uni-card--is-active':''" v-for="(bill, index) in HBillList[curPage-1]" :key="index" |
| | | :title="bill['物料名称']" :extra="`数量: ${bill['数量']}`" |
| | | @tap="clickCard(bill['HSourceInterID'], bill['单据号'], index)"> |
| | | <uni-card :is-active="bill.isActive" :class="bill.isActive?'uni-card--is-active':''" |
| | | v-for="(bill, index) in HBillList[curPage-1]" :key="index" :title="bill['物料名称']" |
| | | :extra="`数量: ${bill['数量']}`" @tap="clickCard(bill['HSourceInterID'], bill['单据号'], index)"> |
| | | <view class="item"> |
| | | <view class="left">单据号: </view> |
| | | <view class="right">{{bill['单据号']}}</view> |
| | |
| | | // 设置了多源单模式 |
| | | this.setMultiSourceBillList({ |
| | | HInterID: interid, |
| | | HBillNo: billno |
| | | HBillNo: billno, |
| | | HIsActive: this.HBillList[this.curPage - 1][index]['isActive'] |
| | | }) |
| | | } |
| | | |
| | |
| | | setMultiSourceBillList(billInfo) { |
| | | let index = this.multiSouceBillList.findIndex(item => item.HInterID == billInfo.HInterID) |
| | | if (index == -1) { |
| | | billInfo['count'] = 1 |
| | | this.multiSouceBillList.push(billInfo) |
| | | } else { |
| | | if (billInfo.HIsActive) { |
| | | // 如果对应单据传入的是否激活数是true,则计数器+1 |
| | | this.multiSouceBillList[index]['count']++; |
| | | } else { |
| | | // 如果对应单据传入的是否激活数是false,则计数器-1 |
| | | this.multiSouceBillList[index]['count']--; |
| | | } |
| | | if(this.multiSouceBillList[index]['count'] == 0){ |
| | | // 没有选中的单据,则移除缓存中的数据 |
| | | this.multiSouceBillList.splice(index, 1) |
| | | } |
| | | } |
| | | console.log('this.multiSouceBillList: ',this.multiSouceBillList); |
| | | }, |
| | | getBillList() { |