This commit is contained in:
xman 2025-04-01 18:19:15 +08:00
parent 11a4ff1916
commit ee367f5a76
3 changed files with 11 additions and 10 deletions

View File

@ -2,6 +2,7 @@
namespace app\admin\controller\orders;
use app\admin\model\OrderDispatch;
use app\common\controller\Backend;
use think\Db;
use think\Exception;
@ -45,16 +46,18 @@ class Dispatchrecord extends Backend
* @return string
* @throws \think\Exception
*/
public function add()
public function add($ids=null)
{
if (false === $this->request->isPost()) {
$dispatch_id = $this->request->get('dispatch_id');
$dispatch = OrderDispatch::get($ids);
if(empty($dispatch)){
$this->error('没有关联派单');
}
$list = $this->model->where('dispatch_id',$ids)->order('id','desc')->select();
$list = $this->model->where('dispatch_id',$dispatch_id)->order('id','desc')->select();
$this->assign('dispatch_id',$dispatch_id);
$this->assign('dispatch',$dispatch);
$this->assign('records',$list);

View File

@ -4,9 +4,9 @@
{notempty name='records'}
<div class="col-xs-12 col-sm-6">
{/notempty}
<input type="hidden" name="row[dispatch_id]" type="text" value="$dispatch.id">
<input type="hidden" name="row[dispatch_id]" value="{$dispatch.id|htmlentities}">
<input type="hidden" name="row[worker_id]" type="text" value="$dispatch.worker_id">
<input type="hidden" name="row[worker_id]" value="{$dispatch.worker_id|htmlentities}">
<div class="form-group">

View File

@ -111,9 +111,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
text:"完成",
title:"完成",
icon: 'fa fa-check',
url: function(row){
return 'orders/dispatch2/finish?dispatch_id='+row.id;
},
url:'orders/dispatch2/finish',
extend: 'data-toggle="tooltip" data-container="body"',
classname: 'btn btn-xs btn-success btn-dialog',
visible:function(row){