123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form','selectpage'], function ($, undefined, Backend, Table, Form,Selectpage) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'statistics/wechat/index' + location.search
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {field: 't', title: __('访问时间'),
- addclass: 'datetimepicker',
- data: 'data-date-format="YYYY-MM-DD" autocomplete="off"'},
- {field: 'institution_id', title: __('医院'),visible: false},
- {field: 'id', title: __('id'),visible: false,searchable:false},
- {field: 'institution_name', title: __('医院'),searchable:false},
- {field: 'c', title: __('微信访问数量'),searchable:false},
- {
- field: 'operate',
- export:false,
- title: __('Operate'),
- table: table,
- buttons: [
- {
- name : 'visitInfo',
- title : '查看详情',
- text : '查看详情',
- icon : 'fa fa-calendar-o',
- classname: 'btn btn-xs btn-info btn-dialog',
- url : 'statistics/wechat/visitList',
- extend : 'data-toggle="tooltip" data-area=\'["1100px","600px"]\'',
- }
- ],
- events: Table.api.events.operate,
- formatter: Table.api.formatter.operate,
- }
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- $.ajax({
- url: 'institution/institution/institutionSelectList',
- type: 'post',
- dataType: 'json',
- success: function success(res) {
- let data = res.rows;
- $('#institution_id').selectPage({
- data : data,
- orderBy: 'index'
- });
- }
- });
- },
- visitlist: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'statistics/wechat/visitLink',
- }
- });
- let table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- showToggle: false,
- showColumns: false,
- queryParams: function queryParams(params) {
- params.ins = $('input[name="institution_id"]').val();
- return params;
- },
- columns: [
- [
- {field: 'checkbox', checkbox: true},
- {field: 'name', title: __('姓名'), searchable: false},
- {field: 'patient_num', title: __('病历号'), searchable: false},
- {field: 'accession_num', title: __('检查号'), searchable: false},
- {field: 'phone', title: __('手机号'), searchable: false},
- {field: 'exam_class', title: __('检查类型')},
- {field: 'exam_datetime', title: __('检查时间')},
- {field: 'createdAt',title: __('查看时间'), addclass:'datetimerange',visible:false},
- // {field: 'source',title: __('访问来源'), searchable: false},
- ]
- ]
- });
- // $('.btn-manage').click(function (){
- // var admin_ids = Table.api.selectedids(table)
- // var exam_id = $('input[name="exam_id"]').val()
- // Fast.api.ajax({
- // url: 'train/exam/manageAdmins',
- // data: {
- // admin_ids: admin_ids,
- // ids: exam_id
- // }
- // }, function (data) {
- // table.bootstrapTable('refresh')
- // });
- // })
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|