This commit is contained in:
weiz 2024-04-13 11:30:57 +08:00
parent d673388bb5
commit 9baaacfeb8
7 changed files with 69 additions and 100 deletions

View File

@ -21,7 +21,6 @@
use app\common\model\dept\Dept;
use app\common\model\marketing\MarketingContract;
use app\common\model\marketing\MarketingCustom;
use app\common\model\oa\FlowApprove;
/**
@ -42,7 +41,7 @@
public function setSearch(): array
{
return [
'=' => ['part_a', 'business_nature', 'industry_nature', 'fund_sources', 'const_area', 'signed_dept'],
'=' => ['part_a', 'business_nature', 'industry_nature', 'fund_sources', 'const_area', 'signed_dept', 'review_status', 'status', 'approve_check_status'],
'%like%' => ['contract_name', 'contract_code'],
];
}
@ -86,20 +85,9 @@
$data['plance_seal_text'] = $data->plance_seal_text;
$data['contract_type_text'] = $data->contract_type_text;
$data['review_status_text'] = $data->review_status_text;
if (!empty($data['approve_id'])) {
$approve = FlowApprove::field('check_status')->where('content_id', $data['id'])->where('content_model', 'app\common\model\marketing\MarketingContract')->findOrEmpty();
$data['approve_status'] = $approve['check_status'];
$data['approve_status_text'] = match ($approve['check_status']) {
0 => '待审核',
1 => '审核中',
2 => '审核通过',
3 => '审核不通过',
4 => '撤销审核',
};
} else {
$data['approve_status'] = 0;
$data['approve_status_text'] = '待审核';
}
$data['status_text'] = $data->status_text;
$data['reflux_status_text'] = $data->reflux_status_text;
$data['approve_check_status_text'] = $data->approve_check_status_text;
})
->toArray();
}

View File

@ -20,7 +20,6 @@
use app\common\model\dept\Dept;
use app\common\model\marketing\MarketingContract;
use app\common\model\marketing\MarketingCustom;
use app\common\model\oa\FlowApprove;
/**
@ -41,7 +40,7 @@
public function setSearch(): array
{
return [
'=' => ['business_nature', 'agreement_nature', 'signed_dept', 'part_a'],
'=' => ['business_nature', 'agreement_nature', 'signed_dept', 'part_a', 'approve_check_status'],
'%like%' => ['contract_name'],
];
}
@ -78,20 +77,7 @@
$data['plance_seal_text'] = $data->plance_seal_text;
$data['contract_type_text'] = $data->contract_type_text;
$data['review_status_text'] = $data->review_status_text;
if (!empty($data['approve_id'])) {
$approve = FlowApprove::field('check_status')->where('content_id', $data['id'])->where('content_model', 'app\common\model\marketing\MarketingContract')->findOrEmpty();
$data['approve_status'] = $approve['check_status'];
$data['approve_status_text'] = match ($approve['check_status']) {
0 => '待审核',
1 => '审核中',
2 => '审核通过',
3 => '审核不通过',
4 => '撤销审核',
};
} else {
$data['approve_status'] = 0;
$data['approve_status_text'] = '待审核';
}
$data['approve_check_status_text'] = $data->approve_check_status_text;
})
->toArray();
}

View File

@ -20,7 +20,6 @@
use app\common\model\dept\Dept;
use app\common\model\marketing\MarketingContract;
use app\common\model\marketing\MarketingCustom;
use app\common\model\oa\FlowApprove;
/**
@ -41,7 +40,7 @@
public function setSearch(): array
{
return [
'=' => ['business_nature', 'signed_dept', 'part_a', 'related_contract_id'],
'=' => ['business_nature', 'signed_dept', 'part_a', 'related_contract_id', 'approve_check_status'],
'%like%' => ['contract_name'],
];
}
@ -79,20 +78,7 @@
$data['file_type_text'] = $data->file_type_text;
$data['contract_type_text'] = $data->contract_type_text;
$data['review_status_text'] = $data->review_status_text;
if (!empty($data['approve_id'])) {
$approve = FlowApprove::field('check_status')->where('content_id', $data['id'])->where('content_model', 'app\common\model\marketing\MarketingContract')->findOrEmpty();
$data['approve_status'] = $approve['check_status'];
$data['approve_status_text'] = match ($approve['check_status']) {
0 => '待审核',
1 => '审核中',
2 => '审核通过',
3 => '审核不通过',
4 => '撤销审核',
};
} else {
$data['approve_status'] = 0;
$data['approve_status_text'] = '待审核';
}
$data['approve_check_status_text'] = $data->approve_check_status_text;
})
->toArray();
}

View File

@ -11,44 +11,53 @@
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model;
use app\common\service\FileService;
use think\Model;
/**
* 基础模型
* Class BaseModel
* @package app\common\model
*/
class BaseModel extends Model
{
/**
* @notes 公共处理图片,补全路径
* @param $value
* @return string
* @author 张无忌
* @date 2021/9/10 11:02
*/
public function getImageAttr($value)
{
return trim($value) ? FileService::getFileUrl($value) : '';
}
/**
* @notes 公共图片处理,去除图片域名
* @param $value
* @return mixed|string
* @author 张无忌
* @date 2021/9/10 11:04
*/
public function setImageAttr($value)
{
return trim($value) ? FileService::setFileUrl($value) : '';
}
public function getAnnexAttr($value){
return !empty($value) ? json_decode($value,true) : '';
}
}
namespace app\common\model;
use app\common\model\dict\DictData;
use app\common\service\FileService;
use think\Model;
/**
* 基础模型
* Class BaseModel
* @package app\common\model
*/
class BaseModel extends Model
{
/**
* @notes 公共处理图片,补全路径
* @param $value
* @return string
* @author 张无忌
* @date 2021/9/10 11:02
*/
public function getImageAttr($value)
{
return trim($value) ? FileService::getFileUrl($value) : '';
}
/**
* @notes 公共图片处理,去除图片域名
* @param $value
* @return mixed|string
* @author 张无忌
* @date 2021/9/10 11:04
*/
public function setImageAttr($value)
{
return trim($value) ? FileService::setFileUrl($value) : '';
}
public function getAnnexAttr($value)
{
return !empty($value) ? json_decode($value, true) : '';
}
public function getApproveCheckStatusTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'check_status')->column('name', 'value');
return !empty($data['approve_check_status']) ? $dict[$data['approve_check_status']] : '待审核';
}
}

