Pārlūkot izejas kodu

新增党委会议类型

q 1 gadu atpakaļ
vecāks
revīzija
54a8092ccf

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

@@ -2,7 +2,7 @@
 function initbodys(){
 
     // 开始时间
-    $(form('meeting_time')).blur(function(){
+    $(form('start_time')).blur(function(){
         changetotal();
     });
     // 结束时间
@@ -14,8 +14,8 @@ function initbodys(){
 
 
 function changesubmit(d){
-    if(d.end_time<=d.meeting_time)return '截止时间必须大于开始时间';
-    if(d.end_time.substr(0,10)!=d.meeting_time.substr(0,10)){
+    if(d.end_time<=d.start_time)return '截止时间必须大于开始时间';
+    if(d.end_time.substr(0,10)!=d.start_time.substr(0,10)){
         return '不允许跨天申请';
     }
     // if(d.type=='1' && d.rate=='')return '固定会议必须选择会议频率';
@@ -23,7 +23,7 @@ function changesubmit(d){
 
 
 function changetotal(){
-    var st = form('meeting_time').value,
+    var st = form('start_time').value,
         et = form('end_time').value;
     if(st.substr(0,10)!=et.substr(0,10)){
         js.setmsg('不允许跨天申请');

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

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

+ 1 - 1
webmain/flow/input/mode_meetingAction.php

@@ -14,7 +14,7 @@ class mode_meetingClassAction extends inputAction{
 	*/
 	protected function savebefore($table, $arr, $id, $addbo){
 //        if(arrvalue($arr,'type')=='1')return ''; //固定会议不需要判断
-        return m('meeting')->isapplymsg($arr['meeting_time'], $arr['end_time'], $arr['meeting_room'], $id);
+        return m('meeting')->isapplymsg($arr['start_time'], $arr['end_time'], $arr['meeting_room'], $id);
 	}
 	
 	/**

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

@@ -0,0 +1,31 @@
+<?php
+/**
+*	此文件是流程模块【meeting_key.党委会议】对应控制器接口文件。
+*/ 
+class mode_meeting_keyClassAction 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){
+        // 检查会议是否冲突
+        return m('meeting')->isapplymsg($arr['start_time'], $arr['end_time'], $arr['meeting_room'], $id);
+	}
+	
+	/**
+	*	重写函数:保存后处理,主要保存其他表数据
+	*	$table String 对应表名
+	*	$arr Array 表单参数
+	*	$id Int 对应表上记录Id
+	*	$addbo Boolean 是否添加时
+	*/	
+	protected function saveafter($table, $arr, $id, $addbo){
+		
+	}
+}	
+			

+ 2 - 27
webmain/flow/page/input_meeting.html

@@ -15,8 +15,8 @@
         <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">*^start_time^</td>
+        <td width="35%" class="ys2">{start_time}</td>
         <td height="34" width="15%" align="right" class="ys1">*^end_time^</td>
         <td width="35%" class="ys2">{end_time}</td>
     </tr>
@@ -38,30 +38,5 @@
         <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>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
webmain/flow/page/input_meeting_key.html


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 7 - 7
webmain/flow/page/rock_page_meeting.php


+ 59 - 0
webmain/flow/page/rock_page_meeting_key.php

@@ -0,0 +1,59 @@
+<?php
+/**
+*	模块:meeting_key.党委会议
+*	说明:自定义区域内可写你想要的代码
+*	来源:流程模块→表单元素管理→[模块.党委会议]→生成列表页
+*/
+defined('HOST') or die ('not access');
+?>
+<script>
+$(document).ready(function(){
+	{params}
+	var modenum = 'meeting_key',modename='党委会议',isflow=0,modeid='163',atype = params.atype,pnum=params.pnum,modenames='会议议题,会议请假',listname='bWVldGluZ19rZXk:';
+	if(!atype)atype='';if(!pnum)pnum='';
+	var fieldsarr = [],fieldsselarr= [],chufarr= [];
+	
+	<?php
+	include_once('webmain/flow/page/rock_page.php');
+	?>
+	
+//[自定义区域start]
+
+
+
+//[自定义区域end]
+	c.initpagebefore();
+	js.initbtn(c);
+	var a = $('#view'+modenum+'_{rand}').bootstable(bootparams);
+	c.init();
+	
+});
+</script>
+<!--SCRIPTend-->
+<!--HTMLstart-->
+<div>
+	<table width="100%">
+	<tr>
+		<td style="padding-right:10px;" id="tdleft_{rand}" nowrap><button id="addbtn_{rand}" class="btn btn-primary" click="clickwin,0" disabled type="button"><i class="icon-plus"></i> <?=lang('新增')?></button></td>
+		
+		<td><select class="form-control" style="width:110px;border-top-right-radius:0;border-bottom-right-radius:0;padding:0 2px" id="fields_{rand}"></select></td>
+		<td><select class="form-control" style="width:60px;border-radius:0px;border-left:0;padding:0 2px" id="like_{rand}"><option value="0"><?=lang('包含')?></option><option value="1"><?=lang('等于')?></option><option value="2"><?=lang('大于')?><?=lang('等于')?></option><option value="3"><?=lang('小于')?><?=lang('等于')?></option><option value="4"><?=lang('不包含')?></option></select></td>
+		<td><select class="form-control" style="width:130px;border-radius:0;border-left:0;display:none;padding:0 5px" id="selkey_{rand}"><option value="">-<?=lang('请选择')?>-</option></select><input class="form-control" style="width:130px;border-radius:0;border-left:0;padding:0 5px" id="keygj_{rand}" placeholder="<?=lang('关键字')?>"><input class="form-control" style="width:130px;border-radius:0;border-left:0;padding:0 5px;display:none;" id="key_{rand}" placeholder="<?=lang('关键字')?>">
+		</td>
+		
+		<td>
+			<div style="white-space:nowrap">
+			<button style="border-right:0;border-radius:0;border-left:0" class="btn btn-default" click="searchbtn" type="button"><?=lang('搜索')?></button><button class="btn btn-default" id="downbtn_{rand}" type="button" style="padding-left:8px;padding-right:8px;border-top-left-radius:0;border-bottom-left-radius:0"><i class="icon-angle-down"></i></button> 
+			</div>
+		</td>
+		<td  width="90%" style="padding-left:10px"><div id="changatype{rand}" class="btn-group"></div></td>
+	
+		<td align="right" id="tdright_{rand}" nowrap>
+			<span style="display:none" id="daoruspan_{rand}"><button class="btn btn-default" click="daoru,1" type="button"><?=lang('导入')?></button>&nbsp;&nbsp;&nbsp;</span><button class="btn btn-default" style="display:none" id="daobtn_{rand}" disabled click="daochu" type="button"><?=lang('导出')?> <i class="icon-angle-down"></i></button> 
+		</td>
+	</tr>
+	</table>
+</div>
+<div class="blank10"></div>
+<div id="viewmeeting_key_{rand}"></div>
+<!--HTMLend-->

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
webmain/flow/page/view_meeting_0.html


+ 2 - 2
webmain/flow/page/view_meeting_2.html

@@ -13,8 +13,8 @@
         <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">^start_time^</td>
+        <td width="35%" class="ys2">{start_time}</td>
         <td height="34" align="right" class="ys1"></td>
         <td class="ys2"></td>
     </tr>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
webmain/flow/page/view_meeting_key_0.html


+ 8 - 8
webmain/model/flow/meetingModel.php

@@ -48,12 +48,12 @@ class flow_meetingClassModel extends flowModel
 
 //        m('log')->addlog('会议单据', json_encode($rs, true));
 
-        $zt 		 = $rs['state'];
+        $zt 		 = $rs['meet_state'];
         $is_hand 	 = $rs['is_hand'];
         $nzt 		 = $zt;
         $time 		 = time();
 
-        $stime 	= strtotime($rs['meeting_time']);
+        $stime 	= strtotime($rs['start_time']);
         $etime 	= strtotime($rs['end_time']);
 
 
@@ -77,12 +77,12 @@ class flow_meetingClassModel extends flowModel
 
         // 更新数据状态
         if($zt != $nzt){
-            $this->update('state='.$nzt.'', $rs['id']);
+            $this->update('meet_state='.$nzt.'', $rs['id']);
             $zt = $nzt;
         }
 
         // 将id转换为文字
-        $rs['state'] = $this->getstatezt($zt);
+        $rs['meet_state'] = $this->getstatezt($zt);
 
 
         return $rs;
@@ -120,24 +120,24 @@ class flow_meetingClassModel extends flowModel
             }
 
             if (isset($topics[count($topics) - 1]) && $topics[count($topics) - 1]['topic_state'] == 2) {
-                m('meeting')->update(['is_hand'=>2,'state'=>2], "id={$this->id}");
+                m('meeting')->update(['is_hand'=>2,'meet_state'=>2], "id={$this->id}");
             }
 
         } else if ($ors['num'] == 'enableMeeting') {
 
             $time 		 = time();
 
-            $stime 	= strtotime($this->rs['meeting_time']);
+            $stime 	= strtotime($this->rs['start_time']);
             $etime 	= strtotime($this->rs['end_time']);
 
             if ($stime < $time){
                 $data = [
-                    'state'=>1,
+                    'meet_state'=>1,
                     'is_hand'=>2
                 ];
             } else if ($stime >= $time) {
                 $data = [
-                    'state'=>0,
+                    'meet_state'=>0,
                     'is_hand'=>2
                 ];
             }

+ 151 - 0
webmain/model/flow/meeting_keyModel.php

@@ -0,0 +1,151 @@
+<?php
+
+class flow_meeting_keyClassModel extends flowModel
+{
+
+    //删除单据时调用
+    public function flowdeletebill($sm) {
+
+    }
+
+    //流程全部完成后调用
+    public function flowcheckfinsh($sm) {
+    }
+
+    //提交时调用
+    protected function flowsubmit($na, $sm){
+        m('meeting_topics')->update(["topic_state"=>1], '1=1');
+        $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state', 'sort');
+        if (isset($topic['id']) && $topic['topic_state']<2) {
+            m('meeting')->firstMeetingTopicStart($this->id);
+        }
+    }
+
+
+    // 初始化单据可替换其他属性,$lx,0默认,1详情展示,2列表显示,3打印页,4外部详情页
+    public function flowrsreplace($rs, $lx=0)
+    {
+
+//        m('log')->addlog('会议单据', json_encode($rs, true));
+
+        $zt 		 = $rs['meet_state'];
+        $is_hand 	 = $rs['is_hand'] ?? 1;
+        $nzt 		 = $zt;
+        $time 		 = time();
+
+        $stime 	= strtotime($rs['start_time']);
+        $etime 	= strtotime($rs['end_time']);
+
+
+        if($is_hand != 2){
+            if($etime < $time){
+                $nzt = 2;
+            } else if ($stime > $time){
+                $nzt = 0;
+            } else {
+                $nzt = 1;
+                $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state', 'sort');
+                if (isset($topic['id']) && $topic['topic_state']<2) {
+                    m('meeting')->firstMeetingTopicStart($this->id);
+                }
+            }
+        }
+
+        if ($stime <= $time && $nzt != 2) {
+            $nzt = 1;
+        }
+
+        // 更新数据状态
+        if($zt != $nzt){
+            $this->update('meet_state='.$nzt.'', $rs['id']);
+            $zt = $nzt;
+        }
+
+        // 将id转换为文字
+        $rs['meet_state'] = m("meeting")->getstatezt($zt);
+
+
+        return $rs;
+    }
+
+
+    // $ors当前单据操作信息,$crs提交过来的信息
+    public function flowoptmenu($ors, $crs)
+    {
+        // 切换会议议题
+        if ($ors['num'] == 'changeTopic') {
+            $topics = $this->db->getall("select * from `[Q]meeting_topics` where mid = {$this->id} order by sort");
+
+            for ($i = 0; $i < count($topics); $i++) {
+                if (isset($topics[$i]['topic_state']) && $topics[$i]['topic_state'] == 2) {
+                    $id = $topics[$i]['id'];
+                    $data = ['topic_state' => $topics[$i]['topic_state'] + 1];
+                    m('meeting_topics')->update($data, "id={$id}");
+                    if (isset($topics[$i + 1]['topic_state'])) {
+                        $id = $topics[$i + 1]['id'];
+                        $data = ['topic_state' => 2];
+                        m('meeting_topics')->update($data, "id={$id}");
+                    }
+                    break;
+                }
+            }
+
+            if (isset($topics[count($topics) - 1]) && $topics[count($topics) - 1]['topic_state'] == 2) {
+                m('meeting_key')->update(['is_hand' => 2, 'meet_state' => 2], "id={$this->id}");
+            }
+
+        } else if ($ors['num'] == 'enableMeeting') {
+
+            $time 		 = time();
+
+            $stime 	= strtotime($this->rs['start_time']);
+            $etime 	= strtotime($this->rs['end_time']);
+
+            if ($stime < $time){
+                $data = [
+                    'meet_state'=>1,
+                    'is_hand'=>2
+                ];
+            } else if ($stime >= $time) {
+                $data = [
+                    'meet_state'=>0,
+                    'is_hand'=>2
+                ];
+            }
+            m('meeting_key')->update($data, "id={$this->id}");
+
+            $topic = m('meeting_topics')->getone("mid={$this->id}", "id", 'sort desc');
+            if (isset($topic['id'])) {
+                m('meeting_topics')->update(['topic_state'=>'2'], 'id='.$topic['id']);
+            }
+        } else if ($ors['num'] == 'disenableMeeting') {
+
+            $data = [
+                'meet_state'=>2,
+                'is_hand'=>2
+            ];
+
+            m('meeting_key')->update($data, "id={$this->id}");
+        }
+    }
+
+
+    //子表数据替换处理$lx=0编辑时,1展示时
+    protected function flowsubdata($rows, $lx=0){
+        if ($lx == 1) {
+            m('log')->addlog('编辑', $lx);
+            for ($i = 0; $i < count($rows); $i++) {
+                if (isset($rows[$i]['topic_state']) && !empty($rows[$i]['topic_state'])) {
+                    $index = $rows[$i]['topic_state'] ?? 1;
+                    $rows[$i]['topic_state'] = m('meeting')->ytarra[$index];
+                } else {
+//                    $id = $rows[$i]['id'];
+//                    m('meeting_topics')->update(['topic_state'=>1], "id={$id}");
+                }
+            }
+            return $rows;
+        }
+        return null;
+    }
+
+}

+ 47 - 4
webmain/model/meetingModel.php

@@ -3,19 +3,51 @@
 class meetingClassModel extends Model
 {
 
+    public $hyarra, $ytarra, $hyarrb;
+
+    public function initModel()
+    {
+        $this->hyarra = array('正常', '会议中', '结束', '取消');
+        $this->ytarra = array('待进行', '待进行', '进行中', '已结束');
+        $this->hyarrb = array('green', 'blue', '#ff6600', '#888888');
+    }
+
     /**
      *	判断会议室是否重复申请了
      */
+//    public function isapplymsg($startdt, $enddt, $hyname, $id=0)
+//    {
+//        $msg 		= '';
+//        $rows 		= $this->getall("id <> '$id' and `meet_state` in(0,1)");
+////        $gdrow		= m('flow')->initflow('meeting')->createmeet(0, substr($startdt,0,10) ,true);//从固定会议中读取
+////        foreach($gdrow as $k1=>$rs1)$rows[]=$rs1;
+//
+//        foreach($rows as $k=>$rs){
+//            if($rs['meeting_room'] != $hyname)continue;
+//            $sdt = $rs['start_time'];
+//            $edt = $rs['end_time'];
+//            if(
+//                ($sdt<=$startdt && $edt>$startdt)
+//                || ($sdt<$enddt && $edt>=$enddt)
+//                || ($sdt>$startdt && $edt<$enddt)
+//                || ($sdt==$startdt && $edt==$enddt)
+//            )$msg = '该会议室的时间段已被申请过了,主题“'.$rs['title'].'”';
+//        }
+//        return $msg;
+//    }
+
+
     public function isapplymsg($startdt, $enddt, $hyname, $id=0)
     {
         $msg 		= '';
-        $rows 		= $this->getall("id <> '$id' and `state` in(0,1)");
-//        $gdrow		= m('flow')->initflow('meeting')->createmeet(0, substr($startdt,0,10) ,true);//从固定会议中读取
-//        foreach($gdrow as $k1=>$rs1)$rows[]=$rs1;
+        $sql        = `select id, meeting_room, start_time, end_time from xinhu_meeting  where id <> {$id} and meet_state in (0, 1)
+                       union ALL
+                       select id, meeting_room, start_time, end_time from xinhu_meeting_key where id <> {$id} and meet_state in (0, 1)`;
+        $rows 		= $this->db->getall($sql);
 
         foreach($rows as $k=>$rs){
             if($rs['meeting_room'] != $hyname)continue;
-            $sdt = $rs['meeting_time'];
+            $sdt = $rs['start_time'];
             $edt = $rs['end_time'];
             if(
                 ($sdt<=$startdt && $edt>$startdt)
@@ -34,4 +66,15 @@ class meetingClassModel extends Model
             m('meeting_topics')->update(['topic_state'=>'2'], 'id='.$topic['id']);
         }
     }
+
+    // 会议室状态
+    public function getstatezt($zt)
+    {
+        if (isset($this->hyarrb[$zt])) {
+            $html = '<font color="'.$this->hyarrb[$zt].'">'.$this->hyarra[$zt].'</font>';
+            return $html;
+        } else {
+            return null;
+        }
+    }
 }

+ 38 - 0
webmain/model/meeting_keyModel.php

@@ -0,0 +1,38 @@
+<?php
+
+class meeting_keyClassModel extends Model
+{
+
+    /**
+     *	判断会议室是否重复申请了
+     */
+    public function isapplymsg($startdt, $enddt, $hyname, $id=0)
+    {
+        $msg 		= '';
+        $sql        = `select id, meeting_room, start_time, end_time from xinhu_meeting  where id <> {$id} and meet_state in (0, 1)
+                       union ALL
+                       select id, meeting_room, start_time, end_time from xinhu_meeting_key where id <> {$id} and meet_state in (0, 1)`;
+        $rows 		= $this->db->getall($sql);
+
+        foreach($rows as $k=>$rs){
+            if($rs['meeting_room'] != $hyname)continue;
+            $sdt = $rs['start_time'];
+            $edt = $rs['end_time'];
+            if(
+                ($sdt<=$startdt && $edt>$startdt)
+                || ($sdt<$enddt && $edt>=$enddt)
+                || ($sdt>$startdt && $edt<$enddt)
+                || ($sdt==$startdt && $edt==$enddt)
+            )$msg = '该会议室的时间段已被申请过了,主题“'.$rs['title'].'”';
+        }
+        return $msg;
+    }
+
+    public function firstMeetingTopicStart($meeting_id) {
+
+        $topic = m('meeting_topics')->getone("mid={$meeting_id}", "id", 'sort');
+        if (isset($topic['id'])) {
+            m('meeting_topics')->update(['topic_state'=>'2'], 'id='.$topic['id']);
+        }
+    }
+}

+ 4 - 4
webmain/task/openapi/openmeetAction.php

@@ -25,7 +25,7 @@ class openmeetClassAction extends openapiAction
 
         $rawData = m('meeting_room')->getone(" mac like '%{$rawArr['device_id']}%'", "id, room_name");
 
-        $meetData = m('meeting')->getone(" status = 1 and state = 1 and meeting_room = '{$rawData['room_name']}'");
+        $meetData = m('meeting')->getone(" status = 1 and meet_state = 1 and meeting_room = '{$rawData['room_name']}'");
 
         $now = date('Y年m月d日('.$this->getWeek().') H:i');
 
@@ -76,7 +76,7 @@ class openmeetClassAction extends openapiAction
             ];
         }
 
-        $meetData = m('meeting')->getone(" state = 1 and meeting_room = '{$rawData['room_name']}'");
+        $meetData = m('meeting')->getone(" meet_state = 1 and meeting_room = '{$rawData['room_name']}'");
 
         if (!isset($meetData['id'])) {
             return [
@@ -92,10 +92,10 @@ class openmeetClassAction extends openapiAction
 
 
         // 将日期时间字符串转换为UNIX时间戳
-        $ts = strtotime($meetData['meeting_time']);
+        $ts = strtotime($meetData['start_time']);
         // 根据需要格式化日期
         $meetStartDate = date("Y年m月d日", $ts);
-        $meetDate=$meetStartDate." (".$this->getWeek($meetStartDate).") ".date("H:i", strtotime($meetData['meeting_time']))."~".date("H:i", strtotime($meetData['end_time']));
+        $meetDate=$meetStartDate." (".$this->getWeek($meetStartDate).") ".date("H:i", strtotime($meetData['start_time']))."~".date("H:i", strtotime($meetData['end_time']));
 
         $topicsList = [];