Commit 32ecbce7 by 杨树贤

Merge branch 'ysx-供应商附件代理品牌-20250528-' into ysx-过期时间需求-20260521

parents e0886773 384fb908
...@@ -45,6 +45,7 @@ class SupplierAttachmentApiController extends Controller ...@@ -45,6 +45,7 @@ class SupplierAttachmentApiController extends Controller
} }
$attachment = $request->only([ $attachment = $request->only([
'field_name', 'field_name',
'agency_brands',
'validity_type', 'validity_type',
'validity_period', 'validity_period',
'description', 'description',
...@@ -82,6 +83,7 @@ class SupplierAttachmentApiController extends Controller ...@@ -82,6 +83,7 @@ class SupplierAttachmentApiController extends Controller
$attachment = $model->where('attachment_id', $attachmentId)->first()->toArray(); $attachment = $model->where('attachment_id', $attachmentId)->first()->toArray();
$result = $model->where('attachment_id', $attachmentId)->delete(); $result = $model->where('attachment_id', $attachmentId)->delete();
if ($result) { if ($result) {
(new SupplierAttachmentService())->syncSupplierAgencyBrands($attachment['supplier_id']);
$logService = new LogService(); $logService = new LogService();
$content = "删除附件信息 : " . $attachment['type_name']; $content = "删除附件信息 : " . $attachment['type_name'];
$remark = json_encode($attachment); $remark = json_encode($attachment);
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Services\RoleService; use App\Http\Services\RoleService;
use App\Http\Services\StandardBrandService;
use App\Http\Services\SupplierContactService; use App\Http\Services\SupplierContactService;
use App\Http\Services\SupplierService; use App\Http\Services\SupplierService;
use App\Http\Services\SupplierStatisticsService; use App\Http\Services\SupplierStatisticsService;
...@@ -45,6 +46,9 @@ class SupplierAttachmentController extends Controller ...@@ -45,6 +46,9 @@ class SupplierAttachmentController extends Controller
//供应商详情 //供应商详情
public function AddSupplierAttachment($request) 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'] = '添加附件'; $this->data['title'] = '添加附件';
return $this->view('添加附件'); return $this->view('添加附件');
} }
...@@ -57,8 +61,17 @@ class SupplierAttachmentController extends Controller ...@@ -57,8 +61,17 @@ class SupplierAttachmentController extends Controller
$model = new SupplierAttachmentsModel(); $model = new SupplierAttachmentsModel();
$attachment = $model->where('attachment_id', $attachmentId)->first()->toArray(); $attachment = $model->where('attachment_id', $attachmentId)->first()->toArray();
$attachment['validity_period'] = $attachment['validity_start'] ? date('Y-m-d', $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['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['title'] = '修改附件';
$this->data['view'] = 'AddSupplierAttachment'; $this->data['view'] = 'AddSupplierAttachment';
...@@ -67,4 +80,4 @@ class SupplierAttachmentController extends Controller ...@@ -67,4 +80,4 @@ class SupplierAttachmentController extends Controller
} }
\ No newline at end of file
...@@ -986,6 +986,94 @@ class DataService ...@@ -986,6 +986,94 @@ class DataService
SupplierChannelModel::where('supplier_code', 'L0005670')->update(['group_code' => 'G003815']); 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() public static function reInitSupplierCpTime()
......
...@@ -6,6 +6,7 @@ namespace App\Http\Services; ...@@ -6,6 +6,7 @@ namespace App\Http\Services;
//后台用户相关信息服务 //后台用户相关信息服务
use App\Model\SupplierAttachmentsModel; use App\Model\SupplierAttachmentsModel;
use App\Model\SupplierChannelModel;
//用于判断是否已经查看的服务 //用于判断是否已经查看的服务
class SupplierAttachmentService class SupplierAttachmentService
...@@ -27,6 +28,9 @@ class SupplierAttachmentService ...@@ -27,6 +28,9 @@ class SupplierAttachmentService
if ($attachment['validity_type'] == 1) { if ($attachment['validity_type'] == 1) {
$attachment['validity_start'] = $attachment['validity_end'] = 0; $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']); $attachment['type_name'] = array_get(config('fixed.FileNameMapping'), $attachment['field_name']);
unset($attachment['validity_period']); unset($attachment['validity_period']);
$attachmentId = $attachment['attachment_id']; $attachmentId = $attachment['attachment_id'];
...@@ -39,11 +43,57 @@ class SupplierAttachmentService ...@@ -39,11 +43,57 @@ class SupplierAttachmentService
$attachment['create_name'] = request()->user->name; $attachment['create_name'] = request()->user->name;
$attachment['create_time'] = time(); $attachment['create_time'] = time();
$attachmentModel->insertGetId($attachment); $attachmentModel->insertGetId($attachment);
$this->syncSupplierAgencyBrands($attachment['supplier_id']);
return $attachment['supplier_id']; return $attachment['supplier_id'];
} else { } else {
$attachment['update_time'] = time(); $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(),
]);
} }
//新增附件来源于新增页面,数据要转换 //新增附件来源于新增页面,数据要转换
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace App\Http\Transformers; namespace App\Http\Transformers;
use App\Http\Services\StandardBrandService;
class SupplierAttachmentTransformer class SupplierAttachmentTransformer
{ {
...@@ -17,11 +18,19 @@ class SupplierAttachmentTransformer ...@@ -17,11 +18,19 @@ class SupplierAttachmentTransformer
if (!$attachment) { if (!$attachment) {
continue; 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) { if ($attachment['validity_type'] == 1) {
$attachment['validity_period'] = '长期有效'; $attachment['validity_period'] = '长期有效';
} else { } else {
$attachment['validity_period'] = $attachment['validity_start'] ? date('Y-m-d', $attachment['validity_period'] = $attachment['validity_start'] ? date('Y-m-d',
$attachment['validity_start']) . '~' . date('Y-m-d', $attachment['validity_end']) : ''; $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'] = $attachment['create_time'] ? date('Y-m-d H:i:s',
$attachment['create_time']) : ''; $attachment['create_time']) : '';
...@@ -30,4 +39,4 @@ class SupplierAttachmentTransformer ...@@ -30,4 +39,4 @@ class SupplierAttachmentTransformer
return $list; return $list;
} }
} }
\ No newline at end of file
...@@ -100,10 +100,17 @@ class SupplierTransformer ...@@ -100,10 +100,17 @@ class SupplierTransformer
$supplier['contact_num'] = $this->getContactNum($supplier['supplier_id']); $supplier['contact_num'] = $this->getContactNum($supplier['supplier_id']);
$supplier['has_sku'] = $supplier['sku_num'] ? '是' : '否'; $supplier['has_sku'] = $supplier['sku_num'] ? '是' : '否';
$supplier['is_business_abnormal_name'] = $supplier['is_business_abnormal'] == 1 ? '是' : '否'; $supplier['is_business_abnormal_name'] = $supplier['is_business_abnormal'] == 1 ? '是' : '否';
$supplier['has_attachment_expired'] = 0;
if (isset($supplier['attachment'])) { if (isset($supplier['attachment'])) {
$supplier['has_quality_assurance_agreement'] = $this->checkHasSpecificAttachment('quality_assurance_agreement', $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_cooperation_agreement'] = $this->checkHasSpecificAttachment('cooperation_agreement', $supplier['attachment']) ? '有' : '无';
$supplier['has_yunxin_agreement'] = $this->checkHasSpecificAttachment('yunxin_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 { } else {
$supplier['has_quality_assurance_agreement'] = '无'; $supplier['has_quality_assurance_agreement'] = '无';
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
namespace App\Http\Validators; namespace App\Http\Validators;
use App\Model\SupplierChannelModel; use App\Model\SupplierChannelModel;
use Validator; use Illuminate\Support\Facades\Validator;
class SupplierAttachmentValidator class SupplierAttachmentValidator
{ {
...@@ -35,6 +35,10 @@ class SupplierAttachmentValidator ...@@ -35,6 +35,10 @@ class SupplierAttachmentValidator
return '供应商为混合分销商的时候,代理证的必须为自定义且必填'; return '供应商为混合分销商的时候,代理证的必须为自定义且必填';
} }
if ($attachment['field_name'] == 'proxy_certificate' && empty($attachment['agency_brands'])) {
return '附件类型为代理证时,代理品牌为必填';
}
if ($validator->fails()) { if ($validator->fails()) {
return $validator->errors()->first(); return $validator->errors()->first();
} }
...@@ -51,4 +55,4 @@ class SupplierAttachmentValidator ...@@ -51,4 +55,4 @@ class SupplierAttachmentValidator
'file_name.required' => '文件名 不能为空', 'file_name.required' => '文件名 不能为空',
]; ];
} }
} }
\ No newline at end of file
...@@ -104,11 +104,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -104,11 +104,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
$isAdmin = request()->user->userId == 1000 ? true : false; DataService::initProxyCertificateAgencyBrands(false,0);
if (!$isAdmin) {
return response()->json(['code' => 403, 'msg' => '无权限']);
}
$supplierId = (int)request()->get('supplier_id');
$result = (new DataService())->clearSupplierData($supplierId);
return response()->json($result);
}); });
{!! Autograph() !!} {!! Autograph() !!}
<script> <script>
layui.use(['form', 'upload', 'admin', 'laydate'], function () { layui.use(['form', 'upload', 'admin', 'laydate', 'xmSelect'], function () {
const form = layui.form const form = layui.form
const upload = layui.upload; const upload = layui.upload;
const admin = layui.admin; 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) { 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) { layer.confirm('确定要保存附件信息吗?', function (index) {
admin.showLoading({ admin.showLoading({
type: 3 type: 3
...@@ -125,4 +206,4 @@ ...@@ -125,4 +206,4 @@
} }
}); });
}); });
</script> </script>
\ No newline at end of file
...@@ -196,10 +196,14 @@ ...@@ -196,10 +196,14 @@
{ {
field: 'supplier_name', title: '供应商名称', align: 'left', width: 180, templet: function (data) { 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) { if (data.status === -3) {
return "<span title='" + data.block_reason + "'>" + data.supplier_name + "</span>" return "<span title='" + data.block_reason + "'>" + supplierName + "</span>"
} else { } else {
return data.supplier_name; return supplierName;
} }
} }
}, },
......
...@@ -36,8 +36,22 @@ ...@@ -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>"; 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: '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_name', title: '上传人', align: 'center', width: 100},
{field: 'create_time', title: '上传时间', align: 'center', width: 150}, {field: 'create_time', title: '上传时间', align: 'center', width: 150},
]], ]],
......
...@@ -13,6 +13,13 @@ ...@@ -13,6 +13,13 @@
{!! $statusPresenter->render('field_name','附件类型',isset($attachment['field_name'])?$attachment['field_name']:'', {!! $statusPresenter->render('field_name','附件类型',isset($attachment['field_name'])?$attachment['field_name']:'',
config('fixed.FileNameMapping'),['required'=>true]) !!} config('fixed.FileNameMapping'),['required'=>true]) !!}
</div> </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"> <div class="layui-form-item">
<label class="layui-form-label">有效期 : </label> <label class="layui-form-label">有效期 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
...@@ -69,4 +76,4 @@ ...@@ -69,4 +76,4 @@
</div> </div>
</form> </form>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -196,10 +196,14 @@ ...@@ -196,10 +196,14 @@
{ {
field: 'supplier_name', title: '供应商名称', align: 'left', width: 180, templet: function (data) { 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) { if (data.status === -3) {
return "<span title='" + data.block_reason + "'>" + data.supplier_name + "</span>" return "<span title='" + data.block_reason + "'>" + supplierName + "</span>"
} else { } else {
return data.supplier_name; return supplierName;
} }
} }
}, },
......
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