View File

@ -44,12 +44,6 @@
return !empty($data['bid_nature']) ? $dict[$data['bid_nature']] : '';
}
public function getApproveCheckStatusTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'check_status')->column('name', 'value');
return !empty($data['approve_check_status']) ? $dict[$data['approve_check_status']] : '';
}
public function getEndDateAttr($value): string
{
return !empty($value) ? date('Y-m-d', $value) : '';

View File

@ -62,12 +62,6 @@
return !empty($data['const_area']) ? $dict[$data['const_area']] : '';
}
public function getApproveCheckStatusTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'check_status')->column('name', 'value');
return !empty($data['approve_check_status']) ? $dict[$data['approve_check_status']] : '';
}
public function getStatusTextAttr($value, $data): string
{
$arr = [0 => '未启动投标', 1 => '参与投标', 2 => '未开标', 3 => '已中标', 4 => '未中标'];

View File

@ -86,6 +86,12 @@
return !empty($data['seal_name']) ? $dict[$data['seal_name']] : '';
}
public function getApproveCheckStatusTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_seal_name')->column('name', 'value');
return !empty($data['approve_check_status']) ? $dict[$data['approve_check_status']] : '';
}
public function getIsLimitTextAttr($value, $data): string
{
$arr = [0 => '否', 1 => '是'];
@ -104,6 +110,12 @@
return $arr[$data['review_status']];
}
public function getStatusTextAttr($value, $data): string
{
$arr = [0 => '待立项', 1 => '已立项'];
return $arr[$data['reflux_status']];
}
public function getRefluxStatusTextAttr($value, $data): string
{
$arr = [0 => '未回流', 1 => '已回流'];