<template>
  <div>
    <el-card>
      <div class="text">
        <el-row style="margin-top: 10px">
          <span style="width:80px;display:inline-block;">发货单名：</span>
          <el-input
            v-model="searchFrom.发货单名"
            clearable
            placeholder="请输入"
            style="width: 150px;margin-right: 10px"
            size="mini"/>
          <span style="width:80px;display:inline-block;">发货单号：</span>
          <el-input
            v-model="searchFrom.发货单号"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
          <span style="width:80px;display:inline-block;">收货单位：</span>
          <el-input
            v-model="searchFrom.收货单位"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
        </el-row>
        <el-row style="margin-top: 10px">
          <span style="width:80px;display:inline-block;">车辆牌号：</span>
          <el-input
            v-model="searchFrom.车辆牌号"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
          <span style="width:80px;display:inline-block;">司机姓名：</span>
          <el-input
            v-model="searchFrom.司机姓名"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
          <span style="width:80px;display:inline-block;">司机电话：</span>
          <el-input
            v-model="searchFrom.司机电话"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
        </el-row>
        <el-row style="margin-top: 10px">
          <span style="width:80px;display:inline-block;">制单人：</span>
          <el-input
            v-model="searchFrom.制单人"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
          <span style="width:80px;display:inline-block;">核准人：</span>
          <el-input
            v-model="searchFrom.核准人"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
          <span style="width:80px;display:inline-block;">执行人：</span>
          <el-input
            v-model="searchFrom.执行人"
            placeholder="请输入"
            clearable
            style="width: 150px;margin-right: 10px"
            size="mini"/>
        </el-row>
        <el-row style="margin-top: 10px">
          <span style="width:80px;display:inline-block;">制单日期：</span>
          <el-date-picker
            v-model="searchFrom.开始制单日期"
            style="width: 150px; margin-right: 10px"
            value-format="yyyy-MM-dd HH:mm:ss"
            size="small"
            type="datetime"
            placeholder="开始日期"/>
          <span style="width:80px;display:inline-block;">制单日期：</span>
          <el-date-picker
            v-model="searchFrom.结束制单日期"
            style="width: 150px; margin-right: 10px"
            value-format="yyyy-MM-dd HH:mm:ss"
            size="small"
            type="datetime"
            placeholder="结束日期"/>
          <span style="width:80px;display:inline-block;">发货状态：</span>
          <el-select v-model="DeliveryStatusValue" placeholder="请选择" size="mini" style="width: 150px" clearable>
            <el-option
              v-for="item in DeliveryStatus"
              :key="item.value"
              :label="item.label"
              :value="item.value"/>
          </el-select>
        </el-row>
        <el-row style="margin-top: 10px">
          <span style="width:80px;display:inline-block;">核准日期：</span>
          <el-date-picker
            v-model="searchFrom.开始核准日期"
            style="width: 150px; margin-right: 10px"
            value-format="yyyy-MM-dd HH:mm:ss"
            size="small"
            type="datetime"
            placeholder="开始日期"/>
          <span style="width:80px;display:inline-block;">核准日期：</span>
          <el-date-picker
            v-model="searchFrom.结束核准日期"
            style="width: 150px; margin-right: 10px"
            value-format="yyyy-MM-dd HH:mm:ss"
            size="small"
            type="datetime"
            placeholder="结束日期"/>
        </el-row>
        <el-row style="margin-top: 10px">
          <span style="width:80px;display:inline-block;">发货日期：</span>
          <el-date-picker
            v-model="searchFrom.开始发货日期"
            style="width: 150px; margin-right: 10px"
            value-format="yyyy-MM-dd HH:mm:ss"
            size="small"
            type="datetime"
            placeholder="开始日期"/>
          <span style="width:80px;display:inline-block;">发货日期：</span>
          <el-date-picker
            v-model="searchFrom.结束发货日期"
            style="width: 150px; margin-right: 10px"
            value-format="yyyy-MM-dd HH:mm:ss"
            size="small"
            type="datetime"
            placeholder="结束日期"/>
          <el-button type="primary" plain icon="el-icon-search" size="mini" style="margin-left: 74px" @click="search">查询</el-button>
          <el-button type="distribution" icon="el-icon-delete" size="mini" @click="clearSearch">清空</el-button>
        </el-row>
      </div>
      <el-divider/>
      <div>
        <el-table
          :data="tableDataSearchList"
          highlight-current-row
          style="width: 100%"
          height="500"
          border
          stripe
          size="mini"
          @row-click="openDialogFormVisible">
          <el-table-column align="center" label="状态" min-width="80">
            <template slot-scope="scope">
              <span v-if="scope.row.是否发出.toString() === '1'" type="success" size="small">已发出</span>
              <span v-else type="danger" size="small">未发出</span>
              <!--{{ scope.row.是否发出.toString() === '1' ? '已发出' : '未发出' }}-->
            </template>
          </el-table-column>
          <el-table-column align="center" label="发货单号" min-width="120">
            <template slot-scope="scope">
              {{ scope.row.发货单编号 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="发货单名" min-width="110">
            <template slot-scope="scope">
              {{ scope.row.发货单名称 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="收货单位" min-width="200">
            <template slot-scope="scope">
              {{ scope.row.收货单位 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="收货地址" min-width="250" show-overflow-tooltip>
            <template slot-scope="scope">
              {{ scope.row.收货地址 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="收货人员" min-width="80">
            <template slot-scope="scope">
              {{ scope.row.收货人员 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="联系电话" min-width="110">
            <template slot-scope="scope">
              {{ scope.row.联系电话 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="车辆牌号" min-width="110" show-overflow-tooltip>
            <template slot-scope="scope">
              {{ scope.row.车辆牌号 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="司机姓名" min-width="80">
            <template slot-scope="scope">
              {{ scope.row.司机姓名 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="司机电话" min-width="110">
            <template slot-scope="scope">
              {{ scope.row.司机电话 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="制单人" min-width="80" show-overflow-tooltip>
            <template slot-scope="scope">
              {{ scope.row.制单人 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="审核人" min-width="80" show-overflow-tooltip>
            <template slot-scope="scope">
              {{ scope.row.审核人 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="发货人" min-width="80">
            <template slot-scope="scope">
              {{ scope.row.发货人 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="制单时间" min-width="85">
            <template slot-scope="scope">
              {{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="审核时间" min-width="85">
            <template slot-scope="scope">
              {{ scope.row.审核日期 ? scope.row.审核日期.split(' ')[0] : '-' }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="发货时间" min-width="85">
            <template slot-scope="scope">
              {{ scope.row.发出时间 ? scope.row.发出时间.split(' ')[0] : '-' }}
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="block" style="margin-top: 10px;">
        <el-pagination
          :current-page="pageCurrent"
          :page-sizes="[10, 20, 30, 40, 50]"
          :page-size="pageSize"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"/>
      </div>
    </el-card>

    <el-dialog :visible.sync="dialogFormVisible" title="江苏高精机电装备有限公司发货申请单" center style="min-height: 700px" width="60%">
      <el-form ref="invoiceFrom" :model="invoiceFrom" :rules="invoiceFromRules" label-position="left" label-width="110px">
        <el-row>
          <el-form-item label="发货单号" prop="发货单号" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.发货单号"
              readonly
              style="width: 200px;margin-right: 10px"
              size="mini"/>
          </el-form-item>
          <el-form-item label="收货地址" prop="收货地址" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.收货地址"
              readonly
              clearable
              size="mini"
              style="width: 495px;margin-right: 10px"/>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="发货单名" prop="发货单名" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.发货单名"
              readonly
              clearable
              style="width: 200px;margin-right: 10px"
              size="mini"/>
          </el-form-item>
          <el-form-item label="注意事项" prop="注意事项" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.注意事项"
              readonly
              clearable
              style="width: 495px;margin-right: 10px"
              size="mini"/>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="收货单位" prop="收货单位" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.收货单位"
              readonly
              clearable
              style="width: 200px;margin-right: 10px"
              size="mini"/>
          </el-form-item>
          <el-form-item label="收货人员" prop="收货人员" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.收货人员"
              readonly
              clearable
              size="mini"
              style="width: 200px;margin-right: 10px"/>
          </el-form-item>
          <el-form-item label="联系电话" prop="联系电话" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.联系电话"
              :trigger-on-focus="false"
              readonly
              clearable
              size="mini"
              style="width: 200px;margin-right: 10px"/>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="车辆牌号" prop="车辆牌号" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.车辆牌号"
              :disabled="disabled"
              size="mini"
              style="width: 200px;margin-right: 10px"
              clearable
              placeholder="请输入内容"/>
          </el-form-item>
          <el-form-item label="司机姓名" prop="司机姓名" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.司机姓名"
              :disabled="disabled"
              size="mini"
              style="width: 200px;margin-right: 10px"
              clearable
              placeholder="请输入内容"/>
          </el-form-item>
          <el-form-item label="司机电话" prop="司机电话" style="display: inline-block" label-width="80px">
            <el-input
              v-model="invoiceFrom.司机电话"
              :disabled="disabled"
              size="mini"
              style="width: 200px;margin-right: 10px"
              clearable
              placeholder="请输入内容"/>
          </el-form-item>
        </el-row>
        <el-row style="margin-top: 15px">
          <el-form-item label="备注" prop="备注" style="display: inline-block;width: 70%" label-width="80px">
            <el-input
              v-model="invoiceFrom.备注"
              :disabled="disabled"
              size="mini"
              style="width: 90%;margin-right: 10px"
              clearable
              placeholder="请输入内容"/>
          </el-form-item>
          <el-button :disabled="disabled" type="success" size="mini" style="margin-left: 5px" @click="confirmation('invoiceFrom')">确认发货</el-button>
          <el-button :disabled="disabledDetailsDelete" type="danger" size="mini" @click="wiverOfConfirmation">打回确认</el-button>
        </el-row>
      </el-form>
      <div/>
      <el-divider/>
      <div>
        <el-table
          :data="tableDataDelivery"
          highlight-current-row
          style="width: 100%"
          height="300"
          border
          size="mini">
          <el-table-column align="center" label="货品类别" width="80">
            <template slot-scope="scope">
              <el-tag effect="dark" size="small" type="success">{{ scope.row.货品类别 }}</el-tag>
            </template>
          </el-table-column>
          <el-table-column align="center" label="货品编号">
            <template slot-scope="scope">
              {{ scope.row.货品编号 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="货品名称">
            <template slot-scope="scope">
              {{ scope.row.货品名称 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="货品规格">
            <template slot-scope="scope">
              {{ scope.row.货品规格 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="货品型号">
            <template slot-scope="scope">
              {{ scope.row.货品型号 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="数量" width="80">
            <template slot-scope="scope">
              <template>
                {{ scope.row.数量 }}
              </template>
            </template>
          </el-table-column>
          <el-table-column align="center" label="设计者" width="80">
            <template slot-scope="scope">
              {{ scope.row.设计者 }}
            </template>
          </el-table-column>
        </el-table>
      </div>
      <el-divider/>
      <el-row>
        <div class="text">
          <span>制单人：</span>
          <span>{{ isMaker }}</span>
          <el-divider direction="vertical"/>
          <span style="margin-left: 10px">核准人：</span>
          <span>{{ isExamine }}</span>
          <el-divider direction="vertical"/>
          <span style="margin-left: 10px">发货执行人：</span>
          <span>{{ isDelive }}</span>
          <el-divider direction="vertical"/>
          <span>制单时间：</span>
          <span>{{ MakerTime }}</span>
          <el-divider direction="vertical"/>
          <span style="margin-left: 10px">核准时间：</span>
          <span>{{ ExamineTime }}</span>
          <el-divider direction="vertical"/>
          <span style="margin-left: 10px">发货时间：</span>
          <span>{{ DeliveTime }}</span>
        </div>
      </el-row>
    </el-dialog>
  </div>
</template>

<!--<el-button-->
  <!--:disabled="disabledDetailsDelete"-->
  <!--size="mini"-->
  <!--type="text"-->
  <!--icon="el-icon-delete-solid"-->
  <!--@click.native.prevent="deleteRow(scope.$index, tableData)"-->
<!--&gt;删除</el-button>-->

<script>
import { InvoiceListSearch, DetailsFeach, confirmation, reconfirmation } from '@/api/Assembly/DeliveryConfirmation'
import { mapGetters } from 'vuex'
export default {
  data() {
    return {
      disabledDetailsDelete: false,
      disabled: false,
      isMaker: '',
      isDelive: '',
      isExamine: '',
      MakerTime: '',
      ExamineTime: '',
      DeliveTime: '',
      invoiceNum: '',
      tableDataDelivery: [],
      dialogFormVisible: false,
      pageCurrent: 1,
      pageSize: 10,
      total: null,
      invoiceFrom: {
        发货单号: '',
        收货地址: '',
        发货单名: '',
        收货单位: '',
        注意事项: '',
        车辆牌号: '',
        司机姓名: '',
        司机电话: '',
        收货人员: '',
        联系电话: '',
        备注: ''
      },
      invoiceFromRules: {
        司机姓名: [{ required: true, message: '请输入司机姓名', trigger: 'blur' }],
        司机电话: [{ required: true, message: '请输入司机电话', trigger: 'blur' }],
        车辆牌号: [{ required: true, message: '请输入车辆牌号', trigger: 'blur' }]
      },
      searchFrom: {
        发货单名: '',
        发货单号: '',
        收货单位: '',
        车辆牌号: '',
        司机姓名: '',
        司机电话: '',
        制单人: '',
        核准人: '',
        执行人: '',
        开始制单日期: '',
        结束制单日期: '',
        开始核准日期: '',
        结束核准日期: '',
        开始发货日期: '',
        结束发货日期: '',
        发货单名_check: null,
        发货单号_check: null,
        收货单位_check: null,
        车辆牌号_check: null,
        司机姓名_check: null,
        司机电话_check: null,
        制单人_check: null,
        核准人_check: null,
        执行人_check: null,
        开始制单日期_check: null,
        结束制单日期_check: null,
        开始核准日期_check: null,
        结束核准日期_check: null,
        开始发货日期_check: null,
        结束发货日期_check: null
      },
      DeliveryStatusValue_check: null,
      tableDataSearchList: [],
      listLoading: false,
      DeliveryStatusValue: '',
      DeliveryStatus: [{
        value: 1,
        label: '已发货'
      },
      {
        value: 2,
        label: '未发货'
      }]
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'id'// 人员编号
    ])
  },
  methods: {
    clearSearch() {
      this.DeliveryStatusValue = ''
      this.searchFrom.发货单名 = ''
      this.searchFrom.发货单号 = ''
      this.searchFrom.收货单位 = ''
      this.searchFrom.车辆牌号 = ''
      this.searchFrom.司机姓名 = ''
      this.searchFrom.司机电话 = ''
      this.searchFrom.制单人 = ''
      this.searchFrom.核准人 = ''
      this.searchFrom.执行人 = ''
      this.searchFrom.开始制单日期 = ''
      this.searchFrom.结束制单日期 = ''
      this.searchFrom.开始核准日期 = ''
      this.searchFrom.结束核准日期 = ''
      this.searchFrom.开始发货日期 = ''
      this.searchFrom.结束发货日期 = ''
    },
    search() {
      this.tableDataSearchList = []
      this.DeliveryStatusValue !== null && this.DeliveryStatusValue !== '' ? this.DeliveryStatusValue_check = 1 : this.DeliveryStatusValue_check = 0
      this.DeliveryStatusValue === null ? this.DeliveryStatusValue = '' : this.DeliveryStatusValue
      this.searchFrom.发货单名 !== null && this.searchFrom.发货单名 !== '' ? this.searchFrom.发货单名_check = 1 : this.searchFrom.发货单名_check = 0
      this.searchFrom.发货单号 !== null && this.searchFrom.发货单号 !== '' ? this.searchFrom.发货单号_check = 1 : this.searchFrom.发货单号_check = 0
      this.searchFrom.收货单位 !== null && this.searchFrom.收货单位 !== '' ? this.searchFrom.收货单位_check = 1 : this.searchFrom.收货单位_check = 0
      this.searchFrom.车辆牌号 !== null && this.searchFrom.车辆牌号 !== '' ? this.searchFrom.车辆牌号_check = 1 : this.searchFrom.车辆牌号_check = 0
      this.searchFrom.司机姓名 !== null && this.searchFrom.司机姓名 !== '' ? this.searchFrom.司机姓名_check = 1 : this.searchFrom.司机姓名_check = 0
      this.searchFrom.司机电话 !== null && this.searchFrom.司机电话 !== '' ? this.searchFrom.司机电话_check = 1 : this.searchFrom.司机电话_check = 0
      this.searchFrom.制单人 !== null && this.searchFrom.制单人 !== '' ? this.searchFrom.制单人_check = 1 : this.searchFrom.制单人_check = 0
      this.searchFrom.核准人 !== null && this.searchFrom.核准人 !== '' ? this.searchFrom.核准人_check = 1 : this.searchFrom.核准人_check = 0
      this.searchFrom.执行人 !== null && this.searchFrom.执行人 !== '' ? this.searchFrom.执行人_check = 1 : this.searchFrom.执行人_check = 0
      this.searchFrom.开始制单日期 !== null && this.searchFrom.开始制单日期 !== '' ? this.searchFrom.开始制单日期_check = 1 : this.searchFrom.开始制单日期_check = 0
      this.searchFrom.结束制单日期 !== null && this.searchFrom.结束制单日期 !== '' ? this.searchFrom.结束制单日期_check = 1 : this.searchFrom.结束制单日期_check = 0
      this.searchFrom.开始核准日期 !== null && this.searchFrom.开始核准日期 !== '' ? this.searchFrom.开始核准日期_check = 1 : this.searchFrom.开始核准日期_check = 0
      this.searchFrom.结束核准日期 !== null && this.searchFrom.结束核准日期 !== '' ? this.searchFrom.结束核准日期_check = 1 : this.searchFrom.结束核准日期_check = 0
      this.searchFrom.开始发货日期 !== null && this.searchFrom.开始发货日期 !== '' ? this.searchFrom.开始发货日期_check = 1 : this.searchFrom.开始发货日期_check = 0
      this.searchFrom.结束发货日期 !== null && this.searchFrom.结束发货日期 !== '' ? this.searchFrom.结束发货日期_check = 1 : this.searchFrom.结束发货日期_check = 0
      this.listLoading = true
      InvoiceListSearch(this.searchFrom.发货单名, this.searchFrom.发货单号, this.searchFrom.收货单位, this.searchFrom.车辆牌号, this.searchFrom.司机姓名, this.searchFrom.司机电话, this.searchFrom.制单人, this.searchFrom.核准人, this.searchFrom.执行人, this.searchFrom.开始制单日期, this.searchFrom.结束制单日期, this.searchFrom.开始核准日期, this.searchFrom.结束核准日期, this.searchFrom.开始发货日期, this.searchFrom.结束发货日期, this.searchFrom.发货单名_check, this.searchFrom.发货单号_check, this.searchFrom.收货单位_check, this.searchFrom.车辆牌号_check, this.searchFrom.司机姓名_check, this.searchFrom.司机电话_check, this.searchFrom.制单人_check, this.searchFrom.核准人_check, this.searchFrom.执行人_check, this.searchFrom.开始制单日期_check, this.searchFrom.结束制单日期_check, this.searchFrom.开始核准日期_check, this.searchFrom.结束核准日期_check, this.searchFrom.开始发货日期_check, this.searchFrom.结束发货日期_check, this.DeliveryStatusValue_check, this.DeliveryStatusValue, this.pageCurrent, this.pageSize).then(response => {
        if (response.data.rows.length !== 0) {
          this.listLoading = false
          this.tableDataSearchList = response.data.rows
          this.total = response.data.total
        }
      })
    },
    handleSizeChange(val) {
      this.pageCurrent = 1
      this.pageSize = val
      this.search()
    },
    handleCurrentChange(val) {
      this.pageCurrent = val
      this.search()
    },
    openDialogFormVisible(row) {
      this.addForm('invoiceFrom')
      row.是否发出.toString() === '1' ? this.disabled = true : this.disabled = false
      row.是否发出.toString() === '1' ? this.disabledDetailsDelete = false : this.disabledDetailsDelete = true
      this.invoiceFrom.发货单号 = row.发货单编号
      this.invoiceFrom.收货地址 = row.收货地址
      this.invoiceFrom.收货单位 = row.收货单位
      this.invoiceFrom.发货单名 = row.发货单名称
      this.invoiceFrom.注意事项 = row.注意事项
      this.invoiceFrom.车辆牌号 = row.车辆牌号
      this.invoiceFrom.司机姓名 = row.司机姓名
      this.invoiceFrom.司机电话 = row.司机电话
      this.invoiceFrom.收货人员 = row.收货人员
      this.invoiceFrom.联系电话 = row.联系电话
      this.invoiceFrom.备注 = row.备注
      this.isMaker = row.制单人
      this.isDelive = row.执行人
      this.isExamine = row.审核人
      this.MakerTime = row.操作日期
      this.ExamineTime = row.审核日期
      this.DeliveTime = row.发出时间
      this.invoiceNum = row.发货单流水号
      this.dialogFormVisible = true
      DetailsFeach(this.invoiceNum).then(response => {
        this.tableDataDelivery = response.data
      })
    },
    confirmation(formName) {
      this.invoiceFrom.司机姓名 === null ? this.invoiceFrom.司机姓名 = '' : this.invoiceFrom.司机姓名
      this.invoiceFrom.司机电话 === null ? this.invoiceFrom.司机电话 = '' : this.invoiceFrom.司机电话
      this.invoiceFrom.车辆牌号 === null ? this.invoiceFrom.车辆牌号 = '' : this.invoiceFrom.车辆牌号
      this.invoiceFrom.备注 === null ? this.invoiceFrom.备注 = '' : this.invoiceFrom.备注
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.$confirm('请确认货物是否全部发出, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            confirmation(this.invoiceNum, this.invoiceFrom.司机姓名, this.invoiceFrom.司机电话, this.invoiceFrom.车辆牌号, this.name, this.invoiceFrom.备注).then(response => {
              if (response.data[0].result === '1') {
                this.$message.success('发货确认成功！')
                this.disabled = true
                this.disabledDetailsDelete = false
                DetailsFeach(this.invoiceNum).then(response => {
                  this.tableDataDelivery = response.data
                })
                this.search()
              } else {
                this.$message.error('发货确认失败！')
              }
            })
          })
        }
      })
    },
    wiverOfConfirmation() {
      this.$confirm('请确认货物是否全部发出, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        reconfirmation(this.invoiceNum).then(response => {
          if (response.data[0].result === '1') {
            this.$message.success('打回成功！')
            this.disabled = false
            this.disabledDetailsDelete = true
            DetailsFeach(this.invoiceNum).then(response => {
              this.tableDataDelivery = response.data
            })
            this.search()
          } else {
            this.$message.success('打回失败！')
          }
        })
      })
    }
  }
}
</script>

<style>
  .el-form-item{
    margin-bottom: 2px;
  }
</style>

<style scoped>
.text{
  font-size: 14px;
}

</style>
