layui怎么给下拉框赋值_layui Ajax请求给下拉框赋值的实例

排课设置

content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">


查询内容

学期

列表状态

全部状态

申请中

确认申请

已经发布

已撤销

查询

查看

{{# if(d.status===2){ }}

推送

{{# } }}

{{# if(d.status===3){ }}

下载排课表

{{# } }}

{{# if(d.courseArrangeFlag===0){ }}

行政班排课

{{# } else { }}

走班排课

{{# } }}

{{# if(d.status===0){ }}

撤消申请

{{# } else if(d.status===1){ }}

申请中

{{# } else if(d.status===2){ }}

排课中

{{# } else if(d.status===3){ }}

已经推送

{{# } else if(d.status===4){ }}

已发布课程表

{{# } }}

layui.use(['table','layer'], function() {

var table = layui.table

,form = layui.form;

var $ = layui.jquery, layer = layui.layer;

var tableIns = table.render({

elem: '#infoTable'

,url: '/web/courseArrange/list'

,id: 'idTable'

,page: true

,limits: [10,20,50,100]

,limit: 10 //默认采用10

,cols: [[ //标题栏

{checkbox: true, fixed: true}

,{field: 'courseArrangeId', title: '序号', fixed: true}

,{field: 'schName', title: '学校名称'}

,{field: 'courseArrangeFlag', title: '排课类型', templet: '#courseArrangeFlag'}

,{field: 'termName', title: '学期'}

,{field: 'recordTime', title: '申请时间'}

,{field: 'status', title: '状态', templet: '#status'}

,{field: 'action', title: '操作', templet: '#action'}

]]

});

//监听管理操作

form.on('switch(schControlInput)', function(obj){

var normalValue

if(obj.elem.checked){

normalValue = '0';

}else{

normalValue = '1';

}

$.ajax({

url:'/school/editIsNormalSchool',

type:"POST",

dataType:"json",

data:{"schId":this.value, "statusValue":normalValue},

success:function(res){

location.reload();

},

});

});

// 监听Table工具条

table.on('tool(filterTable)', function(obj) {

var data = obj.data;

if (obj.event === 'view') {

location.href="courseArrangeView.html?id=" rel="external nofollow" +data.courseArrangeId+"&schId="+data.schId+"&areaId="+data.areaId;

}else if (obj.event === 'send') {

layer.open({

type: 2,

title: '导入并推送',

maxmin: true,

shadeClose: false, //点击遮罩关闭层

area : ['700px' , '600px'],

content: '/page/business/course/courseArrangeUpload.html?schId='+data.schId+'&areaId='+data.areaId+'&termId='+data.termId+'&courseArrangeFlag='+data.courseArrangeFlag+'&phone='+data.phone

,btn: '关闭'

,btnAlign: 'c' //按钮居中

,shade: 0 //不显示遮罩

,yes: function(){

layer.closeAll();

}

,end: function () {

location.reload();

}

});

}

});

form.on('submit(getSearch)', function(data){

table.reload('idTable', {

where: data.field

});

});

$(document).ready(function () {

$("select[name=termNm]").empty();

$.ajax({

async: false,

type: "POST",

url: "/web/courseArrange/termList",

dataType: "json",

data: {},

success: function (res) {

var opt = "全部";

$("select[name=termId]").append(opt);

for(var i=0; i

var option="

option += ">"+res.data[i].termName+"

"; //动态添加数据

$("select[name=termId]").append(option);

}

layui.form.render('select','boardFilter');

}

});

});

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值