diff --git a/app/workorder/controller/Index.php b/app/workorder/controller/Index.php index bae2cb4..426982b 100644 --- a/app/workorder/controller/Index.php +++ b/app/workorder/controller/Index.php @@ -25,7 +25,7 @@ class Index extends BaseController $list = WorkOrderList::withoutField('') ->where('delete_time', null) - ->order('status asc') + ->order(['status' => 'asc', 'id' => 'desc']) ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { $wo = WorkOrderList::where(['id' => $item->id])->find(); @@ -141,14 +141,26 @@ class Index extends BaseController { $param = get_params(); $id = isset($param['id']) ? $param['id'] : 0; - $detail = (new WorkOrderList())->detail($id); - // print_r($id); - if (empty($detail)) { - return to_assign(1, '2.信息不存在'); - } else { - View::assign('detail', $detail); - // print_r($detail); + if (empty($id)) { + return to_assign(1, '参数错误,缺少ID'); + } + $view = WorkOrderList::where('id', $id)->find(); + if ($view) { + $projectName = Db::name('Project')->where('id', $view['project_id'])->value('name_short'); + $view['project_id'] = $projectName ?: '-'; + if (!empty($view['contact'])) { + $view->contact = $view['contact']; + } else { + $view->contact = Db::name('Admin')->where('id', $view['creater'])->value('mobile') ?: '-'; + } + $adminName = Db::name('Admin')->where('id', $view['creater'])->value('name'); + $view->creater = $adminName ?: '-'; + $solveName = Db::name('Admin')->where('id', $view['solve'])->value('name'); + $view->solve = $solveName ?: '-'; + View::assign('view', $view); return view(); + } else { + return to_assign(1, '信息不存在'); } } diff --git a/app/workorder/view/index/add.html b/app/workorder/view/index/add.html index 23c7a82..3fcacfe 100644 --- a/app/workorder/view/index/add.html +++ b/app/workorder/view/index/add.html @@ -1,100 +1,129 @@
-

新建工单

- - - - - - - - - - - - - - - -
项目名称* - - - 问题类型* - - -
问题描述* - - -
备注 - - -
- -
- - -
-
- - \ No newline at end of file + +
+ + + + 备注 + + + + + + + +
+ + +
+ + + + \ No newline at end of file diff --git a/app/workorder/view/index/edit.html b/app/workorder/view/index/edit.html index 0dc79c6..38836bc 100644 --- a/app/workorder/view/index/edit.html +++ b/app/workorder/view/index/edit.html @@ -1,132 +1,195 @@
- -

处理工单

- - - - - - - -
分派处理人* - - - 工单状态* - - -
- -
- - -
- + + +

问题简述

+ + + + + + + +
项目问题 +
+ +
+
备注{$detail.remark}
+
+ \ No newline at end of file + }); + + \ No newline at end of file diff --git a/app/workorder/view/index/index.html b/app/workorder/view/index/index.html index e168dfa..1f96f17 100644 --- a/app/workorder/view/index/index.html +++ b/app/workorder/view/index/index.html @@ -3,7 +3,7 @@ {block name="breadcrumb"} 江苏美天科技 - 年度工单 + 工单管理 {/block} {block name="body"}
@@ -11,54 +11,9 @@
- - +
-
@@ -146,7 +101,9 @@ tool.open('/workorder/index/view/id/' + id, '工单详情'); } else if (obj.event === 'edit') { var id = data.id; - tool.open('/workorder/index/edit/id/' + id, '处理工单'); + var status = data.status; // 获取当前行的status + // 处理工单时带上status参数 + tool.open('/workorder/index/edit/id/' + id + '/status/' + status, '处理工单'); } else if (obj.event === 'delete') { var id = data.id; layui.layer.confirm('确定要删除该工单吗?', {icon: 3, title: '提示'}, function(index){ @@ -278,6 +235,7 @@ field: "remark", title: "备注", align: "center", + minWidth: 180, rowspan: 2, templet: function (d) { if (d.remark) { @@ -321,7 +279,7 @@ 处理工单 - 删除 + \ No newline at end of file