Commit 1474e927 by 杨树贤

IQC检测查看权限设置

parent d7522e3d
......@@ -13,8 +13,19 @@ class SupplierExaminationFilter
public function listFilter($request)
{
$map = $request->all();
$canViewAllSupplierExamination = checkPerm('ViewAllSupplierExamination');
$name = $request->user->name;
$model = new SupplierExaminationModel();
$query = $model->orderBy('id', 'desc');
if ($canViewAllSupplierExamination) {
} else {
$query->where('purchase_name', $name);
}
if (!empty($map['supplier_name'])) {
$query->where('supplier_name', 'like', "%${map['supplier_name']}%");
}
......
<script>
layui.use(['table', 'form', 'element', 'table', 'layer', 'admin','xmSelect'], function () {
layui.use(['table', 'form', 'element', 'table', 'layer', 'admin', 'xmSelect'], function () {
let admin = layui.admin;
let form = layui.form;
let element = layui.element;
let xmSelect = layui.xmSelect;
form.on('submit(addSupplierExamination)', function (data) {
let url = '/api/supplier_examination/AddSupplierExamination';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
layer.confirm('是否确认新增IQC检测资料?', function (index) {
let url = '/api/supplier_examination/AddSupplierExamination';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
}
}
}
return false;
return false;
});
});
form.on('submit(cancel)', function (data) {
admin.closeThisDialog();
layer.confirm('是否退出新增IQC检测资料?', function (index) {
admin.closeThisDialog();
});
});
});
</script>
\ No newline at end of file
......@@ -6,19 +6,21 @@
let xmSelect = layui.xmSelect;
form.on('submit(addSupplierExamination)', function (data) {
let url = '/api/supplier_examination/UpdateSupplierExamination';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
layer.confirm('是否确认修改IQC检测资料s?', function (index) {
let url = '/api/supplier_examination/UpdateSupplierExamination';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
}
}
}
return false;
return false;
});
});
form.on('submit(cancel)', function (data) {
admin.closeThisDialog();
......
......@@ -35,12 +35,22 @@
</div>
<div style="margin-left: 20px;margin-right: 20px">
<div class="layui-btn-group demoTable" style="margin-top: 15px">
<button type="button" class="layui-btn layui-btn-sm" id="add_supplier_examination">新增</button>
<button type="button" class="layui-btn layui-btn-sm" id="update_supplier_examination">编辑</button>
<button type="button" class="layui-btn layui-btn-sm" id="import_supplier_examination">导入</button>
@if(checkPerm('AddSupplierExamination'))
<button type="button" class="layui-btn layui-btn-sm" id="add_supplier_examination">新增</button>
@endif
@if(checkPerm('UpdateSupplierExamination'))
<button type="button" class="layui-btn layui-btn-sm" id="update_supplier_examination">编辑</button>
@endif
@if(checkPerm('ImportSupplierExamination'))
<button type="button" class="layui-btn layui-btn-sm" id="import_supplier_examination">导入</button>
@endif
<a href="/data/import_supplier_examination_template.xlsx" target="_blank" class="layui-btn layui-btn-sm"
id="download_supplier_examination_import_template">下载模板</a>
<button type="button" class="layui-btn layui-btn-sm" id="delete_supplier_examination">删除</button>
@if(checkPerm('DeleteSupplierExamination'))
<button type="button" class="layui-btn layui-btn-sm" id="delete_supplier_examination">删除</button>
@endif
</div>
<table class="layui-table" id="supplierExaminationList" lay-filter="supplierExaminationList"></table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment