Procházet zdrojové kódy

自定义会议

自定义会议
q před 1 rokem
rodič
revize
16c791d3a5

+ 1 - 0
.gitignore

@@ -5,3 +5,4 @@ nginx.htaccess
 .htaccess
 base_db.gz
 /webmain/webmainConfig.php~Stashed changes
+.user.ini

binární
images/logo.png


+ 1 - 0
web/res/js/jquery-changeuser.js

@@ -324,6 +324,7 @@
 			stotal = parseFloat(a.stotal);
 			for(i=0;i<len;i++){
 				spath = this.userarr[i].deptpath;
+				if(spath==null) continue;
 				if(spath.indexOf('['+a.id+']')>=0)nstotal++;
 			}
 			if(nstotal<stotal){

+ 4 - 0
webmain/flow/input/inputjs/mode_meeting.js

@@ -0,0 +1,4 @@
+//流程模块【meeting.会议审批】下录入页面自定义js页面,初始函数
+function initbodys(){
+	
+}

+ 31 - 0
webmain/flow/input/mode_meetingAction.php

@@ -0,0 +1,31 @@
+<?php
+/**
+*	此文件是流程模块【meeting.会议审批】对应控制器接口文件。
+*/ 
+class mode_meetingClassAction extends inputAction{
+	
+	/**
+	*	重写函数:保存前处理,主要用于判断是否可以保存
+	*	$table String 对应表名
+	*	$arr Array 表单参数
+	*	$id Int 对应表上记录Id 0添加时,大于0修改时
+	*	$addbo Boolean 是否添加时
+	*	return array('msg'=>'错误提示内容','rows'=> array()) 可返回空字符串,或者数组 rows 是可同时保存到数据库上数组
+	*/
+	protected function savebefore($table, $arr, $id, $addbo){
+		
+	}
+	
+	/**
+	*	重写函数:保存后处理,主要保存其他表数据
+	*	$table String 对应表名
+	*	$arr Array 表单参数
+	*	$id Int 对应表上记录Id
+	*	$addbo Boolean 是否添加时
+	*/	
+	protected function saveafter($table, $arr, $id, $addbo){
+		
+	}
+
+
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 38 - 1
webmain/flow/page/input_meet.html


+ 67 - 0
webmain/flow/page/input_meeting.html

@@ -0,0 +1,67 @@
+<table width="100%" border="0" class="ke-zeroborder">
+    <tbody>
+    <tr class="autoyijianview">
+        <td height="34" width="15%" align="right" class="ys1">*^apply_date^</td>
+        <td width="35%" class="ys2" colspan="3">{apply_date}</td>
+    </tr>
+    <tr>
+        <td height="34" width="15%" align="right" class="ys1">*^apply_dept^</td>
+        <td width="35%" class="ys2">{apply_dept}{apply_dept_id}</td>
+    </tr>
+    <tr>
+        <td height="34" width="15%" align="right" class="ys1">*^attn^</td>
+        <td width="35%" class="ys2">{attn}{attn_id}</td>
+        <td height="34" width="15%" align="right" class="ys1">*^mobile^</td>
+        <td width="35%" class="ys2">{mobile}</td>
+    </tr>
+    <tr>
+        <td height="34" width="15%" align="right" class="ys1">*^meeting_time^</td>
+        <td width="35%" class="ys2">{meeting_time}</td>
+        <td height="34" width="15%" align="right" class="ys1">*^end_time^</td>
+        <td width="35%" class="ys2">{end_time}</td>
+    </tr>
+    <tr>
+        <td height="34" align="right" class="ys1">*^attendees^</td>
+        <td colspan="3" class="ys2">{attendees}</td>
+    </tr>
+    <tr>
+        <td height="34" align="right" class="ys1">*^title^</td>
+        <td colspan="3" class="ys2" colspan="3">{title}</td>
+    </tr>
+    <tr>
+        <td height="34" width="15%" align="right" class="ys1">*^meeting_room^</td>
+        <td width="35%" class="ys2">{meeting_room}</td>
+        <td height="34" align="right" class="ys1"></td>
+        <td class="ys2"></td>
+    </tr>
+    <tr>
+        <td height="34" align="right" class="ys1">^remark^</td>
+        <td colspan="3" class="ys2">{remark}</td>
+    </tr>
+    <tr>
+        <td class="ys2" style="background-color:#CCCCCC;" colspan="4"><strong>会议议题</strong></td>
+    </tr>
+    <tr>
+        <td class="ys0" colspan="4">
+            <table class="tablesub ke-zeroborder" id="tablesub0" style="width:100%;" border="0" cellspacing="0"
+                   cellpadding="0">
+                <tbody>
+                <tr>
+                    <td width="10%">序号</td>
+                    <td>*会议议题</td>
+                    <td>参与人员</td>
+                    <td width="5%">操作</td>
+                </tr>
+                <tr>
+                    <td>[xuhao0,0]</td>
+                    <td>[topic_title0,0]</td>
+                    <td>[topic_attendee0,0][topic_state0,0]</td>
+                    <td>{删,0}</td>
+                </tr>
+                </tbody>
+            </table>
+            <div style="background-color:#F1F1F1;">{新增,0}</div>
+        </td>
+    </tr>
+    </tbody>
+</table>

+ 8 - 0
webmain/flow/page/input_meeting_room.html

@@ -22,5 +22,13 @@
             {desc}
         </td>
     </tr>
+    <tr>
+        <td height="34" align="right" class="ys1">
+            ^mac^
+        </td>
+        <td colspan="3" class="ys2">
+            {mac}
+        </td>
+    </tr>
     </tbody>
 </table>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 59 - 0
webmain/flow/page/rock_page_meeting.php


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
webmain/flow/page/view_meeting_0.html


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
webmain/flow/page/view_meeting_2.html


+ 91 - 0
webmain/model/flow/meetingModel.php

@@ -0,0 +1,91 @@
+<?php
+
+class flow_meetingClassModel extends flowModel
+{
+
+    public $hyarra, $hyarrb, $dbobj, $reatearr;
+
+    public function initModel()
+    {
+        $this->hyarra 	= array('正常','会议中','结束','取消');
+        $this->hyarrb 	= array('green','blue','#ff6600','#888888');
+        $this->dbobj	= c('date');
+
+        $this->reatearr = array(
+            'd' => '每天',
+            'w1' => '每周一',
+            'w2' => '每周二',
+            'w3' => '每周三',
+            'w4' => '每周四',
+            'w5' => '每周五',
+            'w6' => '每周六',
+            'w7' => '每周日',
+            'm' => '每月',
+            'y' => '每年',
+        );
+    }
+
+    // 初始化单据可替换其他属性,$lx,0默认,1详情展示,2列表显示,3打印页,4外部详情页
+    public function flowrsreplace($rs, $lx=0)
+    {
+
+        $zt 		 = $rs['state'];
+        $nzt 		 = $zt;
+        $time 		 = time();
+
+        $stime 	= strtotime($rs['meeting_time']);
+
+        if($zt < 2){
+            if($stime>$time){
+                // 开始时间大于当前时间,认为会议开始
+                $nzt = 0;
+            } if ($nzt != 2 || $nzt != 3) {
+                // 状态不是取消、结束,则赋值“正常”
+                $nzt = 1;
+            }
+        }
+        // 更新数据状态
+        if($zt != $nzt){
+            $this->update('state='.$nzt.'', $rs['id']);
+            $zt = $nzt;
+        }
+
+        // 将id转换为文字
+        $rs['state'] = $this->getstatezt($zt);
+
+        return $rs;
+    }
+
+    public function getstatezt($zt)
+    {
+        return '<font color="'.$this->hyarrb[$zt].'">'.$this->hyarra[$zt].'</font>';
+    }
+
+    // $ors当前单据操作信息,$crs提交过来的信息
+    public function flowoptmenu($ors, $crs)
+    {
+        if ($ors['num'] == 'delnoup') {
+
+        }
+        return null;
+    }
+
+    //删除单据时调用
+    public function flowdeletebill($sm) {
+//        m('meet_sys')->deleteMeetingRoom($this->rs);
+    }
+
+    //流程全部完成后调用
+    public function flowcheckfinsh($sm) {
+    }
+
+    //提交时调用
+    protected function flowsubmit($na, $sm) {
+
+        if ($this->id == null) {
+            return ;
+        }
+
+    }
+
+}

+ 138 - 0
webmain/task/openapi/openmeetAction.php

@@ -0,0 +1,138 @@
+<?php
+
+/**
+ *    会议相关
+ *    请求地址如:http://oa.test/api.php?m=openmeet&a=test&openkey=fee5efd3a93ca5c6a85b679cde60faa2
+ */
+class openmeetClassAction extends openapiAction
+{
+
+    public function testAction() {
+        $str = $this->postdata;
+        return json_encode($str);
+    }
+
+    // 绑定设备
+    public function bindDeviceAction() {
+        $rawArr = $this->getpostarr();
+
+        if (!isset($rawArr['device_id'])) {
+            return [
+                "code"=>-1,
+                "message"=>"参数错误!"
+            ];
+        }
+
+        $rawData = m('meeting_room')->getone(" mac like '%{$rawArr['device_id']}%'", "id");
+        if ($rawData['id'] ?? 0 > 0) {
+            return [
+                "code"=>1,
+                "message"=>"已绑定",
+                "data"=>[
+                    "room_id"=>$rawData['id']
+                ]
+            ];
+        } else {
+            return [
+                "code"=>0,
+                "message"=>"未绑定"
+            ];
+        }
+    }
+
+    // 获取会议信息
+    public function getMeetInfoAction() {
+        $rawArr = $this->getpostarr();
+
+        if (!isset($rawArr['room_id'])) {
+            return [
+                "code"=>-1,
+                "message"=>"参数错误!"
+            ];
+        }
+
+        $rawData = m('meeting_room')->getone(" id = '{$rawArr['room_id']}'");
+
+        $meetData = m('meeting')->getone(" state = 1 and meeting_room = '{$rawData['room_name']}'");
+
+        $topics = $this->db->getall("select `id`, `topic_title`, `topic_attendee`, `topic_state` from `[Q]topics` where mid = {$meetData['id']} order by sort");
+
+        $res=[
+            "code"=>1,
+            "message"=>"请求成功!",
+            "data"=>[
+                "meet_id"=>$rawData['id'],
+                "room_name"=>$rawData['room_name'],
+                "meet_title"=>$meetData['title'],
+                "meet_time"=>$meetData['meeting_time'],
+                "attendees"=>$meetData['attendees'],
+                "topics"=>$topics
+            ]
+        ];
+        return $res;
+    }
+
+    // 切换议题
+    public function switchTopicsAction() {
+        $rawArr = $this->getpostarr();
+
+        if (!isset($rawArr['meet_id']) || !isset($rawArr['topic_id'])) {
+            return [
+                "code"=>-1,
+                "message"=>"参数错误!"
+            ];
+        }
+
+        // 获取议题信息
+        $topics = $this->db->getall("select `id`, `topic_title`, `topic_attendee`, `topic_attendee_id`, `topic_state` from `[Q]topics` where mid = {$rawArr['meet_id']} order by sort");
+
+        $topic_id = $rawArr['topic_id'];
+
+        for ($i = 0; $i < count($topics); $i++) {
+            $info = $topics[$i];
+            if ($topic_id == $info['id']) {
+                $topics[$i]['topic_state'] = $topics[$i]['topic_state'] + 1;
+                $topics[$i]['topic_state_info'] = $this->topicState($topics[$i]['topic_state']);
+                if (isset($topics[$i - 1])) {
+                    $topics[$i-1]['topic_state'] = $topics[$i-1]['topic_state'] + 1;
+                    $topics[$i-1]['topic_state_info'] = $this->topicState($topics[$i-1]['topic_state']);
+                }
+
+                if (isset($topics[$i + 1])) {
+                    $topics[$i+1]['topic_state'] = $topics[$i+1]['topic_state'] + 1;
+                    $topics[$i+1]['topic_state_info'] = $this->topicState($topics[$i+1]['topic_state']);
+                }
+                // 发送短信给 topic_attendee_id
+
+            } else {
+                $topics[$i]['topic_state_info'] = $this->topicState($topics[$i]['topic_state']);
+            }
+        }
+
+        return [
+            "code"=>1,
+            "message"=>"切换成功!",
+            "data"=>$topics
+        ];
+
+    }
+
+    protected function topicState($code): string
+    {
+        $info = '等待';
+        switch ($code) {
+            case 1:
+                $info = '待进行';
+                break;
+            case 2:
+                $info = '进行中';
+                break;
+            case 3:
+                $info = '已进行';
+                break;
+
+        }
+        return $info;
+    }
+
+}