|
@@ -87,10 +87,10 @@
|
|
{/block}
|
|
{/block}
|
|
{block name='script'}
|
|
{block name='script'}
|
|
<script>
|
|
<script>
|
|
- var id={$id}, pid={$pid}, plan=<?=isset($plan) ? $plan : []?>;
|
|
|
|
|
|
+ var id={$id}, pid={$pid}, plan=<?php echo isset($plan) ? $plan : []?>;
|
|
var $ = layui.jquery;
|
|
var $ = layui.jquery;
|
|
var layer = layui.layer;
|
|
var layer = layui.layer;
|
|
- var coursechecked = {};
|
|
|
|
|
|
+ var coursechecked = <?php echo isset($coulist) ? $coulist : '{}'?>;
|
|
//加载列表
|
|
//加载列表
|
|
require(['vue','helper','zh-cn','request','plupload','aliyun-oss','OssUpload'],function(Vue,$h) {
|
|
require(['vue','helper','zh-cn','request','plupload','aliyun-oss','OssUpload'],function(Vue,$h) {
|
|
new Vue({
|
|
new Vue({
|
|
@@ -140,6 +140,7 @@
|
|
that.formData.courseids.push(i);
|
|
that.formData.courseids.push(i);
|
|
}
|
|
}
|
|
//console.log(that.courselist);
|
|
//console.log(that.courselist);
|
|
|
|
+ layer.close(index)
|
|
//return false;
|
|
//return false;
|
|
},
|
|
},
|
|
btn2: function (index, layero) {
|
|
btn2: function (index, layero) {
|
|
@@ -151,18 +152,6 @@
|
|
//location.reload();
|
|
//location.reload();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- // layList.tableList({o:'couList', done:function(){
|
|
|
|
-
|
|
|
|
- // }},
|
|
|
|
- // "{:Url('admin/special._special_type/list', ['special_type'=>3])}",
|
|
|
|
- // function (){
|
|
|
|
- // return [
|
|
|
|
- // {field: 'id', title: '排序', align: 'center'},
|
|
|
|
- // {field: 'title', title: '课程名称',align: 'left'},
|
|
|
|
-
|
|
|
|
- // ];
|
|
|
|
- // }
|
|
|
|
- // );
|
|
|
|
|
|
|
|
},
|
|
},
|
|
delitem:function (id){
|
|
delitem:function (id){
|
|
@@ -188,6 +177,7 @@
|
|
that.$nextTick(function () {
|
|
that.$nextTick(function () {
|
|
if (!that.formData.stepname) return layList.msg('请输入学习步骤名称');
|
|
if (!that.formData.stepname) return layList.msg('请输入学习步骤名称');
|
|
if (!that.formData.introduction) return layList.msg('请输入学习步骤介绍');
|
|
if (!that.formData.introduction) return layList.msg('请输入学习步骤介绍');
|
|
|
|
+ if (that.formData.courseids.length == 0) return layList.msg('没有选择如任何课程,至少选择一个课程');
|
|
layList.loadFFF();
|
|
layList.loadFFF();
|
|
layList.basePost(layList.U({a: 'savesteps', q: {id: id}}), that.formData, function (res) {
|
|
layList.basePost(layList.U({a: 'savesteps', q: {id: id}}), that.formData, function (res) {
|
|
layList.loadClear();
|
|
layList.loadClear();
|
|
@@ -234,6 +224,14 @@
|
|
layList.form.render();
|
|
layList.form.render();
|
|
|
|
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ if (coursechecked) {
|
|
|
|
+ for(i in coursechecked) {
|
|
|
|
+ that.courselist.push(coursechecked[i]);
|
|
|
|
+ that.formData.courseids.push(i);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|