Files
park/public/assets/js/backend/yq/park/park.js
MeSHard b22d09bd39 init
2025-12-01 11:19:23 +08:00

94 lines
5.1 KiB
JavaScript

define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'yq/park/park/index' + location.search,
add_url: 'yq/park/park/add',
edit_url: 'yq/park/park/edit',
del_url: 'yq/park/park/del',
multi_url: 'yq/park/park/multi',
import_url: 'yq/park/park/import',
table: 'not_waybill_report',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
fixedColumns: true,
fixedRightNumber: 1,
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'reporter_id', title: __('Reporter_id')},
{field: 'reporter_name', title: __('Reporter_name'), operate: 'LIKE'},
// {field: 'has_mount', title: __('Has_mount'), searchList: {"0":__('无'),"1":__('有')}, formatter: Table.api.formatter.flag},
{field: 'tractor_license', title: __('Tractor_license'), operate: 'LIKE'},
{field: 'mount_license', title: __('Mount_license'), operate: 'LIKE'},
{field: 'phone_num', title: __('Phone_num'), operate: 'LIKE'},
{field: 'mission', title: __('Mission'), searchList: {"1":__('装货/卸货'),"2":__('维修/洗车/停车'),"3":__('常驻'),"4":__('维修'),"5":__('洗车'),"6":__('停车'),"7":__('检测'),"8":__('洗罐')}, formatter: Table.api.formatter.normal},
// {field: 'response_status', title: __('Response_status')},
// {field: 'feedback_status', title: __('Feedback_status')},
// {field: 'event_type', title: __('Event_type')},
// {field: 'transport_pic', title: __('Transport_pic'), operate: false, events: Table.api.events.images, formatter: Table.api.formatter.image},
// {field: 'tractor_pic', title: __('Tractor_pic'), operate: false, events: Table.api.events.images, formatter: Table.api.formatter.image},
// {field: 'driver_pic', title: __('Driver_pic'), operate: false, events: Table.api.events.images, formatter: Table.api.formatter.image},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'status', title: __('Status'), searchList: {"0":__('审核中'),"1":__('已通过'),"2":__('失败'),"3":__('需要重新上传证件'),"4":__('已重新上传证件'),}, formatter: Table.api.formatter.normal},
// {field: 'is_del', title: __('Is_del'), searchList: {"1":__('正常'),"2":__('禁用')}, formatter: Table.api.formatter.label},
// {field: 'cargo_category_id', title: __('Cargo_category_id')},
// {field: 'remark', title: __('Remark'), operate: 'LIKE'},
// {field: 'cargo_category_name', title: __('Cargo_category_name'), operate: 'LIKE'},
{field: 'apply_time', title: __('Apply_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'operate',
title: __('Operate'),
table: table,
events: Table.api.events.operate,
buttons: [
{
name: 'ajax',
text: __('审核'),
title: __('审核'),
classname: 'btn btn-info btn-xs btn-detail btn-dialog',
url: 'yq/park/park/check',
visible: function (row) {
if (row.status == 0){
return true
}
}
}],
formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
check: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});