跟进重构

This commit is contained in:
xman 2025-05-31 18:07:49 +08:00
parent f67850dafe
commit 26cd36e2ec
4 changed files with 40 additions and 8 deletions

View File

@ -84,10 +84,7 @@ class Dispatch2 extends Backend
$row->btn_record = in_array($row->status, $this->model->btnActiveStatusList('btn_record')) && $this->auth->check('orders/dispatchrecord/add');
if(!in_array($row->status, $this->model->btnActiveStatusList('btn_record')) ){
if($row->follow != 2){ //如果节点维护正常,不会有种数据,所以不用担心循环的问题
$row->follow = 2;
$row->save();
}
$row->follow = 2;
}
if($row->btn_record){
if($row->type == 2)

View File

@ -9,6 +9,7 @@ use think\Exception;
use think\exception\DbException;
use think\exception\PDOException;
use think\exception\ValidateException;
use think\Hook;
use think\response\Json;
/**
@ -121,7 +122,20 @@ class Dispatchrecord extends Backend
if($dispatch->type == 1){
$timestamp = strtotime('+'.$params['notice_time'].' day'); // 获取明天同一时间的时间戳
$params['notice_time'] = date('Y-m-d', $timestamp) . ' 09:00:00'; // 拼接为明天的 9 点
$dispatch->work_progress = $params['rate'];
//$dispatch->work_progress = $params['rate'];
if(!empty($params['rate'])){ //修改任务的状态
if($dispatch->status != $params['rate']){
$dispatch->status = $params['rate'];
$dispatch->save();
$hookParams = [
'dispatch' => $dispatch,
'remark' => '管理员跟进:'.$this->auth->nickname.',备注内容:'.$params['remark'],
];
Hook::listen('order_dispatch_change', $hookParams);
}
}
}
$params['admin_id'] = $this->auth->id;
$result = $this->model->allowField(true)->save($params);

View File

@ -45,10 +45,19 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('进度')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('任务进度')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="range" id="rateRange" name="row[rate]" min="{$dispatch.work_progress}" max="100" value="0" oninput="document.getElementById('rateValue').innerText = this.value + '%'">
<span id="rateValue">0%</span>
<div class="radio">
<label><input type="radio" {if condition="$dispatch.status eq 10"}checked{/if} name="row[rate]" value="10"> 待预约</label>
<label><input type="radio" {if condition="$dispatch.status eq 20"}checked{/if} name="row[rate]" value="20"> 待上门</label>
<label><input type="radio" {if condition="$dispatch.status eq 30"}checked{/if} name="row[rate]" value="30"> 服务中</label>
</div>
<!-- const STATUS_GOTIT = 10; //已接-->
<!-- const STATUS_PLANIT = 20; //已预约-->
<!-- const STATUS_OVERTIME = 25; //超时(过了预约时间)-->
<!-- const STATUS_CLOCK = 30; //已打卡-->
</div>
</div>

View File

@ -119,6 +119,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
{field: 'arrive_time', title: __('上门时间'), operate:false, addclass:'datetimerange', autocomplete:false},
{field: 'arrive_image', title: __('上门照片'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
{field: 'estimated_finish_time', title: __('预估完成时间'), operate:false, addclass:'datetimerange', autocomplete:false},
{field: 'is_finish_today', title: __('预估时间能否完成'), operate:false,formatter: function(value, row, index) {
if (value === 1) {
return '<span style="color:green;">能</span>';
} else {
return '<span style="color:red;">不能</span>';
}
}},
{field: 'work_progress', title: __('进度'), operate:false},
// {field: 'is_notice', title: __('Is_notice'), searchList: {"0":__('Is_notice 0'),"1":__('Is_notice 1')}, formatter: Table.api.formatter.normal},
// {field: 'admin_id', title: __('Admin_id')},
{field: 'admin_user', title: __('Admin_user'), operate: 'LIKE'},