<template>
  <div class="purchaseOrderDetail pagePadding">
    <div
      style="width: 100%"
      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
    >
      <div class="detail-page-title">
        <span class="title">售后申请详情</span>
        <add-edit-form :sitem="sitem"></add-edit-form>
      </div>
      powers：{{ powers }}status{{ status }}
      <el-collapse v-model="activeNames">
        <el-collapse-item
          title="业务审核"
          name="1"
          v-if="powers.some((item) => item == '034')"
        >
          <exam-form
            :statusList="statusList"
            :newTime="newTime"
            :disabled="false"
            :isMust="false"
            @searchChange="examForm"
          />
        </el-collapse-item>
        <el-collapse-item
          title="供应商反馈"
          name="2"
          v-if="powers.some((item) => item == '035')"
        >
        
          <supplier-feedback></supplier-feedback>
        </el-collapse-item>
        <el-collapse-item
          title="采购审核"
          name="3"
          v-if="powers.some((item) => item == '036')"
        >
          <purchase-check></purchase-check>
        </el-collapse-item>
        <el-collapse-item
          title="退货物流"
          name="4"
          v-if="powers.some((item) => item == '032')"
        >
          <return-express></return-express>
        </el-collapse-item>
      </el-collapse>
    </div>
    <div v-else>
      <no-auth></no-auth>
    </div>
  </div>
</template>
   <script>
import mixinPage from "@/mixins/elPaginationHandle";
import resToken from "@/mixins/resToken";
// import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder/detail";
import addEditForm from "./components/addEditForm.vue";
import SupplierFeedback from "./components/supplier_feedback.vue";
import PurchaseCheck from "./components/purchase_check";
import ReturnExpress from "./components/returnExpress";
export default {
  name: "serviceDetail",
  mixins: [mixinPage, resToken],
  components: {
    addEditForm,
    SupplierFeedback,
    PurchaseCheck,
    ReturnExpress,
  },
  computed: {
    powers() {
      let tran =
        this.$store.getters.btnList.find(
          (item) => item.menu_route == "serviceDetail"
        ) || {};
      if (tran && tran.action && tran.action.length > 0) {
        return tran.action;
      } else {
        return [];
      }
    },
  },
  data() {
    return {
      activeNames: ["0", "1", "2", "3", "4"],
      sitem: null,
      statusList: [],
      sitem: null,
      newTime: "",
      loading: false,
    };
  },
  mounted() {
    this.sitem = this.$route.query.id;
  },
  methods: {
    getNewTime() {
      this.newTime = new Date().valueOf();
    },
    examForm(e) {
      console.log(e);
    },
  },
};
</script>
   
   