<template>
  <div>
    <el-form ref="form" class="el-form-box" :model="form" label-width="120px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="订单编号：" prop="orderNo">
            <el-input v-model="form.orderNo" disabled></el-input>
          </el-form-item>
          <el-form-item label="合同名称：" prop="contractName">
            <el-input v-model="form.contractName" disabled></el-input>
          </el-form-item>
          <el-form-item label="合同编号：" prop="contractNumber">
            <el-input v-model="form.contractNumber" disabled></el-input>
          </el-form-item>
          <el-form-item label="结算方式：" prop="settlementModeName">
            <el-input v-model="form.settlementModeName" disabled></el-input>
          </el-form-item>

          <el-form-item label="客户收货地址：" prop="receiveAddress">
            <el-input v-model="form.receiveAddress" disabled></el-input>
          </el-form-item>
          <el-form-item label="订单备注：" prop="remark">
            <el-input type="textarea" v-model="form.remark" disabled></el-input>
          </el-form-item>
          <el-form-item prop="orderFiles" label="订单附件：">
            <div v-if="form.orderFiles && form.orderFiles?.length">
              <el-link
                v-for="link in form.orderFiles"
                :key="link.id"
                type="primary"
                :underline="false"
                @click="downloadFile(link)"
              >
                {{ link.name }}</el-link
              >
            </div>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <!-- <el-form-item
              label="交货日期："
              prop="deliveryDate"

            >
              {{ form.deliveryDate }}
            </el-form-item> -->

          <el-form-item label="项目名称：" prop="projectName">
            <el-input v-model="form.projectName" disabled></el-input>
          </el-form-item>
          <el-form-item label="销售部门：" prop="salesDeptName">
            <el-input v-model="form.salesDeptName" disabled></el-input>
          </el-form-item>
          <el-form-item label="销售类型：" prop="saleTypeName">
            <el-input v-model="form.saleTypeName" disabled></el-input>
          </el-form-item>
          <el-form-item label="总金额：" prop="totalAmount">
            <el-input v-model="form.totalAmount" disabled>
              <template slot="append"> 元 </template>
            </el-input>
          </el-form-item>
          <el-form-item label="优惠后总金额：" prop="payAmount">
            <el-input v-model="form.payAmount" disabled>
              <template slot="append"> 元 </template>
            </el-input>
          </el-form-item>
          <!-- <el-form-item label="计价方式：">
            <el-radio v-model="form.pricingWay" disabled :label="1"
              >按数量计费</el-radio
            >
            <el-radio v-model="form.pricingWay" disabled :label="2"
              >按重量计费</el-radio
            >
          </el-form-item> -->
          <el-form-item
            label="订单类型："
            prop="needProduce"
            style="margin-bottom: 22px"
          >
            <el-radio v-model="form.needProduce" disabled :label="1"
              >生产性订单</el-radio
            >
            <el-radio v-model="form.needProduce" disabled :label="0"
              >库存式订单</el-radio
            >
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="客户名称：" prop="partaName">
            <el-input v-model="form.partaName" disabled></el-input>
          </el-form-item>
          <el-form-item
            label="客户统一社会信用代码："
            prop="partaUnifiedSocialCreditCode"
            class="form_item_label"
          >
            <el-input
              v-model="form.partaUnifiedSocialCreditCode"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item label="客户联系人：" prop="partaLinkName">
            <el-input v-model="form.partaLinkName" disabled></el-input>
          </el-form-item>
          <el-form-item label="客户电话：" prop="partaTel">
            <el-input v-model="form.partaTel" disabled></el-input>
          </el-form-item>
          <el-form-item label="客户传真：" prop="partaFax">
            <el-input v-model="form.partaFax" disabled></el-input>
          </el-form-item>
          <el-form-item label="	客户Email：" prop="partaEmail">
            <el-input v-model="form.partaEmail" disabled></el-input>
          </el-form-item>
          <el-form-item label="客户地址：" prop="partaAddress">
            <el-input v-model="form.partaAddress" disabled></el-input>
          </el-form-item>
          <el-form-item label="创建人：" prop="createUsername">
          <el-input v-model="form.createUsername" disabled></el-input>
        </el-form-item>
          <!-- <el-form-item
              label="客户税号"
              prop="contactAddress"

            >
              <el-input
                clearable
                v-model="form.contactAddress"
                placeholder="请输入"
              />
            </el-form-item> -->
        </el-col>

        <el-col :span="12">
          <el-form-item label="售出方名称：" prop="partbName">
            <el-input v-model="form.partbName" disabled></el-input>
          </el-form-item>
          <el-form-item
            label="售出方统一社会信用代码："
            prop="partbUnifiedSocialCreditCode"
            class="form_item_label"
          >
            <el-input
              v-model="form.partbUnifiedSocialCreditCode"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item label="售出方联系人：" prop="partbLinkName">
            <el-input v-model="form.partbLinkName" disabled></el-input>
          </el-form-item>
          <el-form-item
            prop="partbTel"
            label="售出方联系电话："
            class="form_item_label"
          >
            <el-input v-model="form.partbTel" disabled></el-input>
          </el-form-item>
          <el-form-item prop="partbFax" label="售出方传真：">
            <el-input v-model="form.partbFax" disabled></el-input>
          </el-form-item>

          <el-form-item label="售出方Email：" prop="partbEmail">
            <el-input v-model="form.partbEmail" disabled></el-input>
          </el-form-item>

          <el-form-item label="售出方地址：" prop="partbAddress">
            <el-input v-model="form.partbAddress" disabled></el-input>
          </el-form-item>
  
      <el-form-item label="创建时间：" prop="createTime">
          <el-input v-model="form.createTime" disabled></el-input>
        </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <headerTitle title="物品清单"></headerTitle>
    <inventoryTabledetail
      ref="inventoryTabledetailRef"
      :isCustomerMark="true"
        :isDiscountTotalPrice="true"
        pageName="send"
    ></inventoryTabledetail>
  </div>
</template>

<script>
import { getFile } from '@/api/system/file';
import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';

import dictMixins from '@/mixins/dictMixins';
export default {
  mixins: [dictMixins],
  components: { inventoryTabledetail },
  data() {
    return {
      form: {}
    };
  },
  methods: {
    async init(row) {
      this.form = row;
      this.$nextTick(() => {
        this.$refs.inventoryTabledetailRef &&
          this.$refs.inventoryTabledetailRef.putTableValue(row);
      });
    },

    downloadFile(file) {
      getFile({ objectName: file.storePath }, file.name);
    }
  }
};
</script>
<style lang="scss" scoped>
// :deep(.el-input) {
//   width: 70%;
// }
// :deep(.el-textarea) {
//   width: 70%;
// }
</style>