lihai-oa/app/user/view/position/add.html

117 lines
3.9 KiB
HTML
Raw Normal View History

2023-10-24 15:17:16 +08:00
{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">岗位职称</h3>
{if condition="$id eq 0"}
<table class="layui-table">
<tr>
<td class="layui-td-gray">岗位名称<font>*</font></td>
<td>
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入岗位名称" lay-reqText="请输入岗位名称" class="layui-input">
</td>
<td class="layui-td-gray-3">岗位工时单价(元)<font>*</font></td>
<td>
<input type="text" name="work_price" lay-verify="required|number" placeholder="请输入岗位工时单价" lay-reqText="请输入岗位工时单价" autocomplete="off" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="3">
<input type="radio" name="status" value="1" title="正常" checked>
<input type="radio" name="status" value="0" title="禁用">
</td>
</tr>
<tr>
<td class="layui-td-gray">权限角色<font>*</font></td>
<td colspan="3">
{volist name="$group" id="v"}
<input type="checkbox" name="group_id[]" title="{$v.title}" value="{$v.id}" lay-skin="primary">
{/volist}
</td>
</tr>
<tr>
<td class="layui-td-gray">岗位备注</td>
<td colspan="3">
<textarea name="remark" placeholder="请输入岗位备注" class="layui-textarea"></textarea>
</td>
</tr>
</table>
{else/}
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">岗位名称<font>*</font></td>
<td>
<input type="text" name="title" value="{$detail.title}" lay-verify="required" autocomplete="off" placeholder="请输入岗位名称" lay-reqText="请输入岗位名称" class="layui-input">
</td>
<td class="layui-td-gray-3">岗位工时单价(元)<font>*</font></td>
<td>
<input type="text" name="work_price" value="{$detail.work_price}" lay-verify="required|number" placeholder="请输入岗位工时单价" lay-reqText="请输入岗位工时单价" autocomplete="off" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="3">
<input type="radio" name="status" value="1" title="正常" {eq name="$detail.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁止" {eq name="$detail.status" value="0"}checked{/eq}>
</td>
</tr>
<tr>
<td class="layui-td-gray">权限角色<font>*</font></td>
<td colspan="3">
{volist name="$group" id="v"}
<input type="checkbox" name="group_id[]" title="{$v.title}" value="{$v.id}" {eq name="$v.checked" value="1" }checked{/eq} lay-skin="primary">
{/volist}
</td>
</tr>
<tr>
<td class="layui-td-gray">岗位备注</td>
<td colspan="3">
<textarea name="remark" placeholder="请输入岗位备注" class="layui-textarea">{$detail.remark}</textarea>
</td>
</tr>
</table>
{/if}
<div class="py-3">
<input type="hidden" name="id" value="{$id}">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var form = layui.form,tool=layui.tool;
form.on('submit(webform)', function(data){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post("/user/position/add", data.field, callback);
return false;
});
//监听提交
form.on('submit(webform)', function(data){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/user/position/add", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->