Commit 6e46ab24 by mushishixian

审核中字符

parent a90e6cff
......@@ -144,7 +144,7 @@ class SupplierApiController extends Controller
public function DisableSupplier($request)
{
//禁用不是直接修改为无法交易,而是改为待审核,然后审核通过后,变成无法交易
//禁用不是直接修改为无法交易,而是改为审核中,然后审核通过后,变成无法交易
$supplierId = $request->get('supplier_id');
$model = new SupplierChannelModel();
$redis = new RedisModel();
......@@ -404,4 +404,20 @@ class SupplierApiController extends Controller
$this->response(-1, '无法进行审核操作,因为该供应商最后(修改人/创建人)和您不属于同一个部门');
}
}
//拉黑供应商
public function BlockSupplier($request)
{
$supplierId = $request->get('supplier_id');
$channelModel = new SupplierChannelModel();
$result = $channelModel->where('supplier_id', $supplierId)->update([
'status' => -3,
'update_time' => time(),
]);
if ($result) {
$this->response(0, '拉黑成功');
} else {
$this->response(-1, '拉黑操作失败 ');
}
}
}
......@@ -94,7 +94,7 @@ class SupplierReceiptApiController extends Controller
$this->response(-1, '操作失败');
}
//判断是否要进入待审核状态,因为部分字段修改是不需要走审核的
//判断是否要进入审核中状态,因为部分字段修改是不需要走审核的
private function checkNeedAudit($oldReceipt, $newReceipt)
{
$notNeedAuditField = [
......
......@@ -159,7 +159,7 @@ class SupplierFilter
$query->where('status', SupplierChannelModel::STATUS_PENDING);
break;
case "in_review":
//待审核
//审核中
$query->where('status', SupplierChannelModel::STATUS_IN_REVIEW);
break;
case "passed":
......
......@@ -398,7 +398,7 @@ class DataService
}
//同时记录被修改的supplier_id列表到redis以防万一
$redis->hset('lie_change_is_type_suppliers', $supplier['supplier_id'], json_encode($supplier));
//没有的话直接修改成待审核,并且转正
//没有的话直接修改成审核中,并且转正
$model->where('supplier_id', $supplier['supplier_id'])
->update([
'update_time' => time(),
......
......@@ -30,7 +30,7 @@ class SupplierAuditService
//先找出原来供应商的状态
$supplierModel = new SupplierChannelModel();
$supplier = $supplierModel->where('supplier_id', $supplierId)->first()->toArray();
//如果需要复审并且审核状态为待审核,则代表这次审核为第一次审核
//如果需要复审并且审核状态为审核中,则代表这次审核为第一次审核
if ($supplier['status'] == SupplierChannelModel::STATUS_IN_REVIEW && $supplier['need_review'] == 1) {
//第一次审核,通过是将审核状态置为待复审
//通过
......@@ -189,7 +189,7 @@ class SupplierAuditService
return true;
}
//判断是否要进入待审核状态,因为部分字段修改是不需要走审核的
//判断是否要进入审核中状态,因为部分字段修改是不需要走审核的
public function checkNeedAudit($supplierId, $channel)
{
$notNeedAuditField = [
......
......@@ -124,7 +124,7 @@ class SupplierContactService
return !empty($contact) ? $contact->toArray() : [];
}
//判断是否要进入待审核状态,因为部分字段修改是不需要走审核的
//判断是否要进入审核中状态,因为部分字段修改是不需要走审核的
private function checkNeedAudit($oldContact, $newContact)
{
$notNeedAuditField = [
......
......@@ -16,7 +16,7 @@ class SupplierStatisticsService
$total = $this->getStatisticsCount('all');
//待复审
$pending = $this->getStatisticsCount('pending');
//待审核
//审核中
$inReview = $this->getStatisticsCount('in_review');
//通过
$passed = $this->getStatisticsCount('passed');
......
......@@ -12,7 +12,7 @@ class SupplierChannelModel extends Model
//待复审(第一次新增)
const STATUS_PENDING = -1;
//待审核
//审核中
const STATUS_IN_REVIEW = 1;
//通过
const STATUS_PASSED = 2;
......@@ -20,6 +20,8 @@ class SupplierChannelModel extends Model
const STATUS_REJECT = 3;
//禁止交易(禁用)
const STATUS_DISABLE = -2;
//黑名单
const STATUS_BLOCK = -3;
//黑名单信息
public function blacklist()
......
......@@ -15,7 +15,7 @@ return [
//sku列表用
'SkuStatus' => [
0 => '待审核',
0 => '审核中',
1 => '上架',
2 => '审核不通过',
3 => '下架',
......
......@@ -88,10 +88,11 @@ return [
'SupplierStatus' => [
-1 => '待复审',
1 => '待审核',
1 => '审核中',
3 => '未通过',
2 => '已通过',
-2 => '禁止交易',
-3 => '黑名单',
],
'Currency' => [
......@@ -205,7 +206,7 @@ return [
'CompassMenuMap' => [
'total' => '全部',
'pending' => '待复审',
'in_review' => '待审核',
'in_review' => '审核中',
'passed' => '已通过',
'rejected' => '未通过',
'disable' => '禁止交易',
......
......@@ -15,6 +15,22 @@
window.location.href = "/supplier/UpdateSupplier?view=iframe&supplier_id={{$supplier['supplier_id']}}&tab=" + tabName;
})
$('#cancel_block_supplier').click(function () {
layer.confirm('你确定要取消拉黑该供应商吗,取消后会进入审核中状态?', function (index) {
let supplierId = data[0].supplier_id;
let res = ajax('/api/supplier/ChangeSupplierIsType', {supplier_id: supplierId, is_type: 0})
if (res.err_code === 0) {
saveRefreshData('detail', supplierId)
table.reload('list')
supplierStatistics();
layer.closeAll();
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
});
{{--index.setTabTitle('供应商详情 - {{$supplier['supplier_code'] or ''}}');--}}
function openLogView() {
......
......@@ -33,8 +33,6 @@
}
, where: whereCondition
});
// $('#status').val('');
// form.render('select')
});
//多加了个区分根据状态去筛选
......@@ -86,6 +84,8 @@
field: 'status_name', title: '状态', align: 'center', width: 70, templet: function (data) {
if (data.status === 3) {
return "<span style='color: red' title='" + data.reject_reason + "'>" + data.status_name + "</span>"
} else if (data.status === -3) {
return "<span style='color: red' title='" + data.block_reason + "'>" + data.status_name + "</span>"
} else {
return data.status_name;
}
......@@ -234,7 +234,7 @@
return
}
// if (status === -1) {
// layer.msg('要待审核的供应商才可以审核', {icon: 5});
// layer.msg('要审核中的供应商才可以审核', {icon: 5});
// return
// }
let checkAuditMsg = checkCanAudit(supplierId);
......@@ -309,12 +309,6 @@
layer.msg('选择的供应商里,存在审核状态的供应商,无法分配渠道员', {icon: 5})
return
}
// let is_type = Array.from(data, ({is_type}) => is_type);
// //分配采购员的多选操作,需要先去判断是否存在审核中的供应商,存在的话,要提示
// if (is_type.indexOf(1) !== -1) {
// layer.msg('选择的供应商里,存在非正式供应商,请先将其转正', {icon: 5})
// return
// }
layer.open({
type: 2,
content: '/supplier/BatchAllocatePurchaseUser?view=iframe&supplier_ids=' + supplierIds,
......@@ -405,7 +399,6 @@
}
});
//转正供应商
$("#change_supplier_is_type").click(function () {
let checkStatus = table.checkStatus('list');
......@@ -422,7 +415,7 @@
layer.msg('该供应商已经是正式供应商', {'icon': 5});
return
}
layer.confirm('如果转成正式供应商,会进入待审核状态,需要补全相关信息申请审核,确定要转正该供应商吗?', function (index) {
layer.confirm('如果转成正式供应商,会进入审核中状态,需要补全相关信息申请审核,确定要转正该供应商吗?', function (index) {
let supplierId = data[0].supplier_id;
let res = ajax('/api/supplier/ChangeSupplierIsType', {supplier_id: supplierId, is_type: 0})
if (res.err_code === 0) {
......@@ -438,6 +431,31 @@
}
});
$("#block_supplier").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
layer.confirm('确定要拉黑这家供应商吗?', function (index) {
let supplierId = data[0].supplier_id;
let res = ajax('/api/supplier/block_supplier', {supplier_id: supplierId, is_type: 0})
if (res.err_code === 0) {
saveRefreshData('detail', supplierId)
table.reload('list')
supplierStatistics();
layer.closeAll();
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
//点击查询按钮
form.on('submit(load)', function (data) {
//罗盘选项会跳回全部
......
......@@ -19,9 +19,9 @@
} else if (data.field.status === '-1') {
confirmMessage = '确定要提交新增供应商信息吗?一旦提交,该供应商就会进入待复审阶段,审核过程中无法进行信息修改'
}else if (data.field.status === '3') {
confirmMessage = '确定要重新提交审核吗?一旦提交,该供应商就会再次进入待审核阶段,审核过程中无法进行信息修改';
confirmMessage = '确定要重新提交审核吗?一旦提交,该供应商就会再次进入审核中阶段,审核过程中无法进行信息修改';
} else {
confirmMessage = '确定要修改供应商信息吗?一旦修改关键字段,该供应商就会再次进入待审核阶段,审核过程中无法进行信息修改';
confirmMessage = '确定要修改供应商信息吗?一旦修改关键字段,该供应商就会再次进入审核中阶段,审核过程中无法进行信息修改';
}
layer.confirm(confirmMessage, function (index) {
let res = ajax('/api/supplier/UpdateSupplier', data.field)
......
......@@ -48,41 +48,38 @@
</div>
<div class="layui-col-md3"></div>
</div>
@if($supplier['is_type']==1)
<div class="layui-row">
<div class="layui-row">
@if($supplier['is_type']==1)
<button type="button" style="margin-bottom: 25px;margin-top: 5px"
class="layui-btn layui-btn layui-btn-disabled">供应商为非正式供应商,请先转正
</button>
</div>
@else
@if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_PENDING)
<div class="layui-row">
@else
@if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_PENDING)
<button type="button" style="margin-bottom: 25px;margin-top: 5px"
class="layui-btn layui-btn layui-btn-disabled">待复审,不能修改
</button>
</div>
@elseif($supplier['status']==\App\Model\SupplierChannelModel::STATUS_PASSED||$supplier['status']==\App\Model\SupplierChannelModel::STATUS_REJECT)
<div class="layui-row">
@elseif($supplier['status']==\App\Model\SupplierChannelModel::STATUS_PASSED||$supplier['status']==\App\Model\SupplierChannelModel::STATUS_REJECT)
<a id="updateSupplierUrl"
style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">修改</a>
</div>
@endif
@if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_DISABLE)
<div class="layui-row">
@endif
@if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_DISABLE)
<a id="updateSupplierUrl"
href="/supplier/UpdateSupplier?view=iframe&supplier_id={{$supplier['supplier_id']}}"
style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">申请重新入驻</a>
</div>
@endif
@if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_IN_REVIEW)
<div class="layui-row">
@endif
@if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_IN_REVIEW)
<button type="button" style="margin-bottom: 25px;margin-top: 5px"
class="layui-btn layui-btn layui-btn-disabled">待审核,不能修改
class="layui-btn layui-btn layui-btn-disabled">审核中,不能修改
</button>
</div>
@endif
@if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_BLOCK && checkPerm('CancelBlockSupplier'))
<button type="button" style="margin-bottom: 25px;margin-top: 5px" id="cancel_block_supplier"
class="layui-btn layui-btn">取消拉黑
</button>
@endif
@endif
@endif
<a href="/supplier/print" style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">打印</a>
</div>
</div>
<div class="layui-card-body" style="margin-top: 140px">
<div class="layui-tab">
......
......@@ -10,11 +10,12 @@
@if(checkPerm('AuditSupplier'))
<button type="button" class="layui-btn layui-btn-sm" id="audit_supplier">审核</button>
@endif
@if(checkPerm('AllocatePurchaseUser'))
<button type="button" class="layui-btn layui-btn-sm" id="allocate_purchase_user">分配渠道员</button>
@endif
{{-- @if(checkPerm('AllocatePurchaseUser'))--}}
{{-- <button type="button" class="layui-btn layui-btn-sm" id="allocate_purchase_user">分配渠道员</button>--}}
{{-- @endif--}}
@if(checkPerm('BatchAllocatePurchaseUser'))
<button type="button" class="layui-btn layui-btn-sm" id="batch_allocate_purchase_user">批量分配渠道员</button>
{{-- <button type="button" class="layui-btn layui-btn-sm" id="batch_allocate_purchase_user">批量分配渠道员</button>--}}
<button type="button" class="layui-btn layui-btn-sm" id="batch_allocate_purchase_user">分配渠道员</button>
@endif
@if(checkPerm('AllocateChannelUser'))
<button type="button" class="layui-btn layui-btn-sm" id="allocate_channel_user">分配采购员</button>
......@@ -24,6 +25,12 @@
转正供应商
</button>
@endif
@if(checkPerm('ChangeSupplierIsType'))
{{-- @if(checkPerm('BlockSupplier'))--}}
<button type="button" class="layui-btn layui-btn-sm" id="block_supplier">
拉黑
</button>
@endif
@if(request()->user->userId==1000)
<button type="button" class="layui-btn layui-btn-sm" title="该操作可以将供应商同步到供应商" id="sync_supplier_to_erp">
金蝶同步
......
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