优化打印

This commit is contained in:
2021-04-03 22:50:24 +08:00
parent bab69fb3a1
commit 4560ef7c93
5 changed files with 26 additions and 39 deletions
+11 -19
View File
@@ -737,36 +737,28 @@ class OrderController extends WorkflowController
$template = DB::table('model_template')->where('id', $template_id)->first();
$print_type = $template['print_type'];
$this->layout = 'layouts.print_'.$print_type;
$print_tpl = view()->exists(Request::controller().'.print.'.$template_id);
$form = [
'template' => $template,
];
if ($print_tpl) {
$data = OrderService::getPrintData($id);
$data['form'] = $form;
$data['template'] = $template;
$tpl = $this->display($data, 'print/'.$template_id);
//return $tpl;
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
}
if ($print_type == 'stiReport') {
$data = OrderService::getPrintData($id);
$print_data = [
'master' => [$data['master']],
'money' => $data['money'],
'customer_order_data' => $data['rows'],
];
return $this->display([
'template' => $template,
'print_data' => $print_data,
]);
} else {
$print_tpl = view()->exists(Request::controller().'.print.'.$template_id);
if ($print_tpl) {
$data = OrderService::getPrintData($id);
$data['template'] = $template;
$tpl = $this->display($data, 'print/'.$template_id);
} else {
$tpl = $this->create('print');
}
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
}
$tpl = $this->create('print');
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
}
public function dialog()
+1
View File
@@ -44,6 +44,7 @@ class OrderService
')
->get();
$master['fee_money'] = 0;
return [
'master' => $master,
'rows' => $rows,