/**
 * guoj
 * 2020.09.28
 * 预约登记
    */
    import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE,UPCLOUD_RDC_TMS_BUSINESS_SERVICE,UPCLOUD_RDC_TMS_INTERFACE_SERVICE} from '@/config/serviceSettings.js';
    import { getSelectGJ, querySysPicture } from '@/utils/prolog.ajax.js';
export default () => {
  // 获取默认时间
  var startTime = Prolog.formatDate(new Date(), "%YY-%MM") + "-01 00:00:00";
  var endTime = Prolog.formatDate(new Date()) + " 23:59:59";
  let gridAddTop, gridBottom;
  // 司机table
  var driverTable = {
    // terrace显示全部，card分页显示
    skin: "card",
    // renderer:"grid",
    columns: [
      { id: "driverId", name: "id", type: "ro", width: "130", hidden: true },
      { id: "driverId", name: "司机编号", type: "ro" },
      { id: "driverName", name: "司机名称", type: "ro" },
      { id: "vehicleNo", name: "车辆", type: "ro" },
      { id: "vehicleName", name: "车辆名称", type: "ro", hidden: true }
    ],
    multiselect: false,

    url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE+"/tBaseBranchDriver/queryAppointDriver",
    pagebar: { type: "simple" },
    type: "post", // 数据提交方式，默认为get
    params: "{}", // 查询提交参数，分页参数默认为pageNum,pageSize
    contentType: "application/json",
    page: true // 是否启用分页
  };
  // 车辆table
  var carrierVehicleTable = {
    // terrace显示全部，card分页显示
    skin: "card",
    // renderer:"grid",
    columns: [
      { id: "vehicleNo", name: "id", type: "ro", width: "130", hidden: true },
      { id: "vehicleNo", name: "车辆编号", type: "ro" },
      { id: "vehicleName", name: "车辆名称", type: "ro" },
      { id: "mainDriverId", name: "司机编号", type: "ro", hidden: true },
      { id: "mainDriverName", name: "司机", type: "ro" }
    ],
    multiselect: false,

    url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE+"/tBaseBranchVehicle/queryAppointVehicle",
    pagebar: { type: "simple" },
    type: "post", // 数据提交方式，默认为get
    params: "{}", // 查询提交参数，分页参数默认为pageNum,pageSize
    contentType: "application/json",
    page: true // 是否启用分页
  };
  var grid;
  //配送中心table
  var userTable = {
    columns: [
      { id: "companyid", name: "id", type: "ro", width: "130", hidden: true },
      { id: "companycode", name: "配送中心编号", type: "ro" },
      { id: "companyname", name: "配送中心名称", type: "ro" }
    ],
    multiselect: false,
    pagebar: { type: "simple" },

    url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE+"/pubCompany/queryCompanyBranch", //数据接口
    type: "post", //数据提交方式，默认为get
    contentType: "application/json",
    params: JSON.stringify({ "companytype": "S" }), //查询提交参数，分页参数默认为pageNum,pageSize
    page: true, //是否启用分页
    totalCount: "totalCount" //总记录数字段，默认totalCount
  };
  let dataSelete;

  //获取下拉框
  getSelectGJ([{ "objectcode": "APPOINT_TIME" }, { "objectcode": "URG_FLG" }, { "objectcode": "ITEM_TYPE" }], function (data) {
    dataSelete = data.data;
    dataSelete.APPOINT_TIME.unshift({ "text": "", "value": "" });
    dataSelete.URG_FLG.unshift({ "text": "", "value": "" });
  });
  var opts = {
    //terrace显示全部，card分页显示
    skin: "card",
    //renderer:"grid",
    columns: [
      { id: "shipbillid", name: "id", type: "ro", width: "100", hidden: true },
      { id: "branchname", name: "配送中心", type: "ro", width: 150 },
      { id: "consignorname", name: "货主", type: "ro", width: 150 },
      { id: "shipbillno", name: "运单号", type: "ro", width: 100 },
      { id: "billtypeName", name: "运单类型", type: "ro", width: 100 },
      { id: "linenane", name: "线路名称", type: "ro", width: 100 },
      { id: "billdate", name: "单据日期", type: "ro", width: 130 },
      { id: "urgentIdentifyName", name: "是否急单", type: "ro", width: 100 },
      { id: "refbillno", name: "业务单号", type: "ro", width: 100 },
      { id: "refbilltypeName", name: "业务类型", type: "ro", width: 120 },
      { id: "carrierName", name: "承运商", type: "ro", width: 100 },
      { id: "shiptoCustomerName", name: "客户名称", type: "ro", width: 130 },
      { id: "shiptoAddress", name: "客户地址", type: "ro", width: 100 },
      { id: "reqshipmentdate", name: "预计发货日期", type: "ro", width: 130 },
      { id: "reqarrivvaldate", name: "预计到货日期", type: "ro", width: 130 },
      { id: "rsumcases", name: "件数", type: "ro", width: 100 },
      { id: "rsumgoodsweight", name: "重量", type: "ro", width: 100 },
      { id: "rsumgoodsvol", name: "体积", type: "ro", width: 100 },
      { id: "memo", name: "备注", type: "ro", width: 100 }
    ],
    multiselect: true,
    toolbar: [
      { type: "settings", labelWidth: 90, labelAlign: "right" },
      {
        type: "row",
        list: [
          { type: "calendar", readonly: true, className: "layui-col-md3", name: "startTime", label: "开始时间:", value: startTime },
          { type: "calendar", readonly: true, className: "layui-col-md3", name: "endTime", label: "结束时间:", value: endTime },
          {
            className: "layui-col-md3",
            type: "selectTable",
            placeholder: "请选择配送中心",
            readonly: false,
            table: userTable,
            tableWidth: 500,
            tableHeight: 400,
            fieldText: "companyname",
            fieldValue: "companyid",
            name: "branchidList",
            label: "配送中心:",
            listener: function () {
            }
          },
          { type: "input", name: "shipbillno", label: "运单号:", className: "layui-col-md3" },
          { type: "input", name: "refbillno", label: "业务单号:", className: "layui-col-md3" },
          { type: "combo", name: "urgentIdentify", label: "是否急单:", className: "layui-col-md3", options: dataSelete.URG_FLG },
          {
            type: "block", className: "layui-col-md3 form_btn_left",
            list: [
              { type: "button", className: "btn-normal", name: "querywork", value: "查询" },
              { type: "newcolumn" },
              { type: "button", name: "work_Reset", className: "normal", value: "重置" }
            ]
          },
          {
            type: "block", className: "layui-col-md3 right",
            list: [
              { type: "button", name: "clearApp", className: "btn-normal", value: "预约登记" }
            ]
          }
        ]
      }],

    url: UPCLOUD_RDC_TMS_BUSINESS_SERVICE+"/appoint/appointPlanConfirmQuery",//数据接口
    type: "post",//数据提交方式，默认为get
    contentType: "application/json",
    params: JSON.stringify({ startTime, endTime }),//查询提交参数，分页参数默认为pageNum,pageSize
    page: true, //是否启用分页
    totalCount: "totalCount" //总记录数字段，默认totalCount
  };
  //分页参数 pageSize pageNum
  grid = new PlgGrid(opts);
  grid.renderTo("appointmentRegister_guojzhuans2");
  grid.loadData();

  //单击事件
  grid.on("onRowSelect", function (id) {
    let item = grid.getRowData(id);
    gridBottom.setParams(JSON.stringify({ "shipbillid": id, "pageNum": "1", "pageSize": "10", "branchid": item.branchid }));
    gridBottom.reload();
  });
  //按钮添加方法
  grid.attachToolBarEvent("onButtonClick", function (name) {
    //查询
    if (name == "querywork") {
      var fdata = grid.getToolBarForm().getFormData();
      fdata.startTime = FormatDate(fdata.startTime) + " 00:00:00";
      fdata.endTime = Prolog.formatDate(fdata.endTime) + " 23:59:59";
      if (fdata.startTime > fdata.endTime) {
        layer.msg("开始时间不能大于结束时间");
        return false;
      }
      fdata.branchid = fdata.branchidList ? JSON.parse(fdata.branchidList)[0] : "";
      delete fdata.branchidList;
      grid.setParams(JSON.stringify(fdata));
      grid.reload();
      gridBottom.clearAll();
    }
    //重置
    if (name == "work_Reset") {
      grid.getToolBarForm().getDForm().setText("branchidList", "");
      grid.getToolBarForm().clear();
      grid.getToolBarForm().setFormData({ startTime: startTime, endTime: endTime });
    }
    //预约登记
    if (name == "clearApp") {
      var orders = grid.getCheckedIds();
      if (orders == null || orders == "") {
        orders = grid.getSelectedRowId();
      }
      let sunPcs = 0;
      let sunWigth = 0;
      let sunVolume = 0;
      let dataList = getDeleteAll(grid);
      if (dataList == "" || dataList == null) {
        return;
      }
      let customerSet = new Set();
      let coldBillNumber = 0;
      for (var i = 0; i < dataList.length; i++) {
        dataList[i] = grid.getRowData(dataList[i]);
        if (i != 0 && dataList[i].branchid != dataList[0].branchid) {
          layer.msg("仓库必须一致才可以预约");
          return;
        }
        if (i != 0 && dataList[i].carrierid != dataList[0].carrierid) {
          layer.msg("承运商必须一致才可以预约");
          return;
        }
        if (i != 0 && dataList[i].billtype != dataList[0].billtype) {
          layer.msg("运单类型必须一致才可以预约");
          return;
        }
        sunPcs = Prolog.floatOper(sunPcs, dataList[i].rsumcases, "+");
        sunWigth = Prolog.floatOper(sunWigth, dataList[i].rsumgoodsweight, "+");
        sunVolume = Prolog.floatOper(sunVolume, dataList[i].rsumgoodsvol, "+");
        customerSet.add(dataList[i].shiptoCustomerId);
        if (dataList[i].temperatureRequire !== "00") {
          coldBillNumber++;
        }
      }
      // let is00 = dataList.findIndex(item => item.temperatureRequire === "00");
      // let is01Or02 = dataList.findIndex(item => item.temperatureRequire === "01" || item.temperatureRequire === "02");
      // if (is00 > -1 && is01Or02 > -1) {
      //   layer.msg("常温的单据不能与冷藏、冷冻的单据同时预约登记");
      //   return;
      // }
      // 2021.04.09更新 不传vehicleType，改传branchId
      driverTable.params = JSON.stringify({ branchId: dataList[0].branchid });
      carrierVehicleTable.params = JSON.stringify({ branchId: dataList[0].branchid });
      // if (is00 > -1) {
      //   driverTable.params = JSON.stringify({ vehicleType: "01" });
      //   carrierVehicleTable.params = JSON.stringify({ vehicleType: "01" });
      // }
      // else {
      //   driverTable.params = JSON.stringify({ vehicleType: "02" });
      //   carrierVehicleTable.params = JSON.stringify({ vehicleType: "02" });
      // }

      setView("#appointmentRegister_div1");
      $("#appointmentRegister_div4").html("");
      setMethodAddTop();
      let formData = Object.assign({}, dataList[0], { orders: orders, shipmentNumber: sunPcs, shipmentWeight: sunWigth, shipmentVol: sunVolume, coldBillNumber, customerNumber: customerSet.size, customerCode: [...customerSet].join(","), orderNumber: dataList.length });
      gridAddTop.getToolBarForm().setFormData(formData);
      if (dataList.length <= 1) {
        for (var y = 0; y < 5; y++) {
          let id = Math.random();
          let addJson = {};
          if (y == 0) {
            addJson.appointPackage = sunPcs;
          }
          gridAddTop.addRow(id, addJson);
        }
      }
      else {
        let id = Math.random();
        gridAddTop.addRow(id, { appointPackage: sunPcs });
      }
    }

  });
  //跳转页面
  var carousel = layui.carousel;
  carousel.render({
    elem: "#appointmentRegister_div2",
    autoplay: false,
    index: 0,
    arrow: "none",
    indicator: "none",
    anim: "fade",
    width: "100%", //设置容器宽度
    height: "100%"
  });
  let viewList = ["#appointmentRegister_div1", "#appointmentRegister_div3"];
  function setView(name) {
    for (let i = 0; i < viewList.length; i++) {
      if (name == viewList[i]) {
        $(name).css("display", "block");
      }
      else {
        $(viewList[i]).css("display", "none");
      }
    }
  }
  //返回
  $(document).on("click", "#appointmentRegister_return", function () {
    setView("#appointmentRegister_div3");
  });
  //预约登记保存
  document.querySelector("#appointmentRegister_save").onclick = function () {
    //数据data
    var data = gridAddTop.getToolBarForm().getFormData();
    var feik = gridAddTop.getToolBarForm().validate();
    if (!feik) {
      return;
    }
    var length = gridAddTop.getGrid().getRowsNum();
    let dataList = [];
    let sumQTy = 0;
    for (var i = 0; i < length; i++) {
      let rd = gridAddTop.getRowData(gridAddTop.getRowId(i));
      if (rd.appointPackage != "" && rd.appointPackage != null) {
        sumQTy = Prolog.floatOper(sumQTy, rd.appointPackage, "+");
        if (!rd.appointDriver) {
          layer.msg("司机不能为空");
          return false;
        }
        if (!rd.appointDriverTel) {
          layer.msg("手机号不能为空");
          return false;
        }
        if (!rd.appointVehicleModel) {
          layer.msg("车型不能为空");
          return false;
        }
        if (!rd.vehicleNo) {
          layer.msg("车牌号不能为空");
          return false;
        }
        delete rd.appointDriveTck;
        delete rd.vehicleNod;
        dataList.push(rd);
      }
    }
    if (sumQTy != data.shipmentNumber) {
      layer.msg("输入件数总和必须与总件数一致");
      return;
    }

    let dataListH = getDeleteAll(grid);
    for (var y = 0; y < dataListH.length; y++) {
      dataListH[y] = grid.getRowData(dataListH[y]);
    }
    data.appointDate = FormatDate(data.appointDate);
    let ajaxItem = {
      driverList: dataList,
      shipbillList: dataListH,
      shipbillHVO: data
    };
    //调用ajax方法
    utilAjaxGJ(UPCLOUD_RDC_TMS_BUSINESS_SERVICE+"/appoint/appointPlanConfirm", "post", JSON.stringify(ajaxItem), function (data) {

      setView("#appointmentRegister_div3");
      grid.reload();
      gridBottom.clearAll();
    }, "application/json");
  };

  var optsBottom = {
    //terrace显示全部，card分页显示
    skin: "card",
    //renderer:"grid",
    columns: [
      { id: "lineid", name: "id", type: "ro", width: "100", hidden: true },
      { id: "shipbillno", name: "运单号", type: "ro" },
      { id: "itemno", name: "商品编号", type: "ro" },
      { id: "itemname", name: "商品名称", type: "ro" },
      {
        id: "itemtype", name: "商品类型", type: "ro", render: (v) => {
          return getSelectValue(dataSelete.ITEM_TYPE, v);
        }
      },
      { id: "pcs", name: "件数", type: "ro" },
      { id: "weight", name: "重量", type: "ro" },
      { id: "vol", name: "体积", type: "ro" },
      { id: "remark", name: "备注", type: "ro" }
    ],
    multiselect: false,

    url: UPCLOUD_RDC_TMS_BUSINESS_SERVICE+"/appoint/tmsShipbillDQuery",//数据接口
    type: "post",//数据提交方式，默认为get
    contentType: "application/json",
    params: "{}",//查询提交参数，分页参数默认为pageNum,pageSize
    page: false, //是否启用分页
    totalCount: "totalCount" //总记录数字段，默认totalCount
  };
  //分页参数 pageSize pageNum
  gridBottom = new PlgGrid(optsBottom);
  gridBottom.renderTo("appointmentRegister_guojzhuans2CP");
  var optsAddTop = {
    //terrace显示全部，card分页显示
    skin: "card",
    //renderer:"grid",
    columns: [
      { id: "shipbillid", name: "id", type: "ro", width: 100, hidden: true },
      { id: "appointDriverTel", name: "手机号", type: "ro", width: 200 }, // 2
      {
        width: 200,
        id: "appointDriveTck",
        type: "selectTable",
        placeholder: "请选择司机",
        readonly: false,
        table: driverTable,
        tableWidth: 600,
        tableHeight: 500,
        fieldText: "driverName",
        fieldValue: "driverId",
        name: "<span style='color:#096dd9;'>司机</span>",
        listener: {
          "afterSelect": function (state, selectId, grid) {
            var data = grid.getRowData(selectId);
            var rId = gridAddTop.getSelectedRowId();
            if (state) {
              gridAddTop.setCellValue(rId, 2, data.tel);
              gridAddTop.setCellValue(rId, 3, { text: data.driverName, value: data.driverId });
              gridAddTop.setCellValue(rId, 4, data.card);
              gridAddTop.setCellValue(rId, 5, data.vehicleSpecsName);
              gridAddTop.setCellValue(rId, 6, data.vehicleSpecsNo);
              gridAddTop.setCellValue(rId, 7, { text: data.vehicleNo, value: data.vehicleNo });
              gridAddTop.setCellValue(rId, 8, data.driverId);
              gridAddTop.setCellValue(rId, 9, data.driverName);
              gridAddTop.setCellValue(rId, 10, data.vehicleName);
              gridAddTop.setCellValue(rId, 11, data.vehicleNo);
              gridAddTop.setCellValue(rId, 13, data.branchId);
              gridAddTop.setCellValue(rId, 14, data.branchName);
              gridAddTop.setCellValue(rId, 15, data.maxPkg);
              gridAddTop.setCellValue(rId, 16, data.maxVol);
              gridAddTop.setCellValue(rId, 17, data.maxWeight);

            }
          }
        }
      },
      { id: "appointDriverCard", name: "身份证号", type: "ro", width: 200 }, // 4
      { id: "appointVehicleModelName", name: "车型", type: "ro", width: 200 }, // 5
      { id: "appointVehicleModel", name: "车型bh", type: "ro", hidden: true, width: 200 }, // 6
      {
        width: 200,
        id: "vehicleNod",
        type: "selectTable",
        placeholder: "请选择车辆",
        readonly: false,
        table: carrierVehicleTable,
        tableWidth: 600,
        tableHeight: 500,
        fieldText: "vehicleNo",
        fieldValue: "vehicleNo",
        name: "<span style='color:#096dd9;'>车辆</span>",
        listener: {
          "afterSelect": function (state, selectId, grid) {
            var data = grid.getRowData(selectId);
            var rId = gridAddTop.getSelectedRowId();
            if (state) {
              gridAddTop.setCellValue(rId, 2, data.tel);
              gridAddTop.setCellValue(rId, 3, { text: data.mainDriverName, value: data.mainDriverId });
              gridAddTop.setCellValue(rId, 4, data.card);
              gridAddTop.setCellValue(rId, 5, data.vehicleSpecsName);
              gridAddTop.setCellValue(rId, 6, data.vehicleSpecsNo);
              gridAddTop.setCellValue(rId, 7, { text: data.vehicleNo, value: data.vehicleNo });
              gridAddTop.setCellValue(rId, 8, data.mainDriverId);
              gridAddTop.setCellValue(rId, 9, data.mainDriverName);
              gridAddTop.setCellValue(rId, 10, data.vehicleName);
              gridAddTop.setCellValue(rId, 11, data.vehicleNo);
              gridAddTop.setCellValue(rId, 13, data.branchId);
              gridAddTop.setCellValue(rId, 14, data.branchName);
              gridAddTop.setCellValue(rId, 15, data.maxPkg);
              gridAddTop.setCellValue(rId, 16, data.maxVol);
              gridAddTop.setCellValue(rId, 17, data.maxWeight);
            }
          }
        }
      },
      { id: "appointDriver", name: "司机bh", type: "ro", hidden: true, width: 200 }, // 8
      { id: "appointDriverName", name: "司机mc", type: "ro", hidden: true, width: 200 }, // 9
      { id: "vehicleName", name: "车辆mc", type: "ro", hidden: true, width: 200 }, // 10
      { id: "vehicleNo", name: "车辆bh", type: "ro", hidden: true, width: 200 }, // 11
      { id: "appointPackage", name: "<span style='color:#096dd9;'>件数</span>", type: "ed", width: 200 }, // 12
      { id: "branchid", name: "仓编码", type: "ro", hidden: true, width: 200 }, // 13
      { id: "branchname", name: "仓名称", type: "ro", hidden: true, width: 200 }, // 14
      { id: "maxPkg", name: "maxPkg", type: "ro", hidden: true, width: 200 }, // 15
      { id: "maxVol", name: "maxVol", type: "ro", hidden: true, width: 200 }, // 16
      { id: "maxWeight", name: "maxWeight", type: "ro", hidden: true, width: 200 } // 17
    ],
    multiselect: false,
    toolbar: [
      { type: "settings", labelWidth: 90, labelAlign: "right" },
      {
        type: "row",
        list: [
          { type: "input", name: "carrierName", readonly: true, label: "承运商/供应商:", className: "layui-col-md3" },
          { type: "hidden", name: "carrierId", label: "承运商/供应商:" },
          { type: "hidden", name: "carrierCode", label: "承运商/供应商:" },
          { type: "hidden", name: "orderNumber", label: "运单数:" },
          { type: "hidden", name: "customerNumber", label: "客户数:" },
          { type: "hidden", name: "customerCode", label: "客户码:" },
          { type: "hidden", name: "coldBillNumber", label: "冷链运单数:" },
          { type: "input", name: "orders", readonly: true, label: "运单号:", className: "layui-col-md3" },
          { type: "input", name: "shipmentNumber", readonly: true, label: "总件数:", className: "layui-col-md3" },
          { type: "input", name: "shipmentWeight", readonly: true, label: "总重量:", className: "layui-col-md3" },
          { type: "input", name: "shipmentVol", readonly: true, label: "总体积:", className: "layui-col-md3" },
          { type: "calendar", className: "layui-col-md3", name: "appointDate", label: "预约提货日期:", required: true },
          { type: "combo", className: "layui-col-md3", name: "appointTime", label: "预约提货时间:", required: true, options: dataSelete.APPOINT_TIME },
          { type: "input", name: "remarks", label: "备注:", className: "layui-col-md3" }
        ]
      }],

    url: UPCLOUD_RDC_TMS_BUSINESS_SERVICE+"/appoint/appointPlanConfirmQuery",//数据接口
    type: "post",//数据提交方式，默认为get
    contentType: "application/json",
    params: "{}",//查询提交参数，分页参数默认为pageNum,pageSize
    page: true, //是否启用分页
    totalCount: "totalCount" //总记录数字段，默认totalCount
  };
  //分页参数 pageSize pageNum
  gridAddTop = new PlgGrid(optsAddTop);
  function setMethodAddTop() {
    gridAddTop.renderTo("appointmentRegister_div4");
    gridAddTop.getGrid().enableEditEvents(true, false, true);
    //离开事件
    gridAddTop.attachEvent("onEditCell", function (stage, rId, cInd, nValue) {

      // if (cInd === 3 && stage == 2) {
      //   let phoneValidate = /^1\d{10}$/;
      //   if (phoneValidate.test(nValue) && nValue !== oValue) {
      //     gridAddTop.setCellValue(rId, cInd, nValue);
      //   }
      //   if (nValue && !phoneValidate.test(nValue)) {
      //     layer.msg("请输入正确的手机号");
      //     return false;
      //   }
      //   if (nValue == false) {
      //     layer.msg("请输入正确的手机号");
      //     return false;
      //   }
      //   let data = getMxList({ tel: nValue }, rId);
      //   if (data == null) {
      //     layer.msg("请输入正确的手机号");
      //     return false;
      //   }
      // }
      if (stage == 2) {
        gridAddTop.setCellValue(rId, cInd, nValue);
      }
      return true;
    });
  }
  // function getMxList(data, rId) {
  //   let retData;
  //   utilSyncAjaxGJ(UPCLOUD_RDC_TMS_MAINDATA_SERVICE+"/driver/queryDriverVehicle", "post", JSON.stringify(data), (data) => {
  //     retData = data.data;
  //     data = data.data;
  //     if (data == null) {
  //       return retData;
  //     }
  //     gridAddTop.setCellValue(rId, 13, data.vehicleNo);
  //     gridAddTop.setCellValue(rId, 12, data.vehicleName);
  //     gridAddTop.setCellValue(rId, 11, data.driverName);
  //     gridAddTop.setCellValue(rId, 10, data.driverId);
  //     gridAddTop.setCellValue(rId, 9, { text: data.vehicleName, value: data.vehicleNo });
  //     gridAddTop.setCellValue(rId, 8, data.vehicleSpecs);
  //     gridAddTop.setCellValue(rId, 7, data.vehicleSpecsName);
  //     gridAddTop.setCellValue(rId, 6, data.vehicleSpecsName);
  //     gridAddTop.setCellValue(rId, 5, data.card);
  //     gridAddTop.setCellValue(rId, 4, { text: data.driverName, value: data.driverId });
  //     gridAddTop.setCellValue(rId, 3, data.tel);
  //   }, "application/json");
  //   return retData;
  // }
};
