父组件调用
<ag-grid :gridParameter="gridParameter" :searchText="searchInput"></ag-grid>
import agGrid from "@/components/AgGrid/index.vue";
components: {
agGrid,
gridParameter: {
style: {
//表格样式
height: "calc(100% - 165px)",
width: "100%",
columnDefs: [
headerName: "数据来源",
field: "sourceFrom",
width: 120,
headerName: "公司名称",
field: "companyname",
width: 150,
headerName: "网点名",
field: "netsite",
width: 100,
headerName: "车辆线路起点",
field: "bsite",
width: 120,
headerName: "车辆线路终点",
field: "esite",
width: 120,
headerName: "装车时间",
field: "loadingTime",
width: 100,
headerName: "实际发车时间",
field: "sendtime",
width: 120,
headerName: "车牌号",
field: "carnumber",
width: 100,
headerName: "挂车牌号",
field: "trailernumer",
width: 100,
headerName: "司机手机号",
field: "drivertel",
width: 100,
headerName: "装车件数",
field: "orderCount",
width: 100,
headerName: "总件数",
field: "qty",
width: 100,
headerName: "重量",
field: "weight",
width: 100,
headerName: "体积",
field: "vol",
width: 100,
headerName: "运输费合计",
field: "transfee",
width: 100,
headerName: "批次状态",
field: "batchState",
width: 100,
headerName: "托运单号",
field: "billNo",
width: 100,
headerName: "发车批次",
field: "batchNo",
width: 100,
headerName: "网点地址(省)",
field: "netProvince",
width: 150,
headerName: "网点地址(市)",
field: "netCity",
width: 150,
headerName: "网点地址(区)",
field: "netDistrict",
width: 150,
headerName: "到达时间",
field: "arrivedTime",
width: 100,
headerName: "实际运费",
field: "actualFreight",
width: 100,
headerName: "单车毛利",
field: "profit",
width: 100,
headerName: "现付运输费",
field: "handTransitFee",
width: 100,
headerName: "现付油卡费",
field: "handCardFee",
width: 100,
headerName: "回车运输费",
field: "retTransitFee",
width: 100,
headerName: "整车信息费",
field: "vehicleInfoFee",
width: 100,
headerName: "到付油卡费",
field: "payCardFee",
width: 100,
headerName: "车辆核载",
field: "vehicleBorne",
width: 100,
headerName: "原始单号",
field: "originalDocumentNumber",
width: 100,
headerName: "统一社会信用代码",
field: "socialCreditIdentifier",
width: 150,
headerName: "许可证编号",
field: "permitNumber",
width: 100,
headerName: "业务类型代码",
field: "businesstypeCode",
width: 120,
headerName: "发运实际日期",
field: "goodsReceiptdatetime",
width: 120,
headerName: "发货人",
field: "consignor",
width: 100,
headerName: "发货人个人证件号",
field: "rpersonalIdentity",
width: 150,
headerName: "发货方-国家行政区划代码",
field: "rcountrySubdivisioncode",
width: 180,
headerName: "收货人",
field: "consignee",
width: 100,
headerName: "收货方-国家行政区划代码",
field: "ecountrySubdivisioncode",
width: 180,
headerName: "牌照类型代码",
field: "licenseplatetypecode",
width: 120,
headerName: "车辆分类代码",
field: "vehicleClassificationCode",
width: 120,
headerName: "道路运输证号",
field: "roadtranscertnumber",
width: 120,
headerName: "所有人",
field: "owner",
width: 100,
headerName: "姓名",
field: "nameofperson",
width: 100,
headerName: "从业资格证号",
field: "quaCertNumber",
width: 100,
headerName: "货物名称",
field: "descriptionofgoods",
width: 100,
headerName: "货物类型分类代码",
field: "cargotypeClassCode",
width: 150,
isRowSelectable: function (rowNode) {
return rowNode.data ? rowNode.data.roleCode != "sysAdmin" : false;
defaultColDef: {
singleClickEdit: true,
editable: false, // 开启网格编辑功能
headerCheckboxSelection: function (params) {
var displayedColumns = params.columnApi.getAllDisplayedColumns();
var thisIsFirstColumn = displayedColumns[0] === params.column;
return thisIsFirstColumn;
checkboxSelection: function (params) {
var displayedColumns = params.columnApi.getAllDisplayedColumns();
var thisIsFirstColumn = displayedColumns[0] === params.column;
return thisIsFirstColumn;
// 后端数据
rowData: [],
gridOption:表格配置
columnDefs:表格列设置
rowData:表格数据