<!--
  @description:采购人-收货订单列表-待提交和待审核
  @Modifier: 高铭昱
  @routerPath:
  @date: 2021-2-16-17:12
-->
<template>
  <div>
    <section>
      <el-table ref="smallTable" v-loading="loading" :data="tableData">
        <el-table-column type="index" label="序号" align="center" width="60" />
        <el-table-column
          prop="orderCode"
          label="订单编号"
          header-align="center"
          align="center"
          min-width="150"
        />
        <!-- 来源编号 -->
        <el-table-column
          prop="belongTenderNo"
          label="来源编号"
          header-align="center"
          align="center"
          min-width="150"
        />
        <el-table-column
          prop="orderName"
          label="订单名称"
          header-align="center"
          align="left"
          min-width="230"
        />
        <el-table-column
          prop="winningDepartName"
          label="供应商名称"
          min-width="180"
          header-align="center"
          align="left"
        />
        <el-table-column
          prop="purchaseDepartName"
          label="采购单位"
          min-width="180"
          header-align="center"
          align="left"
        />
        <el-table-column
          prop="purchaseDepartExecuteName"
          label="采购执行单位"
          min-width="200"
          header-align="center"
          align="left"
        />
        <el-table-column
          label="生成方式"
          width="150"
          header-align="center"
          align="center"
        >
          <template slot-scope="scope">
            <span>{{ filterDictText(tender_methodList,scope.row.tenderMethod) }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="订单净总价(元)"
          min-width="130"
          header-align="center"
          align="right"
        >
          <template slot-scope="scope">
            <span>{{ scope.row.orderTotalMoney?moneyFormat(scope.row.orderTotalMoney.toFixed(2)):scope.row.orderTotalMoney }}</span>
          </template>
        </el-table-column>
        <el-table-column label="创建日期" align="center" width="180" header-align="center">
          <template slot-scope="scope">
            <span>{{ $Moment(scope.row.createTime).format(momentDateTime) }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="订单状态"
          width="150"
          header-align="center"
          align="center"
        >
          <template slot-scope="scope">
            <span> {{ filterDictText(procurementOrderOrderStatusList, scope.row.orderStatus) }}</span>
          </template>
        </el-table-column>
        <!-- 采购员 -->
        <el-table-column
          prop="purchaseUserRealName"
          label="采购员"
          min-width="140"
          header-align="center"
          align="left"
        />
        <!-- 采购单结果 -->
        <el-table-column
          label="采购单结果"
          width="150"
          header-align="center"
          align="center"
        >
          <template slot-scope="scope">
            <el-link
              type="primary"
              @click.stop="procResult(scope.row)"
            >
              {{ scope.row.tenderNo }}
            </el-link>
          </template>
        </el-table-column>
        <el-table-column
          header-align="center"
          label="操作"
          align="center"
          width="160"
          fixed="right"
        >
          <template slot-scope="scope">
            <slot :row="scope.row" :index="scope.index" />
          </template>
        </el-table-column>
      </el-table>
    </section>
  </div>
</template>

<script>
import { filterDictText, moneyFormat } from '@/assets/js/utils' // 深拷贝
import { procurementOrderGroupMixins } from '@/views/procurement/procurementOrder/mixins/procurementOrderGroupMixins.js'

/* 组件*/
export default {
  name: 'ProcOderRecPendingComp',
  mixins: [procurementOrderGroupMixins],
  props: {
    // 表格数据
    tableData: {
      type: Array,
      default: function() {
        return []
      }
    },
    // 查看采购单结果方法
    procResult: {
      type: Function,
      default: function(data) {}
    }
  },
  data() {
    return {
      loading: false
    }
  },
  created() {
  },
  methods: {
    moneyFormat, // 金额千分位
    filterDictText // 字典翻译
  }
}
</script>

<style lang="less" scoped>
</style>
