const mixins = require('@/mixins/index.js')
const Constants = require('@/utils/Constants.js');
const app = getApp()
Page({
  mixins: [mixins],
    /**
     * 页面的初始数据
     */
    data: {
      stepList:[
        {
          name:"下单时间",
          event:"",
          time:"2021-07-19：12:30:01",
          status:"0"
        },
        {
          name:"支付时间",
          event:"微信小程序，微信支付10.00元",
          time:"2021-07-19：12:30:01",
          status:"0"
        },
        {
          name:"降锁时间",
          event:"",
          time:"2021-07-19：12:30:01",
          status:"1"//status步骤条状态。=1表示最后一条渲染不同样式
        }
      ],
    // 路由
    routeObjName: 'report',
    purList:[],
    saleReturnList:[],
    purIntoList:[],
    },
  /**
   * @desc : 查询
   * @date : 2024/2/1 15:49
   * @author : 于继渤
   */
  getData() {
    return this.excute(this.data.service, this.data.service.getPurTrackingReportDetail+'/'+ this.data.item.purId, {}).then(res=>{
      console.log(res)
      if(res.data.code == 200 ){
        let formData = JSON.parse(this.data.formData)
        if(res.data.data && res.data.data.length > 0){
          let purList =  res.data.data.filter(item=>{
            return item.type== '采购订单'
          }) 
          let stepList =  res.data.data.filter(item=>{
            return item.type !== '采购订单'
          }) 
          if(purList&&purList[0]&&purList[0].itemResponseList&&purList[0].itemResponseList.length>0){
            purList = purList[0].itemResponseList
          } 
          this.setData({
            stepList:stepList,
            purList:purList, 
          })
        }
  
      }
    })
  },
    /**
     * 生命周期函数--监听页面加载
     */
    loadInit() { 
      this.getData()
    },

})