<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="主表id" prop="pId">
        <el-input
          v-model="queryParams.pId"
          placeholder="请输入主表id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="原始id" prop="orgId">
        <el-input
          v-model="queryParams.orgId"
          placeholder="请输入原始id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="全局唯一流水YYMMNNNN" prop="orderNo">
        <el-input
          v-model="queryParams.orderNo"
          placeholder="请输入全局唯一流水YYMMNNNN"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="集装箱类型id，主表" prop="cntrId">
        <el-input
          v-model="queryParams.cntrId"
          placeholder="请输入集装箱类型id，主表"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="集装箱号" prop="cntrNo">
        <el-input
          v-model="queryParams.cntrNo"
          placeholder="请输入集装箱号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车队id，自动生成" prop="carcorPid">
        <el-input
          v-model="queryParams.carcorPid"
          placeholder="请输入车队id，自动生成"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车牌号" prop="carregNo">
        <el-input
          v-model="queryParams.carregNo"
          placeholder="请输入车牌号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="司机姓名" prop="driverName">
        <el-input
          v-model="queryParams.driverName"
          placeholder="请输入司机姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item
        label="司机电话"
        prop="
driverTel"
      >
        <el-input
          v-model="queryParams.driverTel"
          placeholder="请输入司机电话"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="派车提交时间" prop="planDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.planDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择派车提交时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="派车提交备注" prop="planRemarks">
        <el-input
          v-model="queryParams.planRemarks"
          placeholder="请输入派车提交备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="受理装车时间" prop="acceptDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.acceptDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择受理装车时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="司机受理备注" prop="acceptRemarks">
        <el-input
          v-model="queryParams.acceptRemarks"
          placeholder="请输入司机受理备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实际装车时间" prop="loadDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.loadDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择实际装车时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="司机装车备注" prop="loadRemarks">
        <el-input
          v-model="queryParams.loadRemarks"
          placeholder="请输入司机装车备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实际装卸货时间" prop="mdLoadDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.mdLoadDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择实际装卸货时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="实际装卸货备注" prop="mdLoadRemarks">
        <el-input
          v-model="queryParams.mdLoadRemarks"
          placeholder="请输入实际装卸货备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实际卸车时间" prop="unLoadDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.unLoadDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择实际卸车时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="实际卸车备注" prop="unLoadRemarks">
        <el-input
          v-model="queryParams.unLoadRemarks"
          placeholder="请输入实际卸车备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="回单时间" prop="waybillDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.waybillDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择回单时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="散货运输时损耗数" prop="goodsLossQty">
        <el-input
          v-model="queryParams.goodsLossQty"
          placeholder="请输入散货运输时损耗数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="散货运输时损耗率" prop="goodsLossrate">
        <el-input
          v-model="queryParams.goodsLossrate"
          placeholder="请输入散货运输时损耗率"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="散货运输时应付损耗金额" prop="goodsLossamtCr">
        <el-input
          v-model="queryParams.goodsLossamtCr"
          placeholder="请输入散货运输时应付损耗金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="散货运输时应收损耗金额" prop="goodsLossamtDr">
        <el-input
          v-model="queryParams.goodsLossamtDr"
          placeholder="请输入散货运输时应收损耗金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应收结算数，集装是1" prop="qtyDr">
        <el-input
          v-model="queryParams.qtyDr"
          placeholder="请输入应收结算数，集装是1"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应付结算数，集装是1" prop="qtyCr">
        <el-input
          v-model="queryParams.qtyCr"
          placeholder="请输入应付结算数，集装是1"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应收运价" prop="freightPriceDr">
        <el-input
          v-model="queryParams.freightPriceDr"
          placeholder="请输入应收运价"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应付运价" prop="freightPriceCr">
        <el-input
          v-model="queryParams.freightPriceCr"
          placeholder="请输入应付运价"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应收运费=qtydr*pricedr" prop="freightAmtDr">
        <el-input
          v-model="queryParams.freightAmtDr"
          placeholder="请输入应收运费=qtydr*pricedr"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应付运价" prop="freightAmtCr">
        <el-input
          v-model="queryParams.freightAmtCr"
          placeholder="请输入应付运价"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="trigger应收费用明细合计" prop="feeitemDr">
        <el-input
          v-model="queryParams.feeitemDr"
          placeholder="请输入trigger应收费用明细合计"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应收垫付备注" prop="feeitemDrRemarks">
        <el-input
          v-model="queryParams.feeitemDrRemarks"
          placeholder="请输入应收垫付备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="trigger应付费用明细合计" prop="feeitemCr">
        <el-input
          v-model="queryParams.feeitemCr"
          placeholder="请输入trigger应付费用明细合计"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应付垫付备注" prop="feeitemCrRemarks">
        <el-input
          v-model="queryParams.feeitemCrRemarks"
          placeholder="请输入应付垫付备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应收合计=运费 + 费用明细" prop="amtDr">
        <el-input
          v-model="queryParams.amtDr"
          placeholder="请输入应收合计=运费 + 费用明细"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应付合计=运费+费用明细" prop="amtCr">
        <el-input
          v-model="queryParams.amtCr"
          placeholder="请输入应付合计=运费+费用明细"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应收款账期" prop="dueDateDr">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.dueDateDr"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择应收款账期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="应付款账期" prop="dueDateCr">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.dueDateCr"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择应付款账期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="起始里程表数" prop="odometerFrom">
        <el-input
          v-model="queryParams.odometerFrom"
          placeholder="请输入起始里程表数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结束里程表数" prop="odometerEnd">
        <el-input
          v-model="queryParams.odometerEnd"
          placeholder="请输入结束里程表数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="空车里程数" prop="milesEmpty">
        <el-input
          v-model="queryParams.milesEmpty"
          placeholder="请输入空车里程数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="重车里程数" prop="milesLoad">
        <el-input
          v-model="queryParams.milesLoad"
          placeholder="请输入重车里程数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总里程表数" prop="miles">
        <el-input
          v-model="queryParams.miles"
          placeholder="请输入总里程表数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车队成本司机提成" prop="driverbonus">
        <el-input
          v-model="queryParams.driverbonus"
          placeholder="请输入车队成本司机提成"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车队成本路桥费" prop="costtoll">
        <el-input
          v-model="queryParams.costtoll"
          placeholder="请输入车队成本路桥费"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车队成本维修保养" prop="costmaintain">
        <el-input
          v-model="queryParams.costmaintain"
          placeholder="请输入车队成本维修保养"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车队成本其他费用" prop="costOth">
        <el-input
          v-model="queryParams.costOth"
          placeholder="请输入车队成本其他费用"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车队成本费用说明" prop="costRemarks">
        <el-input
          v-model="queryParams.costRemarks"
          placeholder="请输入车队成本费用说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准百公里油耗" prop="oilQtyper">
        <el-input
          v-model="queryParams.oilQtyper"
          placeholder="请输入标准百公里油耗"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第一次加油量" prop="oilQty1">
        <el-input
          v-model="queryParams.oilQty1"
          placeholder="请输入第一次加油量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第一次加油单价" prop="oilPrice1">
        <el-input
          v-model="queryParams.oilPrice1"
          placeholder="请输入第一次加油单价"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第一次加油金额" prop="oilAmt1">
        <el-input
          v-model="queryParams.oilAmt1"
          placeholder="请输入第一次加油金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第一次加油量" prop="oilQty2">
        <el-input
          v-model="queryParams.oilQty2"
          placeholder="请输入第一次加油量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第一次加油单价" prop="oilPrice2">
        <el-input
          v-model="queryParams.oilPrice2"
          placeholder="请输入第一次加油单价"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="第二次加油金额" prop="oilAmt2">
        <el-input
          v-model="queryParams.oilAmt2"
          placeholder="请输入第二次加油金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实际油耗量" prop="oilQty">
        <el-input
          v-model="queryParams.oilQty"
          placeholder="请输入实际油耗量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实际油耗单价" prop="oilPrice">
        <el-input
          v-model="queryParams.oilPrice"
          placeholder="请输入实际油耗单价"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成本实际油耗金额" prop="oilAmt">
        <el-input
          v-model="queryParams.oilAmt"
          placeholder="请输入成本实际油耗金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="节省油耗量" prop="oilQtyBlc">
        <el-input
          v-model="queryParams.oilQtyBlc"
          placeholder="请输入节省油耗量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="节省油耗金额" prop="oilAmtBlc">
        <el-input
          v-model="queryParams.oilAmtBlc"
          placeholder="请输入节省油耗金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单趟利润=amtdr-amtcr" prop="profit">
        <el-input
          v-model="queryParams.profit"
          placeholder="请输入单趟利润=amtdr-amtcr"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item
        label="是否需要给客户开发票(0不需要，1需要)"
        prop="invDrNeed"
      >
        <el-input
          v-model="queryParams.invDrNeed"
          placeholder="请输入是否需要给客户开发票(0不需要，1需要)"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="f发票已开t未开" prop="invDrStatus">
        <el-select
          v-model="queryParams.invDrStatus"
          placeholder="请选择f发票已开t未开"
          clearable
          size="small"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="税率" prop="invDrTaxrate">
        <el-input
          v-model="queryParams.invDrTaxrate"
          placeholder="请输入税率"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="税额" prop="invDrTaxamt">
        <el-input
          v-model="queryParams.invDrTaxamt"
          placeholder="请输入税额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开票日期" prop="invDrDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.invDrDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择开票日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="发票号" prop="invDrNo">
        <el-input
          v-model="queryParams.invDrNo"
          placeholder="请输入发票号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="对账T已对账F未对账" prop="accchkStaus">
        <el-input
          v-model="queryParams.accchkStaus"
          placeholder="请输入对账T已对账F未对账"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态(1新建，2暂存，6提交)" prop="billStatus">
        <el-select
          v-model="queryParams.billStatus"
          placeholder="请选择状态(1新建，2暂存，6提交)"
          clearable
          size="small"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item
        label="订单状态0新录入10车队安排20司机受理30提箱40装卸货50还卸柜子60费用确认70回单"
        prop="orderStatus"
      >
        <el-select
          v-model="queryParams.orderStatus"
          placeholder="请选择订单状态0新录入10车队安排20司机受理30提箱40装卸货50还卸柜子60费用确认70回单"
          clearable
          size="small"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="对账日期" prop="accchkDate">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.accchkDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择对账日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="应收结算金额" prop="stlAmtDr">
        <el-input
          v-model="queryParams.stlAmtDr"
          placeholder="请输入应收结算金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结算日期" prop="stlDateDr">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.stlDateDr"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择结算日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="应付结算金额" prop="stlAmtCr">
        <el-input
          v-model="queryParams.stlAmtCr"
          placeholder="请输入应付结算金额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结算日期" prop="stlDateCr">
        <el-date-picker
          clearable
          size="small"
          style="width: 200px"
          v-model="queryParams.stlDateCr"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择结算日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="备注" prop="remarks">
        <el-input
          v-model="queryParams.remarks"
          placeholder="请输入备注"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button
          type="cyan"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['fleet:ftmsorderbillscars:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['fleet:ftmsorderbillscars:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['fleet:ftmsorderbillscars:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['fleet:ftmsorderbillscars:export']"
          >导出</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="ftmsorderbillscarsList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="备注" align="center" prop="id" />
      <el-table-column label="主表id" align="center" prop="pId" />
      <el-table-column label="原始id" align="center" prop="orgId" />
      <el-table-column
        label="全局唯一流水YYMMNNNN"
        align="center"
        prop="orderNo"
      />
      <el-table-column
        label="集装箱类型id，主表"
        align="center"
        prop="cntrId"
      />
      <el-table-column label="集装箱号" align="center" prop="cntrNo" />
      <el-table-column
        label="车队id，自动生成"
        align="center"
        prop="carcorPid"
      />
      <el-table-column label="车牌号" align="center" prop="carregNo" />
      <el-table-column label="司机姓名" align="center" prop="driverName" />
      <el-table-column
        label="司机电话"
        align="center"
        prop="
driverTel"
      />
      <el-table-column
        label="派车提交时间"
        align="center"
        prop="planDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.planDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="派车提交备注" align="center" prop="planRemarks" />
      <el-table-column
        label="受理装车时间"
        align="center"
        prop="acceptDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.acceptDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="司机受理备注"
        align="center"
        prop="acceptRemarks"
      />
      <el-table-column
        label="实际装车时间"
        align="center"
        prop="loadDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.loadDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="司机装车备注" align="center" prop="loadRemarks" />
      <el-table-column
        label="实际装卸货时间"
        align="center"
        prop="mdLoadDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.mdLoadDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="实际装卸货备注"
        align="center"
        prop="mdLoadRemarks"
      />
      <el-table-column
        label="实际卸车时间"
        align="center"
        prop="unLoadDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.unLoadDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="实际卸车备注"
        align="center"
        prop="unLoadRemarks"
      />
      <el-table-column
        label="回单时间"
        align="center"
        prop="waybillDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.waybillDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="散货运输时损耗数"
        align="center"
        prop="goodsLossQty"
      />
      <el-table-column
        label="散货运输时损耗率"
        align="center"
        prop="goodsLossrate"
      />
      <el-table-column
        label="散货运输时应付损耗金额"
        align="center"
        prop="goodsLossamtCr"
      />
      <el-table-column
        label="散货运输时应收损耗金额"
        align="center"
        prop="goodsLossamtDr"
      />
      <el-table-column
        label="应收结算数，集装是1"
        align="center"
        prop="qtyDr"
      />
      <el-table-column
        label="应付结算数，集装是1"
        align="center"
        prop="qtyCr"
      />
      <el-table-column label="应收运价" align="center" prop="freightPriceDr" />
      <el-table-column label="应付运价" align="center" prop="freightPriceCr" />
      <el-table-column
        label="应收运费=qtydr*pricedr"
        align="center"
        prop="freightAmtDr"
      />
      <el-table-column label="应付运价" align="center" prop="freightAmtCr" />
      <el-table-column
        label="trigger应收费用明细合计"
        align="center"
        prop="feeitemDr"
      />
      <el-table-column
        label="应收垫付备注"
        align="center"
        prop="feeitemDrRemarks"
      />
      <el-table-column
        label="trigger应付费用明细合计"
        align="center"
        prop="feeitemCr"
      />
      <el-table-column
        label="应付垫付备注"
        align="center"
        prop="feeitemCrRemarks"
      />
      <el-table-column
        label="应收合计=运费 + 费用明细"
        align="center"
        prop="amtDr"
      />
      <el-table-column
        label="应付合计=运费+费用明细"
        align="center"
        prop="amtCr"
      />
      <el-table-column
        label="应收款账期"
        align="center"
        prop="dueDateDr"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dueDateDr, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="应付款账期"
        align="center"
        prop="dueDateCr"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dueDateCr, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="起始里程表数"
        align="center"
        prop="odometerFrom"
      />
      <el-table-column label="结束里程表数" align="center" prop="odometerEnd" />
      <el-table-column label="空车里程数" align="center" prop="milesEmpty" />
      <el-table-column label="重车里程数" align="center" prop="milesLoad" />
      <el-table-column label="总里程表数" align="center" prop="miles" />
      <el-table-column
        label="车队成本司机提成"
        align="center"
        prop="driverbonus"
      />
      <el-table-column label="车队成本路桥费" align="center" prop="costtoll" />
      <el-table-column
        label="车队成本维修保养"
        align="center"
        prop="costmaintain"
      />
      <el-table-column label="车队成本其他费用" align="center" prop="costOth" />
      <el-table-column
        label="车队成本费用说明"
        align="center"
        prop="costRemarks"
      />
      <el-table-column label="标准百公里油耗" align="center" prop="oilQtyper" />
      <el-table-column label="第一次加油量" align="center" prop="oilQty1" />
      <el-table-column label="第一次加油单价" align="center" prop="oilPrice1" />
      <el-table-column label="第一次加油金额" align="center" prop="oilAmt1" />
      <el-table-column label="第一次加油量" align="center" prop="oilQty2" />
      <el-table-column label="第一次加油单价" align="center" prop="oilPrice2" />
      <el-table-column label="第二次加油金额" align="center" prop="oilAmt2" />
      <el-table-column label="实际油耗量" align="center" prop="oilQty" />
      <el-table-column label="实际油耗单价" align="center" prop="oilPrice" />
      <el-table-column label="成本实际油耗金额" align="center" prop="oilAmt" />
      <el-table-column label="节省油耗量" align="center" prop="oilQtyBlc" />
      <el-table-column label="节省油耗金额" align="center" prop="oilAmtBlc" />
      <el-table-column
        label="单趟利润=amtdr-amtcr"
        align="center"
        prop="profit"
      />
      <el-table-column
        label="是否需要给客户开发票(0不需要，1需要)"
        align="center"
        prop="invDrNeed"
      />
      <el-table-column
        label="f发票已开t未开"
        align="center"
        prop="invDrStatus"
      />
      <el-table-column label="税率" align="center" prop="invDrTaxrate" />
      <el-table-column label="税额" align="center" prop="invDrTaxamt" />
      <el-table-column
        label="开票日期"
        align="center"
        prop="invDrDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.invDrDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="发票号" align="center" prop="invDrNo" />
      <el-table-column
        label="对账T已对账F未对账"
        align="center"
        prop="accchkStaus"
      />
      <el-table-column
        label="状态(1新建，2暂存，6提交)"
        align="center"
        prop="billStatus"
      />
      <el-table-column
        label="订单状态0新录入10车队安排20司机受理30提箱40装卸货50还卸柜子60费用确认70回单"
        align="center"
        prop="orderStatus"
      />
      <el-table-column
        label="对账日期"
        align="center"
        prop="accchkDate"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.accchkDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="应收结算金额" align="center" prop="stlAmtDr" />
      <el-table-column
        label="结算日期"
        align="center"
        prop="stlDateDr"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.stlDateDr, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="应付结算金额" align="center" prop="stlAmtCr" />
      <el-table-column
        label="结算日期"
        align="center"
        prop="stlDateCr"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.stlDateCr, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remarks" />
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['fleet:ftmsorderbillscars:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['fleet:ftmsorderbillscars:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改车队派车对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="主表id" prop="pId">
          <el-input v-model="form.pId" placeholder="请输入主表id" />
        </el-form-item>
        <el-form-item label="原始id" prop="orgId">
          <el-input v-model="form.orgId" placeholder="请输入原始id" />
        </el-form-item>
        <el-form-item label="全局唯一流水YYMMNNNN" prop="orderNo">
          <el-input
            v-model="form.orderNo"
            placeholder="请输入全局唯一流水YYMMNNNN"
          />
        </el-form-item>
        <el-form-item label="集装箱类型id，主表" prop="cntrId">
          <el-input
            v-model="form.cntrId"
            placeholder="请输入集装箱类型id，主表"
          />
        </el-form-item>
        <el-form-item label="集装箱号" prop="cntrNo">
          <el-input v-model="form.cntrNo" placeholder="请输入集装箱号" />
        </el-form-item>
        <el-form-item label="车队id，自动生成" prop="carcorPid">
          <el-input
            v-model="form.carcorPid"
            placeholder="请输入车队id，自动生成"
          />
        </el-form-item>
        <el-form-item label="车牌号" prop="carregNo">
          <el-input v-model="form.carregNo" placeholder="请输入车牌号" />
        </el-form-item>
        <el-form-item label="司机姓名" prop="driverName">
          <el-input v-model="form.driverName" placeholder="请输入司机姓名" />
        </el-form-item>
        <el-form-item
          label="司机电话"
          prop="
driverTel"
        >
          <el-input v-model="form.driverTel" placeholder="请输入司机电话" />
        </el-form-item>
        <el-form-item label="派车提交时间" prop="planDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.planDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择派车提交时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="派车提交备注" prop="planRemarks">
          <el-input
            v-model="form.planRemarks"
            placeholder="请输入派车提交备注"
          />
        </el-form-item>
        <el-form-item label="受理装车时间" prop="acceptDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.acceptDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择受理装车时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="司机受理备注" prop="acceptRemarks">
          <el-input
            v-model="form.acceptRemarks"
            placeholder="请输入司机受理备注"
          />
        </el-form-item>
        <el-form-item label="实际装车时间" prop="loadDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.loadDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择实际装车时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="司机装车备注" prop="loadRemarks">
          <el-input
            v-model="form.loadRemarks"
            placeholder="请输入司机装车备注"
          />
        </el-form-item>
        <el-form-item label="实际装卸货时间" prop="mdLoadDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.mdLoadDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择实际装卸货时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="实际装卸货备注" prop="mdLoadRemarks">
          <el-input
            v-model="form.mdLoadRemarks"
            placeholder="请输入实际装卸货备注"
          />
        </el-form-item>
        <el-form-item label="实际卸车时间" prop="unLoadDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.unLoadDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择实际卸车时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="实际卸车备注" prop="unLoadRemarks">
          <el-input
            v-model="form.unLoadRemarks"
            placeholder="请输入实际卸车备注"
          />
        </el-form-item>
        <el-form-item label="回单时间" prop="waybillDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.waybillDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择回单时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="散货运输时损耗数" prop="goodsLossQty">
          <el-input
            v-model="form.goodsLossQty"
            placeholder="请输入散货运输时损耗数"
          />
        </el-form-item>
        <el-form-item label="散货运输时损耗率" prop="goodsLossrate">
          <el-input
            v-model="form.goodsLossrate"
            placeholder="请输入散货运输时损耗率"
          />
        </el-form-item>
        <el-form-item label="散货运输时应付损耗金额" prop="goodsLossamtCr">
          <el-input
            v-model="form.goodsLossamtCr"
            placeholder="请输入散货运输时应付损耗金额"
          />
        </el-form-item>
        <el-form-item label="散货运输时应收损耗金额" prop="goodsLossamtDr">
          <el-input
            v-model="form.goodsLossamtDr"
            placeholder="请输入散货运输时应收损耗金额"
          />
        </el-form-item>
        <el-form-item label="应收结算数，集装是1" prop="qtyDr">
          <el-input
            v-model="form.qtyDr"
            placeholder="请输入应收结算数，集装是1"
          />
        </el-form-item>
        <el-form-item label="应付结算数，集装是1" prop="qtyCr">
          <el-input
            v-model="form.qtyCr"
            placeholder="请输入应付结算数，集装是1"
          />
        </el-form-item>
        <el-form-item label="应收运价" prop="freightPriceDr">
          <el-input
            v-model="form.freightPriceDr"
            placeholder="请输入应收运价"
          />
        </el-form-item>
        <el-form-item label="应付运价" prop="freightPriceCr">
          <el-input
            v-model="form.freightPriceCr"
            placeholder="请输入应付运价"
          />
        </el-form-item>
        <el-form-item label="应收运费=qtydr*pricedr" prop="freightAmtDr">
          <el-input
            v-model="form.freightAmtDr"
            placeholder="请输入应收运费=qtydr*pricedr"
          />
        </el-form-item>
        <el-form-item label="应付运价" prop="freightAmtCr">
          <el-input v-model="form.freightAmtCr" placeholder="请输入应付运价" />
        </el-form-item>
        <el-form-item label="trigger应收费用明细合计" prop="feeitemDr">
          <el-input
            v-model="form.feeitemDr"
            placeholder="请输入trigger应收费用明细合计"
          />
        </el-form-item>
        <el-form-item label="应收垫付备注" prop="feeitemDrRemarks">
          <el-input
            v-model="form.feeitemDrRemarks"
            placeholder="请输入应收垫付备注"
          />
        </el-form-item>
        <el-form-item label="trigger应付费用明细合计" prop="feeitemCr">
          <el-input
            v-model="form.feeitemCr"
            placeholder="请输入trigger应付费用明细合计"
          />
        </el-form-item>
        <el-form-item label="应付垫付备注" prop="feeitemCrRemarks">
          <el-input
            v-model="form.feeitemCrRemarks"
            placeholder="请输入应付垫付备注"
          />
        </el-form-item>
        <el-form-item label="应收合计=运费 + 费用明细" prop="amtDr">
          <el-input
            v-model="form.amtDr"
            placeholder="请输入应收合计=运费 + 费用明细"
          />
        </el-form-item>
        <el-form-item label="应付合计=运费+费用明细" prop="amtCr">
          <el-input
            v-model="form.amtCr"
            placeholder="请输入应付合计=运费+费用明细"
          />
        </el-form-item>
        <el-form-item label="应收款账期" prop="dueDateDr">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.dueDateDr"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择应收款账期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="应付款账期" prop="dueDateCr">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.dueDateCr"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择应付款账期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="起始里程表数" prop="odometerFrom">
          <el-input
            v-model="form.odometerFrom"
            placeholder="请输入起始里程表数"
          />
        </el-form-item>
        <el-form-item label="结束里程表数" prop="odometerEnd">
          <el-input
            v-model="form.odometerEnd"
            placeholder="请输入结束里程表数"
          />
        </el-form-item>
        <el-form-item label="空车里程数" prop="milesEmpty">
          <el-input v-model="form.milesEmpty" placeholder="请输入空车里程数" />
        </el-form-item>
        <el-form-item label="重车里程数" prop="milesLoad">
          <el-input v-model="form.milesLoad" placeholder="请输入重车里程数" />
        </el-form-item>
        <el-form-item label="总里程表数" prop="miles">
          <el-input v-model="form.miles" placeholder="请输入总里程表数" />
        </el-form-item>
        <el-form-item label="车队成本司机提成" prop="driverbonus">
          <el-input
            v-model="form.driverbonus"
            placeholder="请输入车队成本司机提成"
          />
        </el-form-item>
        <el-form-item label="车队成本路桥费" prop="costtoll">
          <el-input
            v-model="form.costtoll"
            placeholder="请输入车队成本路桥费"
          />
        </el-form-item>
        <el-form-item label="车队成本维修保养" prop="costmaintain">
          <el-input
            v-model="form.costmaintain"
            placeholder="请输入车队成本维修保养"
          />
        </el-form-item>
        <el-form-item label="车队成本其他费用" prop="costOth">
          <el-input
            v-model="form.costOth"
            placeholder="请输入车队成本其他费用"
          />
        </el-form-item>
        <el-form-item label="车队成本费用说明" prop="costRemarks">
          <el-input
            v-model="form.costRemarks"
            placeholder="请输入车队成本费用说明"
          />
        </el-form-item>
        <el-form-item label="标准百公里油耗" prop="oilQtyper">
          <el-input
            v-model="form.oilQtyper"
            placeholder="请输入标准百公里油耗"
          />
        </el-form-item>
        <el-form-item label="第一次加油量" prop="oilQty1">
          <el-input v-model="form.oilQty1" placeholder="请输入第一次加油量" />
        </el-form-item>
        <el-form-item label="第一次加油单价" prop="oilPrice1">
          <el-input
            v-model="form.oilPrice1"
            placeholder="请输入第一次加油单价"
          />
        </el-form-item>
        <el-form-item label="第一次加油金额" prop="oilAmt1">
          <el-input v-model="form.oilAmt1" placeholder="请输入第一次加油金额" />
        </el-form-item>
        <el-form-item label="第一次加油量" prop="oilQty2">
          <el-input v-model="form.oilQty2" placeholder="请输入第一次加油量" />
        </el-form-item>
        <el-form-item label="第一次加油单价" prop="oilPrice2">
          <el-input
            v-model="form.oilPrice2"
            placeholder="请输入第一次加油单价"
          />
        </el-form-item>
        <el-form-item label="第二次加油金额" prop="oilAmt2">
          <el-input v-model="form.oilAmt2" placeholder="请输入第二次加油金额" />
        </el-form-item>
        <el-form-item label="实际油耗量" prop="oilQty">
          <el-input v-model="form.oilQty" placeholder="请输入实际油耗量" />
        </el-form-item>
        <el-form-item label="实际油耗单价" prop="oilPrice">
          <el-input v-model="form.oilPrice" placeholder="请输入实际油耗单价" />
        </el-form-item>
        <el-form-item label="成本实际油耗金额" prop="oilAmt">
          <el-input
            v-model="form.oilAmt"
            placeholder="请输入成本实际油耗金额"
          />
        </el-form-item>
        <el-form-item label="节省油耗量" prop="oilQtyBlc">
          <el-input v-model="form.oilQtyBlc" placeholder="请输入节省油耗量" />
        </el-form-item>
        <el-form-item label="节省油耗金额" prop="oilAmtBlc">
          <el-input v-model="form.oilAmtBlc" placeholder="请输入节省油耗金额" />
        </el-form-item>
        <el-form-item label="单趟利润=amtdr-amtcr" prop="profit">
          <el-input
            v-model="form.profit"
            placeholder="请输入单趟利润=amtdr-amtcr"
          />
        </el-form-item>
        <el-form-item
          label="是否需要给客户开发票(0不需要，1需要)"
          prop="invDrNeed"
        >
          <el-input
            v-model="form.invDrNeed"
            placeholder="请输入是否需要给客户开发票(0不需要，1需要)"
          />
        </el-form-item>
        <el-form-item label="f发票已开t未开">
          <el-radio-group v-model="form.invDrStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="税率" prop="invDrTaxrate">
          <el-input v-model="form.invDrTaxrate" placeholder="请输入税率" />
        </el-form-item>
        <el-form-item label="税额" prop="invDrTaxamt">
          <el-input v-model="form.invDrTaxamt" placeholder="请输入税额" />
        </el-form-item>
        <el-form-item label="开票日期" prop="invDrDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.invDrDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择开票日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="发票号" prop="invDrNo">
          <el-input v-model="form.invDrNo" placeholder="请输入发票号" />
        </el-form-item>
        <el-form-item label="对账T已对账F未对账" prop="accchkStaus">
          <el-input
            v-model="form.accchkStaus"
            placeholder="请输入对账T已对账F未对账"
          />
        </el-form-item>
        <el-form-item label="状态(1新建，2暂存，6提交)">
          <el-radio-group v-model="form.billStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item
          label="订单状态0新录入10车队安排20司机受理30提箱40装卸货50还卸柜子60费用确认70回单"
        >
          <el-radio-group v-model="form.orderStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="对账日期" prop="accchkDate">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.accchkDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择对账日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="应收结算金额" prop="stlAmtDr">
          <el-input v-model="form.stlAmtDr" placeholder="请输入应收结算金额" />
        </el-form-item>
        <el-form-item label="结算日期" prop="stlDateDr">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.stlDateDr"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择结算日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="应付结算金额" prop="stlAmtCr">
          <el-input v-model="form.stlAmtCr" placeholder="请输入应付结算金额" />
        </el-form-item>
        <el-form-item label="结算日期" prop="stlDateCr">
          <el-date-picker
            clearable
            size="small"
            style="width: 200px"
            v-model="form.stlDateCr"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择结算日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="删除状态" prop="delFlag">
          <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listFtmsorderbillscars,
  getFtmsorderbillscars,
  delFtmsorderbillscars,
  addFtmsorderbillscars,
  updateFtmsorderbillscars,
  exportFtmsorderbillscars,
} from "@/api/fleet/ftmsorderbillscars";

export default {
  name: "Ftmsorderbillscars",
  components: {},
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 车队派车表格数据
      ftmsorderbillscarsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        pId: null,
        orgId: null,
        orderNo: null,
        cntrId: null,
        cntrNo: null,
        carcorPid: null,
        carregNo: null,
        driverName: null,

        driverTel: null,
        planDate: null,
        planRemarks: null,
        acceptDate: null,
        acceptRemarks: null,
        loadDate: null,
        loadRemarks: null,
        mdLoadDate: null,
        mdLoadRemarks: null,
        unLoadDate: null,
        unLoadRemarks: null,
        waybillDate: null,
        goodsLossQty: null,
        goodsLossrate: null,
        goodsLossamtCr: null,
        goodsLossamtDr: null,
        qtyDr: null,
        qtyCr: null,
        freightPriceDr: null,
        freightPriceCr: null,
        freightAmtDr: null,
        freightAmtCr: null,
        feeitemDr: null,
        feeitemDrRemarks: null,
        feeitemCr: null,
        feeitemCrRemarks: null,
        amtDr: null,
        amtCr: null,
        dueDateDr: null,
        dueDateCr: null,
        odometerFrom: null,
        odometerEnd: null,
        milesEmpty: null,
        milesLoad: null,
        miles: null,
        driverbonus: null,
        costtoll: null,
        costmaintain: null,
        costOth: null,
        costRemarks: null,
        oilQtyper: null,
        oilQty1: null,
        oilPrice1: null,
        oilAmt1: null,
        oilQty2: null,
        oilPrice2: null,
        oilAmt2: null,
        oilQty: null,
        oilPrice: null,
        oilAmt: null,
        oilQtyBlc: null,
        oilAmtBlc: null,
        profit: null,
        invDrNeed: null,
        invDrStatus: null,
        invDrTaxrate: null,
        invDrTaxamt: null,
        invDrDate: null,
        invDrNo: null,
        accchkStaus: null,
        billStatus: null,
        orderStatus: null,
        accchkDate: null,
        stlAmtDr: null,
        stlDateDr: null,
        stlAmtCr: null,
        stlDateCr: null,
        remarks: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询车队派车列表 */
    getList() {
      this.loading = true;
      listFtmsorderbillscars(this.queryParams).then((response) => {
        this.ftmsorderbillscarsList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        pId: null,
        orgId: null,
        orderNo: null,
        cntrId: null,
        cntrNo: null,
        carcorPid: null,
        carregNo: null,
        driverName: null,

        driverTel: null,
        planDate: null,
        planRemarks: null,
        acceptDate: null,
        acceptRemarks: null,
        loadDate: null,
        loadRemarks: null,
        mdLoadDate: null,
        mdLoadRemarks: null,
        unLoadDate: null,
        unLoadRemarks: null,
        waybillDate: null,
        goodsLossQty: null,
        goodsLossrate: null,
        goodsLossamtCr: null,
        goodsLossamtDr: null,
        qtyDr: null,
        qtyCr: null,
        freightPriceDr: null,
        freightPriceCr: null,
        freightAmtDr: null,
        freightAmtCr: null,
        feeitemDr: null,
        feeitemDrRemarks: null,
        feeitemCr: null,
        feeitemCrRemarks: null,
        amtDr: null,
        amtCr: null,
        dueDateDr: null,
        dueDateCr: null,
        odometerFrom: null,
        odometerEnd: null,
        milesEmpty: null,
        milesLoad: null,
        miles: null,
        driverbonus: null,
        costtoll: null,
        costmaintain: null,
        costOth: null,
        costRemarks: null,
        oilQtyper: null,
        oilQty1: null,
        oilPrice1: null,
        oilAmt1: null,
        oilQty2: null,
        oilPrice2: null,
        oilAmt2: null,
        oilQty: null,
        oilPrice: null,
        oilAmt: null,
        oilQtyBlc: null,
        oilAmtBlc: null,
        profit: null,
        invDrNeed: null,
        invDrStatus: "0",
        invDrTaxrate: null,
        invDrTaxamt: null,
        invDrDate: null,
        invDrNo: null,
        accchkStaus: null,
        billStatus: 0,
        orderStatus: 0,
        accchkDate: null,
        stlAmtDr: null,
        stlDateDr: null,
        stlAmtCr: null,
        stlDateCr: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remarks: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加车队派车";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getFtmsorderbillscars(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改车队派车";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updateFtmsorderbillscars(this.form).then((response) => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addFtmsorderbillscars(this.form).then((response) => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm(
        '是否确认删除车队派车编号为"' + ids + '"的数据项?',
        "警告",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(function () {
          return delFtmsorderbillscars(ids);
        })
        .then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        });
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm("是否确认导出所有车队派车数据项?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(function () {
          return exportFtmsorderbillscars(queryParams);
        })
        .then((response) => {
          this.download(response.msg);
        });
    },
  },
};
</script>
