yangan
2024-09-24 eb59423e9bbb141d04c8c6d5a260109a8c87aeb4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<template>
  <view class="warp">
    <view class="table">
            <uni-table border stripe 
   
            emptyText="暂无更多数据">
                    <uni-tr>
                        <uni-th align="center">订单编号</uni-th>
                        <uni-th align="center" width="70">产品</uni-th>
                        <uni-th align="center" width="70"> 客户</uni-th>
              <uni-th align="center" width="70"> 剩余量</uni-th>
              <uni-th align="center">操作</uni-th>
                    </uni-tr>
                    <uni-tr v-for="(item, index) in subDataList" :key="index">
                        <uni-td align="center">
                            <view>{{   item.orderCode}}</view></uni-td>
                    <uni-td>
                        <view class="name">{{ item.productNames }}</view>
                    </uni-td>
          <uni-td>
                        <view class="name">{{ item.customerName }}</view>
                    </uni-td>
          <uni-td>
                        <view class="name">{{ item.surplusQuant }}</view>
                    </uni-td>
          <uni-td>
                        <view class="name">
              <u-button type='primary' text='选择'  size='mini'  @click.native.stop="checkOrder(item)"></u-button>
            </view>
                    </uni-td>
                </uni-tr>
                </uni-table>
   
         </view>
     <!-- <view class="confirm-build">
            <view class="confirm-build_block">
                <u-button text="确认创建"
        type="primary"
                    @click="confirmBuild"
                    :loading="buildLoading"
                    :disabled="abledBuild"></u-button>
            </view>
        </view> -->
  </view>
 
</template>
 
<script>
export default {
    data() {
        return {
          params:{},
          subDataList:[],
          checkList:[],
          tempArr:[],
        }
    },
    onShow(){
 
    },
    onLoad(params){
        console.log(JSON.parse(params.unionParams),params,'params')
        this.params =  JSON.parse(params.unionParams) ;
        this.tempArr = JSON.parse(params.checkArray)
        this.init();
        console.log(this.tempArr,'tempArr')
 
    },
    methods: {
      init(){
        this.$reqGet('getCloseOrderList',this.params).then(res=>{
          console.log(res,'resss')
          if(res.data){
            this.subDataList = res.data;
            this.subDataList.forEach((item,i)=>{
              this.tempArr.forEach((el,index)=>{
                if(item.id === el.id){
                  this.$nextTick(() => {
                this.$refs.table1.toggleRowSelection(i,true)
              })
                }
              })
            })
            
          }
        })
      },
      checkOrder(item){
        uni.$emit('updateData', JSON.stringify(item))
                uni.navigateBack({
                    delta: 1
                })
 
      },
      selectionChange(e){
        console.log(e,'eeee')
        this.subDataList.forEach((element,i) => {
          this.checkList.push(this.subDataList[i])
       });
      },
      confirmBuild(){
        this.checkOrder(this.checkList)
      }
        
    },
 
}
</script>
 
<style lang="scss" scoped>
    .table{
        width: 94%;
        margin-left: 20rpx;
    /deep/ .uni-table{
            min-width: 340rpx!important;
        }
    }
.warp{
    width: 100%;
    height: calc(100vh - 10vh);
}
.confirm-build {
            width: 100%;
            height: vww(60);
            background-color: #ffffff;
            position: fixed;
            bottom: 0;
            box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
            border-radius: 20rpx;
            display: flex;
            justify-content: center;
            align-items: center;
 
            &_block {
                width: 94%;
            }
        }
 
</style>