信呼OA版本v2.3.9
This commit is contained in:
38
webmain/flow/input/inputjs/mode_planm.js
Normal file
38
webmain/flow/input/inputjs/mode_planm.js
Normal file
@@ -0,0 +1,38 @@
|
||||
//流程模块【planm.工作计划】下录入页面自定义js页面,初始函数
|
||||
function initbodys(){
|
||||
if(mid==0)$(form('leixing')).change(function(){
|
||||
changeleixing(this)
|
||||
});
|
||||
}
|
||||
|
||||
function changeleixing(o1){
|
||||
if(!form('name'))return;
|
||||
js.ajax(geturlact('chageleixing'),{lx:o1.value}, function(ret){
|
||||
form('name').value = ret.data.name;
|
||||
},'get,json');
|
||||
}
|
||||
|
||||
function changesubmit(d){
|
||||
if(form('name')){
|
||||
var str = form('name').value;
|
||||
if(str.indexOf('{?}')>-1)return '请完整输入计划名称';
|
||||
}
|
||||
}
|
||||
|
||||
function submittijiao(o2){
|
||||
var obj = $('input[name^=zhixing_]');
|
||||
var da = {},o1,na,naa;
|
||||
for(var i=0;i<obj.length;i++){
|
||||
o1 = obj[i];
|
||||
na = o1.name;
|
||||
naa= na.split('_');
|
||||
if(!da[naa[2]])da[naa[2]] = {};
|
||||
da[naa[2]][naa[1]] = o1.value;
|
||||
}
|
||||
var str = JSON.stringify(da);
|
||||
js.loading('保存中...');
|
||||
o2.disabled = true;
|
||||
js.ajax(geturlact('savezhixing'),{str:str,mid:mid,ztstate:get('ztstate').value}, function(ret){
|
||||
js.msgok('保存完成');
|
||||
},'post,json');
|
||||
}
|
||||
69
webmain/flow/input/mode_planmAction.php
Normal file
69
webmain/flow/input/mode_planmAction.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* 此文件是流程模块【planm.工作计划】对应控制器接口文件。
|
||||
*/
|
||||
class mode_planmClassAction 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){
|
||||
|
||||
}
|
||||
|
||||
public function chageleixingAjax()
|
||||
{
|
||||
$lx = (int)$this->get('lx');
|
||||
$str = '';
|
||||
$barr['lx'] = $lx;
|
||||
if($lx==1)$str=''.date('Y').'年度工作计划';
|
||||
if($lx==2)$str=''.date('Y').'第{?}季度工作计划';
|
||||
if($lx==3)$str=''.date('Y').'年'.date('m').'月份工作计划';
|
||||
if($lx==4)$str=''.date('Y').'年'.date('m').'月份第{?}周工作计划';
|
||||
|
||||
$barr['name'] = $str;
|
||||
|
||||
return returnsuccess($barr);
|
||||
}
|
||||
|
||||
public function leixingdata()
|
||||
{
|
||||
|
||||
return $this->flow->leixingdata();
|
||||
}
|
||||
|
||||
public function savezhixingAjax()
|
||||
{
|
||||
$str = $this->post('str');
|
||||
$mid = (int)$this->post('mid');
|
||||
$arr = json_decode($str, true);
|
||||
$dbs = m('plans');
|
||||
$state = (int)$this->post('ztstate');;
|
||||
foreach($arr as $id=>$rs){
|
||||
$dbs->update(array(
|
||||
'zxren' => $rs['zxren'],
|
||||
'zxrenid' => $rs['zxrenid'],
|
||||
'zxtime' => $rs['zxtime'],
|
||||
),$id);
|
||||
}
|
||||
m('planm')->update('`state`='.$state.'', $mid);
|
||||
return returnsuccess($arr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user