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
e308f05d
authored
Jun 02, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-过期时间需求-20260521' into Dev
parents
d14ced8e
32ecbce7
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
299 additions
and
27 deletions
app/Http/Controllers/Api/SupplierAttachmentApiController.php
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/SupplierAttachmentController.php
app/Http/Services/DataService.php
app/Http/Services/SupplierAttachmentService.php
app/Http/Transformers/SupplierAttachmentTransformer.php
app/Http/Transformers/SupplierTransformer.php
app/Http/Validators/SupplierAttachmentValidator.php
app/Http/routes.php
resources/views/script/AddSupplierAttachmentScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/script/supplier/SupplierAttachmentScript.blade.php
resources/views/web/AddSupplierAttachment.blade.php
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
app/Http/Controllers/Api/SupplierAttachmentApiController.php
View file @
e308f05d
...
...
@@ -45,6 +45,7 @@ class SupplierAttachmentApiController extends Controller
}
$attachment
=
$request
->
only
([
'field_name'
,
'agency_brands'
,
'validity_type'
,
'validity_period'
,
'description'
,
...
...
@@ -82,6 +83,7 @@ class SupplierAttachmentApiController extends Controller
$attachment
=
$model
->
where
(
'attachment_id'
,
$attachmentId
)
->
first
()
->
toArray
();
$result
=
$model
->
where
(
'attachment_id'
,
$attachmentId
)
->
delete
();
if
(
$result
)
{
(
new
SupplierAttachmentService
())
->
syncSupplierAgencyBrands
(
$attachment
[
'supplier_id'
]);
$logService
=
new
LogService
();
$content
=
"删除附件信息 : "
.
$attachment
[
'type_name'
];
$remark
=
json_encode
(
$attachment
);
...
...
app/Http/Controllers/Filter/SupplierFilter.php
View file @
e308f05d
...
...
@@ -161,7 +161,7 @@ class SupplierFilter
if
((
isset
(
$map
[
'is_sku_expire'
])
&&
$map
[
'is_sku_expire'
]
===
"0"
)
||
!
empty
(
$map
[
'is_sku_expire'
]))
{
if
(
$map
[
'is_sku_expire'
]
==
1
)
{
$query
->
where
(
'sku_expired_in_days'
,
'>'
,
0
)
->
where
(
'uploaded_sku'
,
1
);
$query
->
where
(
'sku_expired_in_days'
,
'>'
,
0
)
->
where
(
'uploaded_sku'
,
1
)
->
where
(
'sku_expired_in_days'
,
'!='
,
1000
)
;
}
else
{
$query
->
where
(
'sku_expired_in_days'
,
0
);
}
...
...
app/Http/Controllers/SupplierAttachmentController.php
View file @
e308f05d
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers
;
use
App\Http\Services\RoleService
;
use
App\Http\Services\StandardBrandService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierStatisticsService
;
...
...
@@ -45,6 +46,9 @@ class SupplierAttachmentController extends Controller
//供应商详情
public
function
AddSupplierAttachment
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$agencyBrands
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'agency_brands'
);
$this
->
data
[
'agency_brand_init_value'
]
=
(
new
StandardBrandService
())
->
getBrandInitValue
(
$agencyBrands
);
$this
->
data
[
'title'
]
=
'添加附件'
;
return
$this
->
view
(
'添加附件'
);
}
...
...
@@ -57,8 +61,17 @@ class SupplierAttachmentController extends Controller
$model
=
new
SupplierAttachmentsModel
();
$attachment
=
$model
->
where
(
'attachment_id'
,
$attachmentId
)
->
first
()
->
toArray
();
$attachment
[
'validity_period'
]
=
$attachment
[
'validity_start'
]
?
date
(
'Y-m-d'
,
$attachment
[
'validity_start'
])
.
'~'
.
date
(
'Y-m-d'
,
$attachment
[
'validity_start'
])
:
''
;
$attachment
[
'validity_start'
])
.
'~'
.
date
(
'Y-m-d'
,
$attachment
[
'validity_end'
])
:
''
;
if
(
$attachment
[
'field_name'
]
==
'proxy_certificate'
&&
empty
(
$attachment
[
'agency_brands'
]))
{
$supplierAgencyBrands
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$attachment
[
'supplier_id'
])
->
value
(
'agency_brands'
);
$agencyBrandList
=
explode
(
','
,
trim
(
$supplierAgencyBrands
,
','
));
$firstAgencyBrand
=
trim
(
isset
(
$agencyBrandList
[
0
])
?
$agencyBrandList
[
0
]
:
''
);
$attachment
[
'agency_brands'
]
=
$firstAgencyBrand
?
(
$firstAgencyBrand
.
','
)
:
''
;
}
$this
->
data
[
'attachment'
]
=
$attachment
;
$this
->
data
[
'agency_brand_init_value'
]
=
(
new
StandardBrandService
())
->
getBrandInitValue
(
array_get
(
$attachment
,
'agency_brands'
,
''
));
}
else
{
$this
->
data
[
'agency_brand_init_value'
]
=
[];
}
$this
->
data
[
'title'
]
=
'修改附件'
;
$this
->
data
[
'view'
]
=
'AddSupplierAttachment'
;
...
...
@@ -67,4 +80,4 @@ class SupplierAttachmentController extends Controller
}
\ No newline at end of file
}
app/Http/Services/DataService.php
View file @
e308f05d
...
...
@@ -986,6 +986,94 @@ class DataService
SupplierChannelModel
::
where
(
'supplier_code'
,
'L0005670'
)
->
update
([
'group_code'
=>
'G003815'
]);
}
/**
* 历史修复:代理证附件补齐代理品牌,并同步汇总到supplier_channel.agency_brands
* @param bool $updateData true=执行更新 false=仅预览
* @param int $num 限制处理数量,0表示不限制
*/
public
static
function
initProxyCertificateAgencyBrands
(
$updateData
=
false
,
$num
=
0
)
{
ini_set
(
'memory_limit'
,
-
1
);
$supplierIds
=
SupplierAttachmentsModel
::
where
(
'field_name'
,
'proxy_certificate'
)
->
where
(
'agency_brands'
,
'!='
,
''
)
->
groupBy
(
'supplier_id'
)
->
pluck
(
'supplier_id'
)
->
toArray
();
if
(
$num
>
0
)
{
$supplierIds
=
array_slice
(
$supplierIds
,
0
,
$num
);
}
if
(
empty
(
$supplierIds
))
{
dump
(
'未找到代理证附件数据'
);
return
;
}
$updateAttachmentSupplierCount
=
0
;
$updateSupplierCount
=
0
;
foreach
(
$supplierIds
as
$supplierId
)
{
$supplierAgencyBrands
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'agency_brands'
);
$agencyBrandList
=
explode
(
','
,
trim
(
$supplierAgencyBrands
,
','
));
$firstAgencyBrand
=
trim
(
isset
(
$agencyBrandList
[
0
])
?
$agencyBrandList
[
0
]
:
''
);
$proxyAttachments
=
SupplierAttachmentsModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'field_name'
,
'proxy_certificate'
)
->
select
([
'attachment_id'
,
'agency_brands'
])
->
get
()
->
toArray
();
if
(
empty
(
$proxyAttachments
))
{
continue
;
}
$emptyAttachmentIds
=
[];
$agencyBrandIds
=
[];
foreach
(
$proxyAttachments
as
$attachment
)
{
$agencyBrands
=
trim
(
array_get
(
$attachment
,
'agency_brands'
,
''
),
','
);
if
(
$agencyBrands
===
''
)
{
if
(
$firstAgencyBrand
!==
''
)
{
$emptyAttachmentIds
[]
=
(
int
)
$attachment
[
'attachment_id'
];
$agencyBrands
=
$firstAgencyBrand
;
}
}
if
(
$agencyBrands
===
''
)
{
continue
;
}
$brandIds
=
explode
(
','
,
$agencyBrands
);
foreach
(
$brandIds
as
$brandId
)
{
$brandId
=
trim
(
$brandId
);
if
(
$brandId
!==
''
&&
!
in_array
(
$brandId
,
$agencyBrandIds
))
{
$agencyBrandIds
[]
=
$brandId
;
}
}
}
$targetSupplierAgencyBrands
=
$agencyBrandIds
?
implode
(
','
,
$agencyBrandIds
)
.
','
:
''
;
$needUpdateAttachment
=
!
empty
(
$emptyAttachmentIds
)
&&
$firstAgencyBrand
!==
''
;
$needUpdateSupplier
=
(
$targetSupplierAgencyBrands
!=
(
string
)
$supplierAgencyBrands
);
if
(
$needUpdateAttachment
||
$needUpdateSupplier
)
{
dump
(
'supplier_id='
.
$supplierId
.
' need_update_attachment='
.
(
$needUpdateAttachment
?
1
:
0
)
.
' need_update_supplier='
.
(
$needUpdateSupplier
?
1
:
0
));
}
if
(
$updateData
)
{
if
(
$needUpdateAttachment
)
{
SupplierAttachmentsModel
::
whereIn
(
'attachment_id'
,
$emptyAttachmentIds
)
->
update
([
'agency_brands'
=>
$firstAgencyBrand
.
','
,
'update_time'
=>
time
(),
]);
$updateAttachmentSupplierCount
++
;
}
if
(
$needUpdateSupplier
)
{
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'agency_brands'
=>
$targetSupplierAgencyBrands
,
'update_time'
=>
time
(),
]);
$updateSupplierCount
++
;
}
}
}
dump
(
'处理完成 supplier_count='
.
count
(
$supplierIds
)
.
' update_attachment_supplier_count='
.
$updateAttachmentSupplierCount
.
' update_supplier_count='
.
$updateSupplierCount
.
' update_mode='
.
(
$updateData
?
1
:
0
));
}
//重新初始化供应商的有效时间
public
static
function
reInitSupplierCpTime
()
...
...
app/Http/Services/SupplierAttachmentService.php
View file @
e308f05d
...
...
@@ -6,6 +6,7 @@ namespace App\Http\Services;
//后台用户相关信息服务
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\SupplierChannelModel
;
//用于判断是否已经查看的服务
class
SupplierAttachmentService
...
...
@@ -27,6 +28,9 @@ class SupplierAttachmentService
if
(
$attachment
[
'validity_type'
]
==
1
)
{
$attachment
[
'validity_start'
]
=
$attachment
[
'validity_end'
]
=
0
;
}
if
(
$attachment
[
'field_name'
]
!=
'proxy_certificate'
)
{
$attachment
[
'agency_brands'
]
=
''
;
}
$attachment
[
'type_name'
]
=
array_get
(
config
(
'fixed.FileNameMapping'
),
$attachment
[
'field_name'
]);
unset
(
$attachment
[
'validity_period'
]);
$attachmentId
=
$attachment
[
'attachment_id'
];
...
...
@@ -39,11 +43,57 @@ class SupplierAttachmentService
$attachment
[
'create_name'
]
=
request
()
->
user
->
name
;
$attachment
[
'create_time'
]
=
time
();
$attachmentModel
->
insertGetId
(
$attachment
);
$this
->
syncSupplierAgencyBrands
(
$attachment
[
'supplier_id'
]);
return
$attachment
[
'supplier_id'
];
}
else
{
$attachment
[
'update_time'
]
=
time
();
return
$attachmentModel
->
where
(
'attachment_id'
,
$attachmentId
)
->
update
(
$attachment
)
?
$attachment
[
'supplier_id'
]
:
0
;
$result
=
$attachmentModel
->
where
(
'attachment_id'
,
$attachmentId
)
->
update
(
$attachment
);
if
(
$result
)
{
$this
->
syncSupplierAgencyBrands
(
$attachment
[
'supplier_id'
]);
}
return
$result
?
$attachment
[
'supplier_id'
]
:
0
;
}
}
public
function
syncSupplierAgencyBrands
(
$supplierId
)
{
$supplierAgencyBrands
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'agency_brands'
);
$agencyBrandList
=
explode
(
','
,
trim
(
$supplierAgencyBrands
,
','
));
$firstAgencyBrand
=
trim
(
isset
(
$agencyBrandList
[
0
])
?
$agencyBrandList
[
0
]
:
''
);
if
(
$firstAgencyBrand
!==
''
)
{
SupplierAttachmentsModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'field_name'
,
'proxy_certificate'
)
->
where
(
function
(
$query
)
{
$query
->
whereNull
(
'agency_brands'
)
->
orWhere
(
'agency_brands'
,
''
);
})
->
update
([
'agency_brands'
=>
$firstAgencyBrand
.
','
,
'update_time'
=>
time
(),
]);
}
$proxyAttachments
=
SupplierAttachmentsModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'field_name'
,
'proxy_certificate'
)
->
pluck
(
'agency_brands'
)
->
toArray
();
$agencyBrandIds
=
[];
foreach
(
$proxyAttachments
as
$agencyBrands
)
{
if
(
!
trim
(
$agencyBrands
,
','
))
{
continue
;
}
$brandIds
=
explode
(
','
,
trim
(
$agencyBrands
,
','
));
foreach
(
$brandIds
as
$brandId
)
{
$brandId
=
trim
(
$brandId
);
if
(
$brandId
!==
''
&&
!
in_array
(
$brandId
,
$agencyBrandIds
))
{
$agencyBrandIds
[]
=
$brandId
;
}
}
}
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'agency_brands'
=>
$agencyBrandIds
?
implode
(
','
,
$agencyBrandIds
)
.
','
:
''
,
'update_time'
=>
time
(),
]);
}
//新增附件来源于新增页面,数据要转换
...
...
app/Http/Transformers/SupplierAttachmentTransformer.php
View file @
e308f05d
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Transformers
;
use
App\Http\Services\StandardBrandService
;
class
SupplierAttachmentTransformer
{
...
...
@@ -17,11 +18,19 @@ class SupplierAttachmentTransformer
if
(
!
$attachment
)
{
continue
;
}
$attachment
[
'agency_brand_names'
]
=
''
;
if
(
$attachment
[
'field_name'
]
==
'proxy_certificate'
&&
!
empty
(
$attachment
[
'agency_brands'
]))
{
$attachment
[
'agency_brand_names'
]
=
(
new
StandardBrandService
())
->
getStandardBrandNameListByBrandIds
(
$attachment
[
'agency_brands'
]);
}
$attachment
[
'is_expired'
]
=
0
;
if
(
$attachment
[
'validity_type'
]
==
1
)
{
$attachment
[
'validity_period'
]
=
'长期有效'
;
}
else
{
$attachment
[
'validity_period'
]
=
$attachment
[
'validity_start'
]
?
date
(
'Y-m-d'
,
$attachment
[
'validity_start'
])
.
'~'
.
date
(
'Y-m-d'
,
$attachment
[
'validity_end'
])
:
''
;
if
(
!
empty
(
$attachment
[
'validity_end'
])
&&
time
()
>
$attachment
[
'validity_end'
])
{
$attachment
[
'is_expired'
]
=
1
;
}
}
$attachment
[
'create_time'
]
=
$attachment
[
'create_time'
]
?
date
(
'Y-m-d H:i:s'
,
$attachment
[
'create_time'
])
:
''
;
...
...
@@ -30,4 +39,4 @@ class SupplierAttachmentTransformer
return
$list
;
}
}
\ No newline at end of file
}
app/Http/Transformers/SupplierTransformer.php
View file @
e308f05d
...
...
@@ -100,10 +100,17 @@ class SupplierTransformer
$supplier
[
'contact_num'
]
=
$this
->
getContactNum
(
$supplier
[
'supplier_id'
]);
$supplier
[
'has_sku'
]
=
$supplier
[
'sku_num'
]
?
'是'
:
'否'
;
$supplier
[
'is_business_abnormal_name'
]
=
$supplier
[
'is_business_abnormal'
]
==
1
?
'是'
:
'否'
;
$supplier
[
'has_attachment_expired'
]
=
0
;
if
(
isset
(
$supplier
[
'attachment'
]))
{
$supplier
[
'has_quality_assurance_agreement'
]
=
$this
->
checkHasSpecificAttachment
(
'quality_assurance_agreement'
,
$supplier
[
'attachment'
])
?
'有'
:
'无'
;
$supplier
[
'has_cooperation_agreement'
]
=
$this
->
checkHasSpecificAttachment
(
'cooperation_agreement'
,
$supplier
[
'attachment'
])
?
'有'
:
'无'
;
$supplier
[
'has_yunxin_agreement'
]
=
$this
->
checkHasSpecificAttachment
(
'yunxin_agreement'
,
$supplier
[
'attachment'
])
?
'有'
:
'无'
;
foreach
(
$supplier
[
'attachment'
]
as
$attachment
)
{
if
(
array_get
(
$attachment
,
'validity_type'
)
==
2
&&
!
empty
(
$attachment
[
'validity_end'
])
&&
time
()
>
$attachment
[
'validity_end'
])
{
$supplier
[
'has_attachment_expired'
]
=
1
;
break
;
}
}
}
else
{
$supplier
[
'has_quality_assurance_agreement'
]
=
'无'
;
}
...
...
app/Http/Validators/SupplierAttachmentValidator.php
View file @
e308f05d
...
...
@@ -4,7 +4,7 @@
namespace
App\Http\Validators
;
use
App\Model\SupplierChannelModel
;
use
Validator
;
use
Illuminate\Support\Facades\
Validator
;
class
SupplierAttachmentValidator
{
...
...
@@ -35,6 +35,10 @@ class SupplierAttachmentValidator
return
'供应商为混合分销商的时候,代理证的必须为自定义且必填'
;
}
if
(
$attachment
[
'field_name'
]
==
'proxy_certificate'
&&
empty
(
$attachment
[
'agency_brands'
]))
{
return
'附件类型为代理证时,代理品牌为必填'
;
}
if
(
$validator
->
fails
())
{
return
$validator
->
errors
()
->
first
();
}
...
...
@@ -51,4 +55,4 @@ class SupplierAttachmentValidator
'file_name.required'
=>
'文件名 不能为空'
,
];
}
}
\ No newline at end of file
}
app/Http/routes.php
View file @
e308f05d
...
...
@@ -104,11 +104,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
$isAdmin
=
request
()
->
user
->
userId
==
1000
?
true
:
false
;
if
(
!
$isAdmin
)
{
return
response
()
->
json
([
'code'
=>
403
,
'msg'
=>
'无权限'
]);
}
$supplierId
=
(
int
)
request
()
->
get
(
'supplier_id'
);
$result
=
(
new
DataService
())
->
clearSupplierData
(
$supplierId
);
return
response
()
->
json
(
$result
);
DataService
::
initProxyCertificateAgencyBrands
(
false
,
0
);
});
resources/views/script/AddSupplierAttachmentScript.blade.php
View file @
e308f05d
{
!!
Autograph
()
!!
}
<
script
>
layui
.
use
([
'form'
,
'upload'
,
'admin'
,
'laydate'
],
function
()
{
layui
.
use
([
'form'
,
'upload'
,
'admin'
,
'laydate'
,
'xmSelect'
],
function
()
{
const
form
=
layui
.
form
const
upload
=
layui
.
upload
;
const
admin
=
layui
.
admin
;
const
xmSelect
=
layui
.
xmSelect
;
function
getBrandOption
(
element
,
idName
=
'agency_brands'
)
{
return
{
el
:
'#'
+
element
,
filterable
:
true
,
paging
:
true
,
height
:
'250px'
,
size
:
'mini'
,
direction
:
'auto'
,
autoRow
:
true
,
prop
:
{
name
:
'brand_name'
,
value
:
'brand_id'
,
},
remoteSearch
:
true
,
pageRemote
:
true
,
template
({
item
,
})
{
return
item
.
brand_name
+
'<span style="position: absolute; right: 10px; color: #8799a3">'
+
item
.
mapping_brand_names
+
'</span>'
},
filterMethod
:
function
(
val
,
item
,
index
,
prop
)
{},
pageSize
:
30
,
remoteMethod
:
function
(
val
,
cb
,
show
,
pageIndex
)
{
$
.
ajax
({
url
:
'/api/common/getStandardBrandList'
,
type
:
'post'
,
data
:
{
brand_name
:
val
,
page
:
pageIndex
},
dataType
:
'json'
,
timeout
:
10000
,
success
:
function
(
res
)
{
if
(
!
res
)
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
if
(
res
.
err_code
===
0
)
{
cb
(
res
.
data
,
res
.
last_page
);
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
},
error
:
function
()
{
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
}
});
},
on
:
function
(
data
)
{
let
arr
=
data
.
arr
;
let
brandIds
=
''
;
for
(
let
i
in
arr
)
{
brandIds
+=
arr
[
i
]
.
brand_id
+
','
;
}
$
(
'#'
+
idName
)
.
val
(
brandIds
);
},
}
}
let
agencyBrandSelector
=
xmSelect
.
render
(
getBrandOption
(
'agency_brand_selector'
));
let
agencyBrandInitValue
=
{
!!
json_encode
(
isset
(
$agency_brand_init_value
)
?
$agency_brand_init_value
:
[])
!!
};
agencyBrandSelector
.
setValue
(
agencyBrandInitValue
);
function
toggleAgencyBrandsByField
(
fieldName
)
{
if
(
fieldName
===
'proxy_certificate'
)
{
$
(
'#agency_brands_div'
)
.
show
();
}
else
{
$
(
'#agency_brands_div'
)
.
hide
();
$
(
'#agency_brands'
)
.
val
(
''
);
agencyBrandSelector
.
setValue
([]);
}
}
toggleAgencyBrandsByField
(
$
(
'select[name="field_name"]'
)
.
val
());
form
.
on
(
'select(field_name)'
,
function
(
data
)
{
toggleAgencyBrandsByField
(
data
.
value
);
});
//提交数据
form
.
on
(
'submit(saveSupplierAttachment)'
,
function
(
data
)
{
if
(
data
.
field
.
field_name
===
'proxy_certificate'
&&
!
data
.
field
.
agency_brands
)
{
layer
.
msg
(
'附件类型为代理证时,代理品牌为必填'
,
{
icon
:
5
});
return
false
;
}
layer
.
confirm
(
'确定要保存附件信息吗?'
,
function
(
index
)
{
admin
.
showLoading
({
type
:
3
...
...
@@ -125,4 +206,4 @@
}
});
});
</
script
>
\ No newline at end of file
</
script
>
resources/views/script/SupplierListScript.blade.php
View file @
e308f05d
...
...
@@ -196,10 +196,14 @@
{
field
:
'supplier_name'
,
title
:
'供应商名称'
,
align
:
'left'
,
width
:
180
,
templet
:
function
(
data
)
{
let
supplierName
=
data
.
supplier_name
;
if
(
data
.
has_attachment_expired
===
1
)
{
supplierName
+=
"
<
i
class
=
'layui-icon layui-icon-notice'
style
=
'color: #FF5722;'
title
=
'存在已过期附件'
><
/i>"
;
}
if
(
data
.
status
===
-
3
)
{
return
"
<
span
title
=
'" + data.block_reason + "'
>
" +
data.supplier_n
ame + "
<
/span>
"
return
"
<
span
title
=
'" + data.block_reason + "'
>
" +
supplierN
ame + "
<
/span>
"
}
else
{
return
data
.
supplier_n
ame
;
return
supplierN
ame
;
}
}
},
...
...
resources/views/script/supplier/SupplierAttachmentScript.blade.php
View file @
e308f05d
...
...
@@ -36,8 +36,22 @@
return
"
<
a
style
=
'color: blue'
href
=
'" + data.file_url + "'
target
=
'_blank'
>
" + data.file_name + "
<
div
style
=
'display:none'
class
=
'attachment_fields'
>
" + data.field_name + "
<
/div></
a
>
"
;
}
},
{
field
:
'agency_brand_names'
,
title
:
'代理品牌'
,
align
:
'center'
,
width
:
180
,
templet
:
function
(
data
)
{
return
data
.
field_name
===
'proxy_certificate'
?
(
data
.
agency_brand_names
||
'-'
)
:
'-'
;
}
},
{
field
:
'description'
,
title
:
'附件说明'
,
align
:
'center'
,
width
:
250
},
{
field
:
'validity_period'
,
title
:
'
<
span
class
=
"require"
>*
<
/span>有效期', align: 'center', width: 220}
,
{
field
:
'validity_period'
,
title
:
'
<
span
class
=
"require"
>*
<
/span>有效期', align: 'center', width: 220
,
templet
:
function
(
data
)
{
if
(
data
.
is_expired
===
1
)
{
return
'
<
span
style
=
"color:red;"
>
' + data.validity_period + '
<
/span>'
;
}
return
data
.
validity_period
;
}
},
{
field
:
'create_name'
,
title
:
'上传人'
,
align
:
'center'
,
width
:
100
},
{
field
:
'create_time'
,
title
:
'上传时间'
,
align
:
'center'
,
width
:
150
},
]],
...
...
resources/views/web/AddSupplierAttachment.blade.php
View file @
e308f05d
...
...
@@ -13,6 +13,13 @@
{!! $statusPresenter->render('field_name','附件类型',isset($attachment['field_name'])?$attachment['field_name']:'',
config('fixed.FileNameMapping'),['required'=>true]) !!}
</div>
<div
class=
"layui-form-item"
id=
"agency_brands_div"
style=
"display: none;"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
代理品牌 :
</label>
<div
class=
"layui-input-block"
>
<div
id=
"agency_brand_selector"
></div>
<input
type=
"hidden"
name=
"agency_brands"
id=
"agency_brands"
value=
"{{$attachment['agency_brands'] or ''}}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
有效期 :
</label>
<div
class=
"layui-input-block"
>
...
...
@@ -69,4 +76,4 @@
</div>
</form>
</div>
</div>
\ No newline at end of file
</div>
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
View file @
e308f05d
...
...
@@ -196,10 +196,14 @@
{
field
:
'supplier_name'
,
title
:
'供应商名称'
,
align
:
'left'
,
width
:
180
,
templet
:
function
(
data
)
{
let
supplierName
=
data
.
supplier_name
;
if
(
data
.
has_attachment_expired
===
1
)
{
supplierName
+=
"
<
i
class
=
'layui-icon layui-icon-notice'
style
=
'color: #FF5722;'
title
=
'存在已过期附件'
><
/i>"
;
}
if
(
data
.
status
===
-
3
)
{
return
"
<
span
title
=
'" + data.block_reason + "'
>
" +
data.supplier_n
ame + "
<
/span>
"
return
"
<
span
title
=
'" + data.block_reason + "'
>
" +
supplierN
ame + "
<
/span>
"
}
else
{
return
data
.
supplier_n
ame
;
return
supplierN
ame
;
}
}
},
...
...
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