gx
queenwuli
2020-12-30 bb6aebd55fc9a8039e1c199ae1ea8af4eb547b1b
hive-app/pages/workbench/storeRecord.vue
New file
@@ -0,0 +1,121 @@
<template>
   <!-- 出入库记录 -->
   <view>
      <view class="header">
         <view class="header-time mr-20">
            <picker mode="date" @change="startDateChange">
               <text :class="startDate?'blue':'gray'">{{startDate?startDate:'请选择开始日期'}}</text>
            </picker>
         </view>
         <text class="iconfont iconjian"></text>
         <view class="header-time ml-20">
            <picker mode="date" @change="endDateChange">
               <text :class="endDate?'blue':'gray'">{{endDate?endDate:'请选择结束日期'}}</text>
            </picker>
         </view>
      </view>
      <view class="content">
         <view class="content-row" v-for="item in list">
            <view class="content-row-header">
               <text>{{item.createTime}}</text>
            </view>
            <view class="content-row-con">
               <view class="font-15 flex align-center justify-between mb-10">
                  <text>{{item.content}}</text>
                  <text :class="item.amount<0?'red':'green'">{{item.amount<0?item.amount:'+'+item.amount}}</text>
               </view>
               <text class="gray">订单编号: {{item.orderNo}}</text>
            </view>
         </view>
      </view>
   </view>
</template>
<script>
   export default{
      data(){
         return {
            goodsCode: '',
            startDate: '',
            endDate: '',
            list: []
         }
      },
      onLoad(options) {
         this.goodsCode = options.goodsCode;
         this.loadList()
      },
      methods:{
         startDateChange(e){
            this.startDate = e.detail.value;
            this.loadList()
         },
         endDateChange(e){
            this.endDate = e.detail.value;
            this.loadList()
         },
         loadList(){
            this.$httpUtils.request('/api/store/findGoodsInOutInfo', {
               code: this.goodsCode,
               pageNum: 1,
               pageSize: 100,
               startTime: this.startDate,
               endTime: this.endDate
            }, 'POST').then((res) => {
               if(res.status == 200){
                  this.list = res.rows;
               }
            })
         }
      }
   }
</script>
<style>
   page{
      background: #F6F6F8;
      position: relative;
   }
   .header{
      display: flex;
      align-items: center;
      justify-content: center;
      position: fixed;
      left: 0;
      right: 0;
      margin-top: -10px;
      background: #FFFFFF;
      padding: 10px 0;
      box-shadow:0 6px 6px rgba(237,234,244,0.5);
      border-bottom-left-radius: 4px;
      border-bottom-right-radius: 4px;
   }
   .header-time{
      border: 1px solid #EDEAF4;
      border-radius: 4px;
      padding: 5px 0;
      width: 120px;
      text-align: center;
      font-size: 14px;
   }
   .content{
      padding: 44px 10px 10px;
   }
   .content-row{
      margin-top: 10px;
      background: #FFFFFF;
      border: 1px solid #EDEAF4;
      border-radius: 4px;
      padding: 0 10px;
      box-shadow:0 6px 6px rgba(237,234,244,0.5);
   }
   .content-row .content-row-header{
      padding: 10px 0;
      border-bottom: 1px solid #EDEAF4;
      font-size: 13px;
   }
   .content-row-con{
      padding: 10px 0;
      font-size: 13px;
   }
</style>