<template>
  <div>
    <el-dialog
      title="销售订单详情"
      :visible.sync="dialogVisible"
      width="60%"
      :before-close="handleClose"
    >
      <div class="main">
        <header-title title="发货信息" size="16px"></header-title>
        <el-row>
          <el-col :offset="2" :span="8"
            >供应商名称：{{ orderRow.supplierName }}</el-col
          >
          <el-col :offset="6" :span="8">车牌号：{{ orderRow.carNo }}</el-col>
        </el-row>
        <el-row>
          <el-col :offset="2" :span="8"
            >供应商联系人：{{ orderRow.linkName }}</el-col
          >
          <el-col :offset="6" :span="8"
            >收货单编码：{{ orderRow.receiveNo }}</el-col
          >
        </el-row>
        <el-row>
          <el-col :offset="2" :span="8"
            >供应商电话：{{ orderRow.linkPhone }}</el-col
          >
          <el-col :offset="6" :span="8"
            >制单人：{{ orderRow.makerName }}</el-col
          >
        </el-row>
        <el-row>
          <el-col :offset="2" :span="8"
            >审核状态：{{ orderRow.reviewStatus }}</el-col
          >
          <el-col :offset="6" :span="8"
            >订单编码：{{ orderRow.orderNo }}</el-col
          >
        </el-row>
        <el-row>
          <el-col :offset="2" :span="8">附件：{{ orderRow.sendFiles }}</el-col>
        </el-row>
        <header-title title="产品清单" size="16px"></header-title>
        <el-table border :data="orderRow.productList" style="width: 100%">
          <el-table-column type="index" width="80" label="序号" align="center">
          </el-table-column>
          <el-table-column
            prop="productName"
            label="名称"
            width="180"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="productCode"
            label="编码"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="productCategoryName"
            label="类型"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="productBrand"
            label="牌号"
            width="180"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="modelType"
            label="型号"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="specification"
            label="规格"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="warehouseName"
            label="仓库"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="totalCount"
            width="120"
            label="进货数量"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="orderTotalCount"
            width="120"
            label="总数量"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="measuringUnit"
            label="计量单位"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="singlePrice"
            label="单价"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="totalPrice"
            label="合计"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="deliveryDays"
            label="交期（天）"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="deliveryDeadline"
            label="交期截止日期"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="guaranteePeriod"
            label="质保期"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="guaranteePeriodDeadline"
            label="质保截止日期"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="technicalAnswerName"
            label="技术答疑人"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="technicalParams"
            label="技术参数"
            width="120"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="technicalDrawings"
            label="技术图纸"
            width="120"
            align="center"
          >
            <template slot-scope="{ row }">
              {{ row.technicalDrawings[0].name }}
            </template>
          </el-table-column>
          <el-table-column
            prop="remark"
            label="备注"
            width="120"
            align="center"
          >
          </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">关 闭</el-button>
        <!-- <el-button type="primary" @click="handleMine">确 定</el-button> -->
      </span>
    </el-dialog>
  </div>
</template>
<script>
  import { oneId } from '@/api/mes';
  export default {
    data() {
      return {
        dialogVisible: false,
        orderRow: {},
        status: ['未提交', '待审核', '已审核', '审核未通过']
      };
    },
    methods: {
      handleMine() {},
      async open(row) {
        const data = await oneId(row.id);
        console.log('===', data);
        this.orderRow = {
          ...data.data
        };
        this.dialogVisible = true;
      },
      handleClose(done) {}
    }
  };
</script>

<style lang="scss" scoped>
  .el-row {
    margin-bottom: 15px;
    font-size: 14px;
  }
</style>
