cmd
This commit is contained in:
parent
b50c182e24
commit
bb80209ffb
|
|
@ -119,7 +119,15 @@ class Dispatchrecord extends Backend
|
||||||
|
|
||||||
$params['admin_id'] = $this->auth->id;
|
$params['admin_id'] = $this->auth->id;
|
||||||
$result = $this->model->allowField(true)->save($params);
|
$result = $this->model->allowField(true)->save($params);
|
||||||
OrderDispatch::where('id',$params['dispatch_id'])->where('follow',0)->update(['follow'=>1]);
|
$dispatch = OrderDispatch::get($params['dispatch_id']);
|
||||||
|
|
||||||
|
if(empty($dispatch)){
|
||||||
|
$this->error('任务不存在');
|
||||||
|
}
|
||||||
|
$dispatch->follow = 1;
|
||||||
|
$dispatch->record_count += 1;
|
||||||
|
$dispatch->save();
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException|PDOException|Exception $e) {
|
} catch (ValidateException|PDOException|Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
return [
|
return [
|
||||||
'Dispatch_id' => '任务ID',
|
'Dispatch_id' => '任务ID',
|
||||||
'Worker_id' => '师傅ID',
|
'Worker_id' => '师傅ID',
|
||||||
'Remark' => '备注',
|
'Remark' => '跟进内容',
|
||||||
'Need_notice' => '是否提醒',
|
'Need_notice' => '是否提醒',
|
||||||
'Need_notice 0' => '不需要',
|
'Need_notice 0' => '不需要',
|
||||||
'Need_notice 1' => '需要',
|
'Need_notice 1' => '需要',
|
||||||
|
|
@ -12,7 +12,7 @@ return [
|
||||||
'Set status to 0'=> '设为未通知',
|
'Set status to 0'=> '设为未通知',
|
||||||
'Status 1' => '已通知',
|
'Status 1' => '已通知',
|
||||||
'Set status to 1'=> '设为已通知',
|
'Set status to 1'=> '设为已通知',
|
||||||
'Notice_time' => '提醒时间',
|
'Notice_time' => '下次跟进',
|
||||||
'Create_time' => '创建时间',
|
'Create_time' => '创建时间',
|
||||||
'Update_time' => '更新时间',
|
'Update_time' => '更新时间',
|
||||||
'Admin_id' => '管理员ID'
|
'Admin_id' => '管理员ID'
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('orders/dispatch/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('orders/dispatch/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<a href="javascript:;" class="btn btn-warning btn-disabled disabled btn-add-normal {:$auth->check('orders/abnormal/add')}?'':'hide'}" title="{:__('创建报错')}" ><i class="fa fa-plus"></i> {:__('创建报错')}</a>
|
<a href="javascript:;" class="btn btn-warning btn-disabled disabled btn-add-normal {:$auth->check('orders/abnormal/add')}?'':'hide'}" title="{:__('上报错误')}" ><i class="fa fa-plus"></i> {:__('上报错误')}</a>
|
||||||
|
|
||||||
<a href="javascript:;" class="btn btn-danger btn-cancel-selected btn-disabled disabled {:$auth->check('orders/dispatch2/del')?'':'hide'}" title="{:__('取消任务')}" ><i class="fa fa-trash"></i> {:__('取消任务')}</a>
|
<a href="javascript:;" class="btn btn-danger btn-cancel-selected btn-disabled disabled {:$auth->check('orders/dispatch2/del')?'':'hide'}" title="{:__('取消任务')}" ><i class="fa fa-trash"></i> {:__('取消任务')}</a>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<!--<div class="panel-lead"><em>多表格(Multitable)</em>用于展示在一个页面展示多个表格数据,并且每次切换时刷新</div>-->
|
<!--<div class="panel-lead"><em>多表格(Multitable)</em>用于展示在一个页面展示多个表格数据,并且每次切换时刷新</div>-->
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active"><a href="#first" data-toggle="tab">任务变更日志</a></li>
|
<li class="active"><a href="#first" data-toggle="tab">跟进记录</a></li>
|
||||||
<li><a href="#second" data-toggle="tab">跟进记录</a></li>
|
<li><a href="#second" data-toggle="tab">任务变更日志</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -21,5 +21,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,32 @@
|
||||||
<textarea id="c-remark" data-rule="required" class="form-control" placeholder="跟进内容" name="row[remark]" ></textarea>
|
<textarea id="c-remark" data-rule="required" class="form-control" placeholder="跟进内容" name="row[remark]" ></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('跟进依据')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-images" class="form-control" size="50" name="row[images]" type="text">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-images"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-images"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Notice_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-notice_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[notice_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Need_notice')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Need_notice')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
@ -23,19 +49,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Notice_time')}:</label>
|
|
||||||
<div class="col-xs-12 col-sm-8">
|
|
||||||
<input id="c-notice_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[notice_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<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">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('提交')}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,28 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
||||||
return '';
|
return '';
|
||||||
}},
|
}},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'follow',
|
||||||
|
title: '跟进状态',
|
||||||
|
searchList: {
|
||||||
|
'0':'待跟进',
|
||||||
|
"1": '已跟进',
|
||||||
|
"2": '已结束',
|
||||||
|
},
|
||||||
|
formatter: Table.api.formatter.label,
|
||||||
|
custom: {
|
||||||
|
'0': 'warning', // 待跟进:灰蓝色(默认 Bootstrap info)
|
||||||
|
'1': 'success', // 已跟进:绿色
|
||||||
|
'2': 'default', // 已结束:红色
|
||||||
|
},
|
||||||
|
defaultValue: '0'
|
||||||
|
},
|
||||||
|
|
||||||
|
{field: 'record_count', title: '跟进次数',operate: false},
|
||||||
|
|
||||||
{field: 'id', title: __('Id'), operate: '='},
|
{field: 'id', title: __('Id'), operate: '='},
|
||||||
|
|
||||||
|
|
||||||
//{field: 'order_id', title: __('Order_id')},
|
//{field: 'order_id', title: __('Order_id')},
|
||||||
|
|
||||||
{field: 'order.order_no', title: __('Order.order_no'), operate: '='},
|
{field: 'order.order_no', title: __('Order.order_no'), operate: '='},
|
||||||
|
|
@ -49,6 +70,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
||||||
formatter: Table.api.formatter.status,
|
formatter: Table.api.formatter.status,
|
||||||
custom:{25:"red"}
|
custom:{25:"red"}
|
||||||
},
|
},
|
||||||
|
//{field: 'follow', title: __('跟进状态'), searchList: {"0":__('待跟进'),"1":__('已跟进'),"2":__('已结束')}, formatter: Table.api.formatter.normal},
|
||||||
|
|
||||||
// {field: 'worker_id', title: __('Worker_id')},
|
// {field: 'worker_id', title: __('Worker_id')},
|
||||||
{field: 'worker_name', title: __('Worker_name'), operate: 'LIKE'},
|
{field: 'worker_name', title: __('Worker_name'), operate: 'LIKE'},
|
||||||
|
|
@ -66,9 +88,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
|
||||||
|
|
||||||
{field: 'follow', title: __('跟进状态'), searchList: {"0":__('待跟进'),"1":__('已跟进'),"2":__('已结束')}, formatter: Table.api.formatter.normal},
|
|
||||||
|
|
||||||
{field: 'order.source_shop', title: __('Order.source_shop'), operate: '='},
|
{field: 'order.source_shop', title: __('Order.source_shop'), operate: '='},
|
||||||
// {field: 'order.source', title: __('Order.source')},
|
// {field: 'order.source', title: __('Order.source')},
|
||||||
{field: 'order.customer', title: __('Order.customer'), operate: false},
|
{field: 'order.customer', title: __('Order.customer'), operate: false},
|
||||||
|
|
@ -179,54 +198,59 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹出确认框并要求输入文本
|
// 弹出确认框并要求输入文本
|
||||||
Layer.prompt({
|
|
||||||
title: "请输入操作理由",
|
Layer.open({
|
||||||
formType: 2, // 多行文本输入框
|
type: 1,
|
||||||
}, function (inputValue, index) {
|
title: '请输入操作理由',
|
||||||
|
area: ['450px', '280px'], // 宽高可调
|
||||||
|
btn: ['提交', '取消'],
|
||||||
|
content: '<div style="padding: 20px;">' +
|
||||||
|
'<div style="margin-bottom: 10px; color: #f39c12; font-size: 14px;">' +
|
||||||
|
'提示:取消后该订单会重新进入待派单状态' +
|
||||||
|
'</div>' +
|
||||||
|
'<textarea id="input-reason" class="form-control" rows="4" placeholder="请输入操作理由"></textarea>' +
|
||||||
|
'</div>',
|
||||||
|
yes: function(index, layero) {
|
||||||
|
var inputValue = $("#input-reason").val().trim();
|
||||||
|
|
||||||
if (!inputValue) {
|
if (!inputValue) {
|
||||||
Layer.alert("输入内容不能为空!");
|
Layer.msg('输入内容不能为空!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭弹出框
|
|
||||||
Layer.close(index);
|
Layer.close(index);
|
||||||
|
|
||||||
// 显示 loading 层
|
|
||||||
var loadingIndex = Layer.load(1, {
|
var loadingIndex = Layer.load(1, {
|
||||||
shade: [0.2, '#ccc'], // 背景遮罩,可选
|
shade: [0.2, '#ccc']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//这里可以加入 Ajax 请求处理逻辑
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'orders/dispatch2/del',
|
url: 'orders/dispatch2/del',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: {
|
data: {
|
||||||
ids: selectedIds,
|
ids: selectedIds, // 确保 selectedIds 已定义
|
||||||
reason: inputValue,
|
reason: inputValue
|
||||||
},
|
},
|
||||||
success: function (response,data) {
|
success: function(response) {
|
||||||
Layer.close(loadingIndex); // 关闭 loading
|
Layer.close(loadingIndex);
|
||||||
if (response.code == 1) {
|
if (response.code == 1) {
|
||||||
// 成功提示
|
Toastr.success(response.message || "操作成功!");
|
||||||
Toastr.success(data.message || "操作成功!");
|
|
||||||
// 刷新表格
|
|
||||||
table.bootstrapTable('refresh');
|
table.bootstrapTable('refresh');
|
||||||
} else {
|
} else {
|
||||||
Toastr.error(response.msg || "操作失败!");
|
Toastr.error(response.msg || "操作失败!");
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
Layer.close(loadingIndex); // 关闭 loading
|
Layer.close(loadingIndex);
|
||||||
Toastr.error("操作失败,请重试!");
|
Toastr.error("操作失败,请重试!");
|
||||||
return;
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// 获取选中项
|
// 获取选中项
|
||||||
|
|
|
||||||
|
|
@ -62,37 +62,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
// 表格1
|
// 表格1
|
||||||
var table1 = $("#table1");
|
var table1 = $("#table1");
|
||||||
table1.bootstrapTable({
|
table1.bootstrapTable({
|
||||||
url: 'orders/dispatchlog/index' + location.search,
|
|
||||||
toolbar: '#toolbar1',
|
|
||||||
sortName: 'id',
|
|
||||||
search: false,
|
|
||||||
commonSearch:false,
|
|
||||||
visible: false,
|
|
||||||
showToggle: false,
|
|
||||||
showColumns: false,
|
|
||||||
showExport: false,
|
|
||||||
columns: [
|
|
||||||
[
|
|
||||||
{field: 'id', title: __('Id')},
|
|
||||||
// {field: 'dispatch_id', title: __('Dispatch_id')},
|
|
||||||
//{field: 'order_id', title: __('Order_id')},
|
|
||||||
//{field: 'worker_id', title: __('Worker_id')},
|
|
||||||
// {field: 'status', title: __('Status')},
|
|
||||||
{field: 'status_text', title: __('Status_text'), operate: 'LIKE'},
|
|
||||||
{field: 'remark', title: __('Remark'), operate: 'LIKE', table: table1, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
||||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
||||||
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
// 为表格1绑定事件
|
|
||||||
Table.api.bindevent(table1);
|
|
||||||
},
|
|
||||||
second: function () {
|
|
||||||
// 表格2
|
|
||||||
var table2 = $("#table2");
|
|
||||||
table2.bootstrapTable({
|
|
||||||
url: 'orders/dispatchrecord/index' + location.search,
|
url: 'orders/dispatchrecord/index' + location.search,
|
||||||
/* extend: {
|
/* extend: {
|
||||||
index_url: '',
|
index_url: '',
|
||||||
|
|
@ -116,13 +85,47 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
//{field: 'dispatch_id', title: __('Dispatch_id')},
|
//{field: 'dispatch_id', title: __('Dispatch_id')},
|
||||||
//{field: 'worker_id', title: __('Worker_id')},
|
//{field: 'worker_id', title: __('Worker_id')},
|
||||||
{field: 'remark', title: __('跟进内容'), operate: 'LIKE', table: table2, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'remark', title: __('跟进内容'), operate: 'LIKE', table: table2, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'need_notice', title: __('需要提醒'), searchList: {"0":__('否'),"1":__('是')}, formatter: Table.api.formatter.normal},
|
{field: 'images', title: __('跟进依据'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
|
||||||
{field: 'notice_time', title: __('提醒时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
/* {field: 'need_notice', title: __('需要提醒'), searchList: {"0":__('否'),"1":__('是')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'notice_time', title: __('提醒时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},*/
|
||||||
{field: 'status', title: __('状态'), searchList: {"0":__('进行中'),"1":__('已完成')}, formatter: Table.api.formatter.status},
|
{field: 'status', title: __('状态'), searchList: {"0":__('进行中'),"1":__('已完成')}, formatter: Table.api.formatter.status},
|
||||||
{field: 'create_time', title: __('创建时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
{field: 'create_time', title: __('创建时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
//{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
//{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格1绑定事件
|
||||||
|
Table.api.bindevent(table1);
|
||||||
|
},
|
||||||
|
second: function () {
|
||||||
|
// 表格2
|
||||||
|
var table2 = $("#table2");
|
||||||
|
table2.bootstrapTable({
|
||||||
|
url: 'orders/dispatchlog/index' + location.search,
|
||||||
|
toolbar: '#toolbar1',
|
||||||
|
sortName: 'id',
|
||||||
|
search: false,
|
||||||
|
commonSearch:false,
|
||||||
|
visible: false,
|
||||||
|
showToggle: false,
|
||||||
|
showColumns: false,
|
||||||
|
showExport: false,
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
// {field: 'dispatch_id', title: __('Dispatch_id')},
|
||||||
|
//{field: 'order_id', title: __('Order_id')},
|
||||||
|
//{field: 'worker_id', title: __('Worker_id')},
|
||||||
|
// {field: 'status', title: __('Status')},
|
||||||
|
{field: 'status_text', title: __('Status_text'), operate: 'LIKE'},
|
||||||
|
{field: 'remark', title: __('Remark'), operate: 'LIKE', table: table1, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
|
]
|
||||||
|
]
|
||||||
});
|
});
|
||||||
// 为表格2绑定事件
|
// 为表格2绑定事件
|
||||||
Table.api.bindevent(table2);
|
Table.api.bindevent(table2);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user