123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- var request = getRequest();
- var doctor = APIService.userAgent.uid,
- reply = request.reply,
- status = request.status | '',
- patientName = '',
- startDate = '',
- endDate = '',
- totalCount = 0;
- $(function(){
- setTitle("续方咨询");
- getListData();
- bindEvents();
- });
- function getListData(isRefresh){
- var params = {
- doctor: doctor,
- reply: reply,
- status: status,
- type: 8,
- patientName: patientName,
- startTime: startDate,
- endTime: endDate
- }
- consultingAPI.getListCount({data: params}).then(function(res){
- if(res.status == 200){
- totalCount = res.total;
- if(isRefresh){
- $("#listTable").bootstrapTable('refresh');
- }
- var options = $.extend(consultingAPI.getListTableAjaxObj, {
- queryParams: queryParams,
- queryParamsType: "limit",
- pagination: true,
- paginationLoop: true,
- sidePagination: 'server',
- pageNumber: 1,
- pageSize: 10,
- responseHandler: function (res) {
- if(res.status == 200){
- return {
- rows: res.data,
- total: totalCount
- }
- }else{
- return {
- rows: [],
- total: totalCount
- }
- }
-
- },
- columns:[{
- field: 'patientName',
- title: '居民姓名'
- },{
- field: 'create_time',
- title: '咨询时间'
- },{
- field: 'status',
- title: '咨询状态',
- formatter: function(val, row, index){
- var text = "";
- if(val == 0){
- if(reply == 0){
- text = "待回复";
- }else{
- text = "进行中";
- }
- }else{
- text = "已结束";
- }
- return text;
- }
- },{
- field: '',
- title: '操作',
- formatter: function(val, row, index){
- return '<a class="c-12b7f5" href="prescription-main.html?sessionId='+row.session_id+'&patiCode='+row.patient+'&patiName='+row.patientName+'">查看</a>';
- }
- }]
- });
-
- $("#listTable").bootstrapTable(options);
- }
- })
- }
- function queryParams(param){
- return {
- page: param.offset/param.limit + 1,
- pagesize: param.limit,
- doctor: doctor,
- reply: reply,
- status: status,
- type: 8,
- patientName: patientName,
- startTime: startDate,
- endTime: endDate
- }
- }
- function bindEvents(){
- $(".n-tab").on('click', function(){
- if($(this).hasClass("active")){
- return false;
- }else{
- $(this).addClass("active");
- $(this).siblings().removeClass("active");
- var seDate = getStartEndDate($(this).attr("data-val"));
- startDate = seDate.startDate;
- endDate = seDate.endDate;
- $('#listTable').bootstrapTable('refreshOptions',{pageNumber:1});
- getListData(true);
- }
- });
- $("#searchName").on('keyup', function(e){
- if (e.which === 13) {
- var $input = $("#searchName"),
- text = $.trim($input.val());
- patientName = text;
- $('#listTable').bootstrapTable('refreshOptions',{pageNumber:1});
- getListData(true);
- }
- })
- $("#searchBtn").on('click', function(){
- var $input = $("#searchName"),
- text = $.trim($input.val());
- patientName = text;
- $('#listTable').bootstrapTable('refreshOptions',{pageNumber:1});
- getListData(true);
- });
- }
|