优化打印
This commit is contained in:
parent
bab69fb3a1
commit
4560ef7c93
|
@ -737,36 +737,28 @@ class OrderController extends WorkflowController
|
||||||
$template = DB::table('model_template')->where('id', $template_id)->first();
|
$template = DB::table('model_template')->where('id', $template_id)->first();
|
||||||
$print_type = $template['print_type'];
|
$print_type = $template['print_type'];
|
||||||
$this->layout = 'layouts.print_'.$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') {
|
if ($print_type == 'stiReport') {
|
||||||
$data = OrderService::getPrintData($id);
|
$data = OrderService::getPrintData($id);
|
||||||
$print_data = [
|
$print_data = [
|
||||||
'master' => [$data['master']],
|
'master' => [$data['master']],
|
||||||
'money' => $data['money'],
|
|
||||||
'customer_order_data' => $data['rows'],
|
'customer_order_data' => $data['rows'],
|
||||||
];
|
];
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'template' => $template,
|
'template' => $template,
|
||||||
'print_data' => $print_data,
|
'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()
|
public function dialog()
|
||||||
|
|
|
@ -44,6 +44,7 @@ class OrderService
|
||||||
')
|
')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
$master['fee_money'] = 0;
|
||||||
return [
|
return [
|
||||||
'master' => $master,
|
'master' => $master,
|
||||||
'rows' => $rows,
|
'rows' => $rows,
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
// 加载数据
|
// 加载数据
|
||||||
var dataSet = new Stimulsoft.System.Data.DataSet("data");
|
var dataSet = new Stimulsoft.System.Data.DataSet("data");
|
||||||
dataSet.readJson(printData);
|
dataSet.readJson(printData);
|
||||||
|
|
||||||
report.dictionary.clear();
|
report.dictionary.clear();
|
||||||
report.regData("data", "data", dataSet);
|
report.regData("data", "data", dataSet);
|
||||||
report.dictionary.synchronize();
|
report.dictionary.synchronize();
|
||||||
|
|
|
@ -302,39 +302,31 @@ class DeliveryController extends WorkflowController
|
||||||
$template_id = Request::get('template_id');
|
$template_id = Request::get('template_id');
|
||||||
$template = DB::table('model_template')->where('id', $template_id)->first();
|
$template = DB::table('model_template')->where('id', $template_id)->first();
|
||||||
$print_type = $template['print_type'];
|
$print_type = $template['print_type'];
|
||||||
// 存在打印模板
|
|
||||||
$print_tpl = view()->exists(Request::controller().'.print.'.$template_id);
|
|
||||||
$this->layout = 'layouts.print_'.$print_type;
|
|
||||||
$form = [
|
|
||||||
'template' => $template,
|
|
||||||
];
|
|
||||||
|
|
||||||
// 自定义模板
|
$this->layout = 'layouts.print_'.$print_type;
|
||||||
if ($print_tpl) {
|
|
||||||
$data = DeliveryService::getPrintData($id);
|
|
||||||
$data['form'] = $form;
|
|
||||||
$data['template'] = $template;
|
|
||||||
$tpl = $this->display($data, 'print/'.$template_id);
|
|
||||||
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 打印插件
|
// 打印插件
|
||||||
if ($print_type == 'stiReport') {
|
if ($print_type == 'stiReport') {
|
||||||
$data = DeliveryService::getPrintData($id);
|
$data = DeliveryService::getPrintData($id);
|
||||||
$print_data = [
|
$print_data = [
|
||||||
'master' => [$data['master']],
|
'master' => [$data['master']],
|
||||||
'money' => $data['money'],
|
|
||||||
'stock_delivery_data' => $data['rows'],
|
'stock_delivery_data' => $data['rows'],
|
||||||
];
|
];
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'template' => $template,
|
'template' => $template,
|
||||||
'print_data' => $print_data,
|
'print_data' => $print_data,
|
||||||
]);
|
]);
|
||||||
|
} else {
|
||||||
|
$print_tpl = view()->exists(Request::controller().'.print.'.$template_id);
|
||||||
|
if ($print_tpl) {
|
||||||
|
$data = DeliveryService::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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 物流信息
|
// 物流信息
|
||||||
|
|
|
@ -53,9 +53,10 @@ class DeliveryService
|
||||||
->whereRaw("p.code = '99001'")
|
->whereRaw("p.code = '99001'")
|
||||||
->sum("money");
|
->sum("money");
|
||||||
|
|
||||||
|
$master['fee_money'] = $money;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'master' => $master,
|
'master' => $master,
|
||||||
'money' => $money,
|
|
||||||
'rows' => $rows,
|
'rows' => $rows,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue