|
@@ -11,6 +11,20 @@ layui.config({
|
|
|
})
|
|
|
|
|
|
const initFrom = () => {
|
|
|
+ const $ = layui.jquery
|
|
|
+ let templet = '<option value="">直接选择</option>';
|
|
|
+ let codes = [{
|
|
|
+ "code" : "1",
|
|
|
+ "codeValue" : "定时任务"
|
|
|
+ }, {
|
|
|
+ "code" : "2",
|
|
|
+ "codeValue" : "拉取后立即发送"
|
|
|
+ }]
|
|
|
+ for (var i = 0; i < codes.length; i++) {
|
|
|
+ templet += `<option value="${codes[i].code}">${codes[i].codeValue}</option>`
|
|
|
+ }
|
|
|
+ $('select[name="smsType"]').empty().append(templet)
|
|
|
+
|
|
|
layui.api.one({
|
|
|
data: {
|
|
|
},
|
|
@@ -20,11 +34,16 @@ const initFrom = () => {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ layui.form.render()
|
|
|
}
|
|
|
|
|
|
const initClick = () => {
|
|
|
const $ = layui.jquery
|
|
|
layui.form.on('submit(formBtn)', (data) => {
|
|
|
+ if (!(data.field.smsType && data.field.smsType)) {
|
|
|
+ layui.layer.msg('请选择短信推送方式', {icon: 5})
|
|
|
+ return false
|
|
|
+ }
|
|
|
layui.api.update(data.field,
|
|
|
(json) => {
|
|
|
layui.customUtil.refush(json.code == layui.constants.SUCCESS_CODE, '提交成功', json.msg)
|
|
@@ -32,4 +51,9 @@ const initClick = () => {
|
|
|
)
|
|
|
return false
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
+ $('.brume-form').on('click', '#refresh', () => {
|
|
|
+ initFrom()
|
|
|
+ })
|
|
|
}
|