更新审核机制

This commit is contained in:
yaooo 2023-11-18 14:22:17 +08:00
parent 4319b70ede
commit 5bf3d2ca1e
2 changed files with 6 additions and 9 deletions

View File

@ -13,7 +13,6 @@ class PositionCheck extends Validate
{
protected $rule = [
'title' => 'require|unique:position',
'work_price' => 'require|number',
'group_id' => 'require',
'id' => 'require'
];
@ -21,14 +20,12 @@ class PositionCheck extends Validate
protected $message = [
'title.require' => '岗位名称不能为空',
'title.unique' => '同样的岗位名称已经存在',
'work_price.require' => '岗位工时单价不能为空',
'work_price.number' => '岗位工时单价只能是整数',
'group_id.require' => '至少要选择一个角色权限',
'id.require' => '缺少更新条件',
];
protected $scene = [
'add' => ['title', 'work_price', 'group_id'],
'edit' => ['title', 'work_price', 'group_id', 'id'],
'add' => ['title', 'group_id'],
'edit' => ['title', 'group_id', 'id'],
];
}

View File

@ -10,9 +10,9 @@
<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 class="layui-td-gray-3">岗位工时单价(元)</td>
<td>
<input type="text" name="work_price" lay-verify="required|number" placeholder="请输入岗位工时单价" lay-reqText="请输入岗位工时单价" autocomplete="off" class="layui-input">
<input type="text" name="work_price" lay-verify="number" placeholder="请输入岗位工时单价" lay-reqText="请输入岗位工时单价" autocomplete="off" class="layui-input">
</td>
</tr>
<tr>
@ -44,9 +44,9 @@
<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 class="layui-td-gray-3">岗位工时单价(元)</td>
<td>
<input type="text" name="work_price" value="{$detail.work_price}" lay-verify="required|number" placeholder="请输入岗位工时单价" lay-reqText="请输入岗位工时单价" autocomplete="off" class="layui-input">
<input type="text" name="work_price" value="{$detail.work_price}" lay-verify="number" placeholder="请输入岗位工时单价" lay-reqText="请输入岗位工时单价" autocomplete="off" class="layui-input">
</td>
</tr>
<tr>