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; namespace app\admin\controller\orders;
use app\admin\model\OrderDispatch;
use app\common\controller\Backend; use app\common\controller\Backend;
use think\Db; use think\Db;
use think\Exception; use think\Exception;
@ -45,16 +46,18 @@ class Dispatchrecord extends Backend
* @return string * @return string
* @throws \think\Exception * @throws \think\Exception
*/ */
public function add() public function add($ids=null)
{ {
if (false === $this->request->isPost()) { 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',$dispatch);
$this->assign('dispatch_id',$dispatch_id);
$this->assign('records',$list); $this->assign('records',$list);

View File

@ -4,9 +4,9 @@
{notempty name='records'} {notempty name='records'}
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
{/notempty} {/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"> <div class="form-group">

View File

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