新增分包洽商
This commit is contained in:
parent
25cefd1633
commit
734265d495
@ -15,7 +15,7 @@
|
||||
namespace app\adminapi\lists\contract;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\contract\SubcontractingContractNegotiation;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
@ -38,7 +38,7 @@ class SubcontractingContractNegotiationLists extends BaseAdminDataLists implemen
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['contract_id', 'negotiation_name', 'negotiation_no', 'negotiation_type'],
|
||||
'=' => ['subcontracting_contract_id', 'negotiation_name', 'negotiation_no', 'negotiation_type'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ class SubcontractingContractNegotiationLists extends BaseAdminDataLists implemen
|
||||
public function lists(): array
|
||||
{
|
||||
return SubcontractingContractNegotiation::where($this->searchWhere)
|
||||
->field(['id', 'contract_id', 'negotiation_name', 'negotiation_no', 'negotiation_amount', 'negotiation_type', 'warranty_amount', 'Warranty_expire_date', 'negotiation_content', 'negotiation_detail', 'negotiation_quotation', 'negotiation_basis'])
|
||||
->field(['*'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
|
@ -41,17 +41,17 @@ class SubcontractingContractNegotiationLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
SubcontractingContractNegotiation::create([
|
||||
'contract_id' => $params['contract_id'],
|
||||
'negotiation_name' => $params['negotiation_name'],
|
||||
'negotiation_no' => $params['negotiation_no'],
|
||||
'negotiation_amount' => $params['negotiation_amount'],
|
||||
'negotiation_type' => $params['negotiation_type'],
|
||||
'warranty_amount' => $params['warranty_amount'],
|
||||
'Warranty_expire_date' => $params['Warranty_expire_date'],
|
||||
'negotiation_content' => $params['negotiation_content'],
|
||||
'negotiation_detail' => $params['negotiation_detail'],
|
||||
'negotiation_quotation' => $params['negotiation_quotation'],
|
||||
'negotiation_basis' => $params['negotiation_basis'],
|
||||
'subcontracting_contract_id' => $params['subcontracting_contract_id'] ?? 0,
|
||||
'negotiation_name' => $params['negotiation_name'] ?? '',
|
||||
'negotiation_no' => $params['negotiation_no'] ?? '',
|
||||
'negotiation_amount' => $params['negotiation_amount'] ?? 0,
|
||||
'negotiation_type' => $params['negotiation_type'] ?? 0,
|
||||
'warranty_amount' => $params['warranty_amount'] ?? 0,
|
||||
'Warranty_expire_date' => $params['Warranty_expire_date'] ?? '',
|
||||
'negotiation_content' => $params['negotiation_content'] ?? '',
|
||||
'negotiation_detail' => $params['negotiation_detail'] ?? '',
|
||||
'negotiation_quotation' => $params['negotiation_quotation'] ?? '',
|
||||
'negotiation_basis' => $params['negotiation_basis'] ?? '',
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
@ -76,17 +76,17 @@ class SubcontractingContractNegotiationLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
SubcontractingContractNegotiation::where('id', $params['id'])->update([
|
||||
'contract_id' => $params['contract_id'],
|
||||
'negotiation_name' => $params['negotiation_name'],
|
||||
'negotiation_no' => $params['negotiation_no'],
|
||||
'negotiation_amount' => $params['negotiation_amount'],
|
||||
'negotiation_type' => $params['negotiation_type'],
|
||||
'warranty_amount' => $params['warranty_amount'],
|
||||
'Warranty_expire_date' => $params['Warranty_expire_date'],
|
||||
'negotiation_content' => $params['negotiation_content'],
|
||||
'negotiation_detail' => $params['negotiation_detail'],
|
||||
'negotiation_quotation' => $params['negotiation_quotation'],
|
||||
'negotiation_basis' => $params['negotiation_basis'],
|
||||
'subcontracting_contract_id' => $params['subcontracting_contract_id'] ?? 0,
|
||||
'negotiation_name' => $params['negotiation_name'] ?? '',
|
||||
'negotiation_no' => $params['negotiation_no'] ?? '',
|
||||
'negotiation_amount' => $params['negotiation_amount'] ?? 0,
|
||||
'negotiation_type' => $params['negotiation_type'] ?? 0,
|
||||
'warranty_amount' => $params['warranty_amount'] ?? 0,
|
||||
'Warranty_expire_date' => $params['Warranty_expire_date'] ?? '',
|
||||
'negotiation_content' => $params['negotiation_content'] ?? '',
|
||||
'negotiation_detail' => $params['negotiation_detail'] ?? '',
|
||||
'negotiation_quotation' => $params['negotiation_quotation'] ?? '',
|
||||
'negotiation_basis' => $params['negotiation_basis'] ?? '',
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
@ -121,6 +121,8 @@ class SubcontractingContractNegotiationLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return SubcontractingContractNegotiation::findOrEmpty($params['id'])->toArray();
|
||||
$subcontractingContractNegotiation = SubcontractingContractNegotiation::findOrEmpty($params['id']);
|
||||
$subcontractingContractNegotiation->contract = $subcontractingContractNegotiation->contract;
|
||||
return $subcontractingContractNegotiation->toArray();
|
||||
}
|
||||
}
|
@ -31,7 +31,10 @@ class SubcontractingContractNegotiationValidate extends BaseValidate
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'id' => 'require',
|
||||
'subcontracting_contract_id' => 'require',
|
||||
'negotiation_name' => 'require',
|
||||
'negotiation_amount' => 'require',
|
||||
];
|
||||
|
||||
|
||||
@ -40,7 +43,7 @@ class SubcontractingContractNegotiationValidate extends BaseValidate
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'id' => 'id',
|
||||
];
|
||||
|
||||
|
||||
@ -55,7 +58,6 @@ class SubcontractingContractNegotiationValidate extends BaseValidate
|
||||
return $this->remove('id', true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return SubcontractingContractNegotiationValidate
|
||||
@ -64,7 +66,7 @@ class SubcontractingContractNegotiationValidate extends BaseValidate
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
return $this->only(['id', 'subcontracting_contract_id', 'negotiation_name', 'negotiation_amount']);
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,5 +30,9 @@ class SubcontractingContractNegotiation extends BaseModel
|
||||
protected $name = 'subcontracting_contract_negotiation';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
public function contract()
|
||||
{
|
||||
return $this->belongsTo(\app\common\model\contract\SubcontractingContract::class, 'subcontracting_contract_id');
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user