Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
befd767b
authored
Jul 18, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改更新逻辑
parent
7d2f8a67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
25 deletions
app/Presenters/DatePresenter.php
resources/views/script/SupplierExaminationListScript.blade.php
resources/views/web/UpdateSupplierExamination.blade.php
app/Presenters/DatePresenter.php
View file @
befd767b
...
@@ -6,15 +6,20 @@ namespace App\Presenters;
...
@@ -6,15 +6,20 @@ namespace App\Presenters;
class
DatePresenter
class
DatePresenter
{
{
public
function
render
(
$name
,
$text
,
$value
)
public
function
render
(
$name
,
$text
,
$value
,
$option
=
[]
)
{
{
$isRequired
=
array_get
(
$option
,
'required'
,
false
);
$isDisable
=
array_get
(
$option
,
'disable'
)
===
true
?
'disabled'
:
''
;
$disableClass
=
$isDisable
?
'layui-disabled'
:
''
;
$requiredHtml
=
$isRequired
?
'<span class="require">*</span>'
:
""
;
$time
=
$value
;
$time
=
$value
;
return
<<<EOF
return
<<<EOF
<label class="layui-form-label">$text</label>
<label class="layui-form-label">
$requiredHtml
$text</label>
<div class="layui-input-inline">
<div class="layui-input-inline">
<input type="text" id="$name" name="$name"
<input type="text" id="$name" name="$name"
placeholder="请输入$text"
placeholder="请输入$text"
class="layui-input
"
class="layui-input
$disableClass" $isDisable
value="$time">
value="$time">
</div>
</div>
<script>
<script>
...
...
resources/views/script/SupplierExaminationListScript.blade.php
View file @
befd767b
...
@@ -11,6 +11,55 @@
...
@@ -11,6 +11,55 @@
let
whereCondition
=
initCondition
;
let
whereCondition
=
initCondition
;
let
type
=
'all'
;
let
type
=
'all'
;
$
(
document
).
on
(
"click"
,
".layui-table-body table.layui-table tbody tr"
,
function
()
{
let
index
=
$
(
this
).
attr
(
'data-index'
);
let
tableBox
=
$
(
this
).
parents
(
'.layui-table-box'
);
let
tableDiv
=
null
;
if
(
tableBox
.
find
(
".layui-table-fixed.layui-table-fixed-l"
).
length
>
0
)
{
tableDiv
=
tableBox
.
find
(
".layui-table-fixed.layui-table-fixed-l"
);
}
else
{
tableDiv
=
tableBox
.
find
(
".layui-table-body.layui-table-main"
);
}
let
checkCell
=
tableDiv
.
find
(
"tr[data-index="
+
index
+
"]"
).
find
(
"td div.laytable-cell-checkbox div.layui-form-checkbox I"
);
if
(
checkCell
.
length
>
0
)
{
checkCell
.
click
();
}
});
$
(
document
).
on
(
"click"
,
"td div.laytable-cell-checkbox div.layui-form-checkbox"
,
function
(
e
)
{
e
.
stopPropagation
();
});
//监听复选框事件,被选中的行高亮显示
table
.
on
(
'checkbox(supplierExaminationList)'
,
function
(
obj
)
{
//拉黑就不用变色了
if
(
obj
.
data
.
status
===
-
3
)
{
return
}
if
(
obj
.
checked
===
true
&&
obj
.
type
===
'all'
)
{
//点击全选,拉黑的不用选上
$
(
'.layui-table-body table.layui-table tbody tr:not(.block-class)'
).
addClass
(
'layui-table-click'
);
$
(
'.layui-table-body table.layui-table tbody'
).
find
(
'.block-class'
).
find
(
'.layui-form-checkbox'
).
remove
();
$
(
'.layui-table-body table.layui-table tbody tr .block-class'
).
addClass
(
'layui-table-click'
);
}
else
if
(
obj
.
checked
===
false
&&
obj
.
type
===
'all'
)
{
//点击全不选
$
(
'.layui-table-body table.layui-table tbody tr'
).
removeClass
(
'layui-table-click'
);
}
else
if
(
obj
.
checked
===
true
&&
obj
.
type
===
'one'
)
{
//点击单行
if
(
obj
.
checked
===
true
)
{
obj
.
tr
.
addClass
(
'layui-table-click'
);
}
else
{
obj
.
tr
.
removeClass
(
'layui-table-click'
);
}
}
else
if
(
obj
.
checked
===
false
&&
obj
.
type
===
'one'
)
{
//点击全选之后点击单行
if
(
obj
.
tr
.
hasClass
(
'layui-table-click'
))
{
obj
.
tr
.
removeClass
(
'layui-table-click'
);
}
}
});
let
cols
=
[
let
cols
=
[
{
type
:
'checkbox'
},
{
type
:
'checkbox'
},
{
field
:
'id'
,
title
:
'ID'
,
align
:
'center'
,
width
:
80
},
{
field
:
'id'
,
title
:
'ID'
,
align
:
'center'
,
width
:
80
},
...
...
resources/views/web/UpdateSupplierExamination.blade.php
View file @
befd767b
...
@@ -13,13 +13,13 @@
...
@@ -13,13 +13,13 @@
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
<input
type=
"hidden"
name=
"id"
value=
"{{$examination['id']}}"
>
<input
type=
"hidden"
name=
"id"
value=
"{{$examination['id']}}"
>
@inject('datePresenter','App\Presenters\DatePresenter')
@inject('datePresenter','App\Presenters\DatePresenter')
{!! $datePresenter->render('examine_time','检货时间 : ',$examination['examine_time']) !!}
{!! $datePresenter->render('examine_time','检货时间 : ',$examination['examine_time']
,['disable'=>true,'required'=>true]
) !!}
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
@if(empty($supplierName))
@if(empty($supplierName))
@inject('statusPresenter','App\Presenters\StatusPresenter')
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_name','采购员 : ',$examination['purchase_name'],
{!! $statusPresenter->render('purchase_name','采购员 : ',$examination['purchase_name'],
$purchaseUserNames,['required'=>true]) !!}
$purchaseUserNames,['required'=>true
,'disable'=>true
]) !!}
@else
@else
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
采购员 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
采购员 :
</label>
<div
class=
"layui-input-block"
style=
"padding-top: 7px"
>
<div
class=
"layui-input-block"
style=
"padding-top: 7px"
>
...
@@ -35,8 +35,8 @@
...
@@ -35,8 +35,8 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"supplier_name"
id=
"supplier_name"
<input
type=
"text"
name=
"supplier_name"
id=
"supplier_name"
placeholder=
"请输入供应商名称"
class=
"layui-input"
placeholder=
"请输入供应商名称"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['supplier_name'] or ''}}"
>
value=
"{{$examination['supplier_name'] or ''}}"
disabled
>
</div>
</div>
@else
@else
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
...
@@ -50,8 +50,8 @@
...
@@ -50,8 +50,8 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
数量 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
数量 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"amount"
id=
"amount"
<input
type=
"text"
name=
"amount"
id=
"amount"
placeholder=
"请填写数量(个)"
class=
"layui-input"
placeholder=
"请填写数量(个)"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['amount'] or ''}}"
>
value=
"{{$examination['amount'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -60,16 +60,16 @@
...
@@ -60,16 +60,16 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
品牌 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
品牌 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"brand_name"
id=
"brand_name"
<input
type=
"text"
name=
"brand_name"
id=
"brand_name"
placeholder=
"请填写品牌"
class=
"layui-input"
placeholder=
"请填写品牌"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['brand_name'] or ''}}"
>
value=
"{{$examination['brand_name'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
型号 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
型号 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"sku_name"
id=
"sku_name"
<input
type=
"text"
name=
"sku_name"
id=
"sku_name"
placeholder=
"请输入型号"
class=
"layui-input"
placeholder=
"请输入型号"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['sku_name'] or ''}}"
>
value=
"{{$examination['sku_name'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -78,16 +78,16 @@
...
@@ -78,16 +78,16 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
检测数量 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
检测数量 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"examine_amount"
id=
"examine_amount"
<input
type=
"text"
name=
"examine_amount"
id=
"examine_amount"
placeholder=
"请填写检测数量(个)"
class=
"layui-input"
placeholder=
"请填写检测数量(个)"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['examine_amount'] or ''}}"
>
value=
"{{$examination['examine_amount'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
不良数 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
不良数 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"unhealthy_amount"
id=
"unhealthy_amount"
<input
type=
"text"
name=
"unhealthy_amount"
id=
"unhealthy_amount"
placeholder=
"请填写不良数(个)"
class=
"layui-input"
placeholder=
"请填写不良数(个)"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['unhealthy_amount'] or ''}}"
>
value=
"{{$examination['unhealthy_amount'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -96,16 +96,16 @@
...
@@ -96,16 +96,16 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
不良现象 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
不良现象 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"unhealthy_content"
id=
"unhealthy_content"
<input
type=
"text"
name=
"unhealthy_content"
id=
"unhealthy_content"
placeholder=
"请填写不良现象"
class=
"layui-input"
placeholder=
"请填写不良现象"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['unhealthy_content'] or ''}}"
>
value=
"{{$examination['unhealthy_content'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
检验结果 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
检验结果 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"examine_result"
id=
"examine_result"
<input
type=
"text"
name=
"examine_result"
id=
"examine_result"
placeholder=
"请填写检验结果"
class=
"layui-input"
placeholder=
"请填写检验结果"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['examine_result'] or ''}}"
>
value=
"{{$examination['examine_result'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -119,8 +119,8 @@
...
@@ -119,8 +119,8 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
处理方式 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
处理方式 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"handle_way"
id=
"handle_way"
<input
type=
"text"
name=
"handle_way"
id=
"handle_way"
placeholder=
"请填写处理方式"
class=
"layui-input"
placeholder=
"请填写处理方式"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['handle_way'] or ''}}"
>
value=
"{{$examination['handle_way'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -128,8 +128,8 @@
...
@@ -128,8 +128,8 @@
<label
class=
"layui-form-label"
>
备注说明 :
</label>
<label
class=
"layui-form-label"
>
备注说明 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"remark"
id=
"remark"
<input
type=
"text"
name=
"remark"
id=
"remark"
placeholder=
"备注说明"
class=
"layui-input"
placeholder=
"备注说明"
class=
"layui-input
layui-disabled
"
value=
"{{$examination['remark'] or ''}}"
>
value=
"{{$examination['remark'] or ''}}"
disabled
>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment