Accept Merge Request #88: (feature/dgg -> develop)
Merge Request: feat: 【后台配置订单列表】新增是否使用材料、材料凭证图片组字段 Created By: @大狗哥 Accepted By: @大狗哥 URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/88
This commit is contained in:
commit
7708573526
|
|
@ -61,4 +61,18 @@ class Order extends Model
|
||||||
|
|
||||||
return $images;
|
return $images;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialImagesAttr($val)
|
||||||
|
{
|
||||||
|
if (empty($val)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$images = explode(',', $val);
|
||||||
|
foreach ($images as $k => $v) {
|
||||||
|
$images[$k] = cdnurl($v, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $images;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,9 @@ class OrderDispatchService extends BaseService
|
||||||
'images',
|
'images',
|
||||||
'status',
|
'status',
|
||||||
'coupon_id',
|
'coupon_id',
|
||||||
|
'is_material_used',
|
||||||
|
'material_cost',
|
||||||
|
'material_images',
|
||||||
];
|
];
|
||||||
$orderDispatchFields = [
|
$orderDispatchFields = [
|
||||||
'id',
|
'id',
|
||||||
|
|
@ -384,6 +387,18 @@ class OrderDispatchService extends BaseService
|
||||||
$orderDispatch->images = $this->removeStrCdnUrl($params['complete_images']);
|
$orderDispatch->images = $this->removeStrCdnUrl($params['complete_images']);
|
||||||
$orderDispatch->finish_time = $time;
|
$orderDispatch->finish_time = $time;
|
||||||
|
|
||||||
|
// 材料相关
|
||||||
|
$order = $this->getOrderModel()->where('id', $orderDispatch->order_id)->find();
|
||||||
|
// 是否使用材料
|
||||||
|
$order->is_material_used = $params['is_material_used'];
|
||||||
|
if ($order->is_material_used == 1) {
|
||||||
|
// 材料成本
|
||||||
|
$order->material_cost = $params['material_cost'];
|
||||||
|
// 材料凭证图片组
|
||||||
|
$order->material_images = $this->removeStrCdnUrl($params['material_images']);
|
||||||
|
$order->save();
|
||||||
|
}
|
||||||
|
|
||||||
if ($params['receive_type'] == 1) {
|
if ($params['receive_type'] == 1) {
|
||||||
$orderDispatch->image = $this->removeStrCdnUrl($params['payment_image']);
|
$orderDispatch->image = $this->removeStrCdnUrl($params['payment_image']);
|
||||||
$orderDispatch->offline_total_type = $params['offline_total_type'];
|
$orderDispatch->offline_total_type = $params['offline_total_type'];
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,11 @@ class OrderDispatch extends Validate
|
||||||
'is_finish_today|今日完成' => 'require|in:0,1',
|
'is_finish_today|今日完成' => 'require|in:0,1',
|
||||||
'estimated_finish_time|完成时间' => 'require|date',
|
'estimated_finish_time|完成时间' => 'require|date',
|
||||||
'work_progress|当前施工进度' => 'max:200',
|
'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',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $message = [
|
protected $message = [
|
||||||
|
|
@ -39,7 +44,7 @@ class OrderDispatch extends Validate
|
||||||
'info' => ['order_dispatch_id'],
|
'info' => ['order_dispatch_id'],
|
||||||
'appointmentTime' => ['order_dispatch_id', 'plan_time'],
|
'appointmentTime' => ['order_dispatch_id', 'plan_time'],
|
||||||
'arrivedOnSite' => ['order_dispatch_id', 'images'],
|
'arrivedOnSite' => ['order_dispatch_id', 'images'],
|
||||||
'completeService' => ['order_dispatch_id', 'complete_images', 'offline_total_type', 'amount', 'payment_image', 'offline_total_type'],
|
'completeService' => ['order_dispatch_id', 'complete_images', 'offline_total_type', 'amount', 'payment_image', 'offline_total_type', 'is_material_used', 'material_cost', 'material_images'],
|
||||||
'saveWorkerRemark' => ['order_dispatch_id', 'worker_remark'],
|
'saveWorkerRemark' => ['order_dispatch_id', 'worker_remark'],
|
||||||
'updateProgress' => ['order_dispatch_id', 'is_finish_today', 'estimated_finish_time', 'work_progress'],
|
'updateProgress' => ['order_dispatch_id', 'is_finish_today', 'estimated_finish_time', 'work_progress'],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
{field: 'refund_amount', title: __('Refund_amount'), operate:false},
|
{field: 'refund_amount', title: __('Refund_amount'), operate:false},
|
||||||
{field: 'real_amount', title: __('Real_amount'), operate:false},
|
{field: 'real_amount', title: __('Real_amount'), operate:false},
|
||||||
{field: 'cost', title: __('Cost'), operate:false},
|
{field: 'cost', title: __('Cost'), operate:false},
|
||||||
{field: 'material_cost', title: __('材料成本'), operate:false},
|
{
|
||||||
|
field: 'material_cost_text', title: '材料成本',
|
||||||
|
operate: false,
|
||||||
|
cellStyle: {css: {"text-align": "left !important"}},
|
||||||
|
formatter: function (val, row) {
|
||||||
|
if (row.is_material_used === 1) {
|
||||||
|
return `¥${row.material_cost}`
|
||||||
|
}
|
||||||
|
return '无'
|
||||||
|
}},
|
||||||
|
{field: 'material_images', title: __('材料凭证'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
|
||||||
{field: 'performance', title: __('Performance'), operate:false},
|
{field: 'performance', title: __('Performance'), operate:false},
|
||||||
|
|
||||||
// {field: 'dispatch_type', title: __('Dispatch_type')},
|
// {field: 'dispatch_type', title: __('Dispatch_type')},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user