#
whycq
2023-11-24 40f52f079fb44bcb0b93bdc6fc41f23275365000
pages/business/goBusiness/businessTripOther.vue
@@ -20,7 +20,26 @@
         <u-search placeholder="输入" v-model="keyword" :clearabled="true" @custom="search()" @search="search()"></u-search>
      </view>
      
      <view class="main-box">
         <view class="box" v-for="item in list" @click="goDetl(item)">
            <view style="display: flex;">
               <view class="box-title" style="flex: 1;">{{item.userId$}}提交的出差申请</view>
               <view class="box-time">{{item.createTime$.substring(0,10)}}</view>
            </view>
            <view class="box-item">出差事由:{{item.businessTripReasons}}</view>
            <view class="box-item">跟踪项目:{{item.orderId$}}</view>
            <view style="display: flex;">
               <view class="box-item" style="flex: 1;">状态:{{item.status$}}</view>
               <view class="box-settle" :style="item.bgcolor">{{item.settle$}}</view>
            </view>
         </view>
      </view>
      <u-empty v-if="true" icon="../../../static/image/emptyList.png" v-show="list.length <= 0" />
      <view class="fxbtn">
         <uni-icons type="plusempty" color="#fff" @click="add()" ></uni-icons>
      </view>
       
   </view>
</template>
@@ -49,7 +68,7 @@
            that.falg = false
         })
         setTimeout(()=> {
            // this.getCsmtr1()
            this.getBusinessTripOther()
         },50)
         if (this.falg) {
            this.getDetail()
@@ -73,6 +92,59 @@
               });
            }, 1000);
         },
         getBusinessTripOther() {
            let _this = this
            let param = {curr:1,limit:16,dept_id: 0,user_id: 67}
            if (_this.user.type == 'user_id') {
               param = {curr:1,limit:16,user_id: _this.user.id}
            } else if(_this.user.type == 'dept_id') {
               param = {curr:1,limit:16,dept_id: _this.user.id}
            } else {
               param = {curr:1,limit:16}
            }
            uni.request({
               url: `${_this.baseUrl}/businessTripOther/list/auth`,
               header: {
                  'token': uni.getStorageSync('token')
               },
               data: param,
               success(res) {
                  res = res.data
                  if (res.code === 200) {
                     for (let k of res.data.records) {
                        if (k.settle == 2) {
                           k['bgcolor'] = 'color: #12d489'
                        } else if (k.settle == 1) {
                           k['bgcolor'] = 'color: #ffbd67'
                        }
                     }
                     _this.list = res.data.records
                  }
                  // _this.list =
               }
            })
         },
         goDetl(e) {
            uni.navigateTo({
               url: '/pages/business/goBusiness/businessTripOtherDetl',
               success: function(res) {
                  res.eventChannel.emit('businessTripOtherDetl', {
                     data: e
                  })
               }
            })
         },
         // 出差申请
         add() {
            uni.navigateTo({
               url: '/pages/business/goBusiness/addBusinessTripOther',
               success: function(res) {
                  res.eventChannel.emit('businessTripOtherDetl', {
                     data: 'add'
                  })
               }
            })
         },
         back() {
            uni.navigateBack({
            })
@@ -87,5 +159,58 @@
</script>
<style>
   .flex-row {
      display: flex;
   }
   .flex-col {
      display: flex;
      flex-direction: column;
   }
   .main-box {
      /* margin: 16rpx; */
      /* background-color: #FFF; */
      border-radius: 20rpx;
      padding: 8rpx;
   }
   .box {
      margin: 16rpx 8rpx;
      /* height: 200px; */
      box-shadow: 0 0 5px #dddddd;
      background-color: #FFF;
      padding: 16rpx 32rpx;
      position: relative;
      border-radius: 20rpx;
      font-size: 24rpx;
      color: #bdbdbd;
   }
   .box-flag {
      position: absolute;
      right: 0;
      top: 10rpx;
      background-color: #74B9E9;
      padding: 6rpx;
      font-size: 10rpx;
      color: #FFF;
   }
   .box-time {
      color: #bdbdbd;
   }
   .box-settle {
      font-size: 26rpx;
      /* font-weight: bold; */
   }
   .box-title {
      font-size: 28rpx;
      font-weight: bold;
      color: #000;
   }
   .box-single-row {}
</style>