Accept Merge Request #170: (feature/dgg -> develop)
Merge Request: feat: 【小程序】完成服务接口新增定金凭证,订单详情接口新增定金凭证。 Created By: @大狗哥 Accepted By: @大狗哥 URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/170?initial=true
This commit is contained in:
commit
6f1678b1d9
|
|
@ -62,6 +62,20 @@ class Order extends Model
|
|||
return $images;
|
||||
}
|
||||
|
||||
public function getOffImagesAttr($val)
|
||||
{
|
||||
if (empty($val)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$images = explode(',', $val);
|
||||
foreach ($images as $k => $v) {
|
||||
$images[$k] = cdnurl($v, true);
|
||||
}
|
||||
|
||||
return $images;
|
||||
}
|
||||
|
||||
public function getMaterialImagesAttr($val)
|
||||
{
|
||||
if (empty($val)) {
|
||||
|
|
|
|||
|
|
@ -234,6 +234,7 @@ class OrderDispatchService extends BaseService
|
|||
'is_material_used',
|
||||
'material_cost',
|
||||
'material_images',
|
||||
'off_images',
|
||||
];
|
||||
$orderDispatchFields = [
|
||||
'id',
|
||||
|
|
@ -396,8 +397,13 @@ class OrderDispatchService extends BaseService
|
|||
$orderDispatch->follow = 2;
|
||||
$orderDispatch->finish_time = $time;
|
||||
|
||||
// 材料相关
|
||||
$order = $this->getOrderModel()->where('id', $orderDispatch->order_id)->find();
|
||||
|
||||
// 定金核销凭证
|
||||
if (!empty($params['off_images'])) {
|
||||
$order->off_images = $this->removeStrCdnUrl($params['off_images']);
|
||||
}
|
||||
|
||||
// 是否使用材料
|
||||
$order->is_material_used = $params['is_material_used'];
|
||||
if ($order->is_material_used == 1) {
|
||||
|
|
@ -406,9 +412,10 @@ class OrderDispatchService extends BaseService
|
|||
$order->material_cost = $params['material_cost'];
|
||||
// 材料凭证图片组
|
||||
$order->material_images = $this->removeStrCdnUrl($params['material_images']);
|
||||
$order->save();
|
||||
}
|
||||
|
||||
$order->save();
|
||||
|
||||
if ($params['receive_type'] == 1) {
|
||||
$orderDispatch->image = $this->removeStrCdnUrl($params['payment_image']);
|
||||
$orderDispatch->offline_total_type = $params['offline_total_type'];
|
||||
|
|
|
|||
|
|
@ -28,10 +28,13 @@ class OrderDispatch extends Validate
|
|||
'estimated_finish_time|完成时间' => 'require|date',
|
||||
'work_progress|当前施工进度' => 'max:200',
|
||||
|
||||
//材料相关
|
||||
// 材料相关
|
||||
'is_material_used|是否使用材料' => 'require|in:0,1',
|
||||
'material_cost|材料成本' => 'requireIf:is_material_used,1|number|between:0,10000000',
|
||||
'material_images|材料凭证' => 'requireIf:is_material_used,1|max:1000',
|
||||
|
||||
// 定金核销凭证相关
|
||||
'off_images|定金核销凭证' => 'max:500',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
|
|
@ -44,7 +47,18 @@ class OrderDispatch extends Validate
|
|||
'info' => ['order_dispatch_id'],
|
||||
'appointmentTime' => ['order_dispatch_id', 'plan_time'],
|
||||
'arrivedOnSite' => ['order_dispatch_id', 'images'],
|
||||
'completeService' => ['order_dispatch_id', 'complete_images', 'offline_total_type', 'amount', 'payment_image', 'offline_total_type', 'is_material_used', 'material_cost', 'material_images'],
|
||||
'completeService' => [
|
||||
'order_dispatch_id',
|
||||
'complete_images',
|
||||
'offline_total_type',
|
||||
'amount',
|
||||
'payment_image',
|
||||
'offline_total_type',
|
||||
'is_material_used',
|
||||
'material_cost',
|
||||
'material_images',
|
||||
'off_images',
|
||||
],
|
||||
'saveWorkerRemark' => ['order_dispatch_id', 'worker_remark'],
|
||||
'updateProgress' => ['order_dispatch_id', 'is_finish_today', 'estimated_finish_time', 'work_progress'],
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user