| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <template>
- <view class="mainBox">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="批次号详情" @clickLeft="back">
- <!--右菜单-->
- <template slot="float">
- <!-- <view class="nav-icon-caozuo rightNav" @click="getsure">
- <u-button type="success" size="small" class="u-reset-button" text="选择"></u-button>
- </view> -->
- </template>
- </uni-nav-bar>
- <view class="listContent">
- <view class="listBox" v-for="(item,index) in listData" :key="index">
- <!-- <view class="listBox-sel">
- <checkbox :value="item.code" color="#fff" :disabled="item.disabled" :checked="item.checked"
- @click="selectVal(item,index)" />
- </view> -->
- <view class="listBox-con">
- <view class="listBox-top">
- <view class="listBox-name">
- {{item.name}}
- </view>
- <view class="listBox-code">
- {{item.code}}
- </view>
- </view>
- <view class="listBox-bottom">
- <view class="bot-left">
- 牌号:{{item.mark}}
- </view>
- <view class="bot-right">
- 型号:{{item.model}}
- </view>
- </view>
- <view class="listBox-bottom">
- <view class="bot-left">
- 批次号:{{item.batchNo}}
- </view>
- <view class="bot-right">
- 重量:{{item.weight}}
- </view>
- </view>
- <view class="listBox-bottom">
- <view class="bot-left">
- 单位:{{item.init}}
- </view>
- <view class="bot-right">
- 状态:{{item.status}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- <view class="footer">
- <view class="bottom">
- <checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
- <checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
- </checkbox>
- </view>
- <u-button type="success" size="small" class="u-reset-button">
- <view class="selBtn">
- 选择( {{checkListLen}} )
- </view>
- </u-button>
- </view> -->
- </view>
- </template>
- <script>
- let [page, size, isEnd] = [1, 20, true];
- export default {
- data() {
- return {
- listData: [{
- name: "混炼料1",
- code: "TO5636633221653",
- mark: "E3888235",
- model: "B@3.0",
- batchNo: "aaaa",
- weight: "60",
- init: "kg",
- status: "部分出库"
- }, {
- name: "混炼料2",
- code: "TO5636633221653",
- mark: "E3888236",
- model: "B@3.0",
- batchNo: "bbbb",
- weight: "70",
- init: "kg",
- status: "部分出库"
- }, {
- name: "混炼料3",
- code: "TO5636633221653",
- mark: "E3888237",
- model: "B@3.0",
- batchNo: "cccc",
- weight: "80",
- init: "kg",
- status: "部分出库"
- }], //列表数据
- seletedAll: true, //全选状态
- }
- },
- computed: {
- checkListLen() {
- const list = this.listData.filter((el) => {
- if (el.checked) {
- return el
- }
- })
- return list.length
- },
- },
- onReachBottom: function() {
- if (isEnd) {
- return;
- }
- // 显示加载图标
- uni.showLoading({
- title: "数据加载中"
- });
- this.getInitList();
- },
- mounted() {
- this.getInitList();
- },
- methods: {
- //列表数据
- getInitList() {
- this.listData.forEach((el) => {
- this.$set(el, 'checked', true);
- });
- },
- //全选按钮
- _seletedAll() {
- if (!this.seletedAll) {
- this.seletedAll = true;
- this.listData.map(item => {
- this.$set(item, 'checked', true)
- })
- } else {
- this.seletedAll = false
- //this.checkListLen = 0;
- this.listData.map(item => {
- this.$set(item, 'checked', false)
- })
- };
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .mainBox {
- .listContent {
- .listBox {
- display: flex;
- height: 200rpx;
- border-bottom: 2rpx solid #e5e5e5;
- .listBox-sel {
- height: 200rpx;
- width: 80rpx;
- line-height: 200rpx;
- text-align: center;
- checkbox {
- transform: scale(1.2);
- }
- }
- .listBox-con {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- align-items: center;
- padding-left: 20rpx;
- .listBox-top {
- width: 100%;
- display: flex;
- justify-content: space-between;
- .listBox-name,
- .listBox-code {
- display: inline-block;
- width: 50%;
- }
- .listBox-code {
- text-align: right;
- padding-right: 20rpx;
- }
- }
- .listBox-bottom {
- width: 100%;
- display: flex;
- justify-content: space-between;
- .bot-left,
- .bot-right {
- display: inline-block;
- width: 50%;
- color: $uni-text-color-grey;
- }
- .bot-right {
- text-align: right;
- padding-right: 20rpx;
- }
- }
- }
- }
- }
- .footer {
- position: fixed;
- display: flex;
- justify-content: space-between;
- align-items: center;
- bottom: 0;
- width: 100%;
- height: 100rpx;
- border-top: 1rpx solid #eeecec;
- background-color: #FFFFFF;
- z-index: 999;
- .bottom {
- margin-left: 10rpx;
- }
- .u-reset-button {
- position: absolute;
- right: 10rpx;
- top: 20rpx;
- }
- }
- }
- </style>
|