|
@@ -0,0 +1,47 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+class flow_goods_transportClassModel extends flowModel
|
|
|
+{
|
|
|
+ public $classes = ["早","中","晚"];
|
|
|
+ // 初始化单据可替换其他属性,$lx,0默认,1详情展示,2列表显示,3打印页,4外部详情页
|
|
|
+ public function flowrsreplace($rs, $lx=0)
|
|
|
+ {
|
|
|
+ $rs['classes'] = $this->classes[$rs['classes']];
|
|
|
+ $dept_info = m('dept')->getone($rs['dept']);
|
|
|
+ $rs['dept'] = $dept_info['name'];
|
|
|
+ if (!empty($rs['dgoods'])) {
|
|
|
+ $rs['dgoods'] = "<font color='#9e9e9e'>".str_replace(array("\r\n", "\n", "\r"), '、', $rs['dgoods'])."</font>";
|
|
|
+ }
|
|
|
+ if (!empty($rs['rgoods'])) {
|
|
|
+ $rs['rgoods'] = "<font color='#9e9e9e'>".str_replace(array("\r\n", "\n", "\r"), '、', $rs['rgoods'])."</font>";
|
|
|
+ }
|
|
|
+ $rs['state_info'] = $this->getApproval($rs['nowcheckname'] ?? ''); // 当前审核人
|
|
|
+ return $rs;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //审核之前调用$zt 状态, $sm说明
|
|
|
+ protected function flowcheckbefore($zt, $sm) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //审核完成后调用
|
|
|
+ protected function flowcheckafter($zt, $sm){
|
|
|
+ if ($this->nowcourse['step'] == 3) {
|
|
|
+ $this->update(['driver_id'=>$this->nowcourse['nowchedkid'], 'driver'=>$this->nowcourse['nowcheckname']], ['id'=>$this->id]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 审核样式
|
|
|
+ public function getApproval($names) {
|
|
|
+
|
|
|
+ if (empty($names)) {
|
|
|
+ $html = '<font style="background-color:#00c959; padding: 2px 8px; border-radius: 4px; color: #fff">已审核</font>';
|
|
|
+ return $html;
|
|
|
+ } else {
|
|
|
+ $html = '<font style="background-color:#ff4974; padding: 2px 8px; border-radius: 4px; color: #fff">待审核</font><br /><font style="color: #ff4974">审核人:'.$names.'</font>';
|
|
|
+ return $html;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|