Commit cacabeb6 by 杨树贤

品质协议展示问题

parent 641e4576
......@@ -41,6 +41,7 @@ class SupplierTransformer
$supplier['region_name'] = array_get(config('fixed.Region'), $supplier['region'], '暂无');
$supplier['contact_num'] = $this->getContactNum($supplier['supplier_id']);
$supplier['has_sku'] = $supplier['sku_num'] ? '是' : '否';
$supplier['has_quality_assurance_agreement'] = $this->checkHasQualityAssuranceAgreement($supplier['attachment']) ? '有' : '无';
$supplier['is_own'] = $supplier['create_uid'] == request()->user->userId ? "创建" : "指派";
if (empty($supplier['create_name'])) {
$userInfo = $adminUserService->getAdminUserInfo($supplier['create_uid']);
......@@ -58,6 +59,19 @@ class SupplierTransformer
return $list;
}
public function checkHasQualityAssuranceAgreement($attachment)
{
if (!$attachment) {
return false;
}
foreach ($attachment as $key => $value) {
if ($value['field_name'] == 'quality_assurance_agreement') {
return true;
}
}
return false;
}
public function getContactNum($supplierId)
{
$model = new SupplierContactModel();
......@@ -102,7 +116,7 @@ class SupplierTransformer
$supplier['region_name'] = array_get(config('fixed.Region'), $supplier['region']);
$supplier['currency_name'] = array_get(config('fixed.Currency'), $supplier['currency']);
$supplier['supplier_group_name'] = array_get(config('fixed.SupplierGroup'), $supplier['supplier_group']);
$supplier['pay_type_name'] = array_get(config('fixed.SupplierPayType'),$supplier['pay_type']);
$supplier['pay_type_name'] = array_get(config('fixed.SupplierPayType'), $supplier['pay_type']);
$supplier['trading_method_name'] = array_get(config('fixed.TradingMethod'), $supplier['trading_method']);
$supplier['settlement_type_name'] = array_get(config('field.SettlementType'), $supplier['settlement_type']);
$supplier['main_brand_names'] = $this->getMainBrandNames($supplier['main_brands']);
......@@ -128,7 +142,7 @@ class SupplierTransformer
->where('type', LogModel::UPDATE_OPERATE)->orderBy('id', 'desc')->first();
$supplier['last_update_name'] = $log['admin_name'] ?: '无';
$supplier['last_update_time'] = empty($supplier['last_update_time']) ? ($log['add_time'] ? date('Y-m-d H:i:s',
$log['add_time']):'无') : '无';
$log['add_time']) : '无') : '无';
$supplier['has_certification_name'] = array_get(config('fixed.CertificationStatus'),
array_get($supplier, 'has_certification', ''), '');
$supplier['sku_tag_name'] = array_get(config('field.SkuTag'), array_get($supplier, 'sku_tag', ''), '无');
......
......@@ -88,16 +88,10 @@
}
},
{
field: 'quality_assurance_agreement',
field: 'has_quality_assurance_agreement',
title: '品质协议',
align: 'center',
width: 80,
templet: function (data) {
if (data.attachment) {
return data.attachment.quality_assurance_agreement ? '有' : '无';
}
return '无';
}
},
{
field: 'contact_num', title: '联系人', align: 'center', width: 70, templet: function (data) {
......
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