<template>
  <el-dialog
    v-loading="loading"
    :title="title"
    :center="true"
    align="left"
    top="10vh"
    width="1040px"
    :close-on-click-modal="false"
    :visible.sync="showModelThis"
    element-loading-text="拼命加载中"
    element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.8)"
    @close="closeModel"
  >
    <el-card style="margin-top: -15px; height: 685px">
      <div :span="18" v-if="dstatus === '2'" style="margin: 0 0 15px 0">
        <el-alert
          title="业务驳回理由："
          type="error"
          :size="'mini'"
          :closable="false"
          :description="remark"
          show-icon
        >
        </el-alert>
      </div>
      <add-view
        :id="id"
        :isDetail="isDetail"
        :newTime="newTime"
        :payNo="payNo"
        :dstatus="dstatus"
        :pay_status="pay_status"
        @refreshAll="refreshAll"
      ></add-view>
    </el-card>
  </el-dialog>
</template>
<script>
import addView from "@/views/purchase/orderRecord/components/addView";
export default {
  name: "orderRecord",
  props: [
    "showModel",
    "id",
    "isDetail",
    "dstatus",
    "payNo",
    "companyNo",
    "pay_status",
    "remark",
  ],
  components: {
    addView,
  },
  data() {
    return {
      activeNames: ["1"],
      newTime: 0,
      activeName: "-1",
      loading: false,
      title: "",
      showModelThis: this.showModel,
    };
  },
  watch: {
    showModel: function (val) {
      this.showModelThis = val;
      if (val) {
        this.initForm();
      }
    },
    showModelThis(val) {
      if (!val) {
        this.$emit("cancel");
      }
    },
  },
  methods: {
    closeModel() {
      console.log("closeModel!!");
    },
    refreshAll() {
      this.showModelThis = false;
      this.$emit("refresh");
    },
    setTotal(list) {
      if (list.length > 0) {
        let newList = [];
        let order = 0;
        list.forEach((v1) => {});
      } else {
        return [];
      }
    },
    async initForm() {
      console.log(this.isDetail);
      if (this.isDetail === "003") {
        this.title = "添加订单对账";
      } else if (this.isDetail === "005") {
        this.title = "修改订单对账";
      } else if (this.isDetail === "007") {
        this.title = "订单对账详情";
      }

      this.changea();
      this.loading = false;
    },
    changea() {
      this.newTime = new Date().valueOf();
    },

  },
};
</script>

   <style lang="scss" scoped>
.orderRecord {
  .setWidth {
    width: 100% !important;
    // display: flex;
    // display: block !important;
    // .el-input__inner {
    //   display: flex;
    //   width: 1000px !important;
    //   display: block !important;
    // }
  }
}
</style>
