提交 fb46fbac authored 作者: wangkr's avatar wangkr

update

上级 ba46d2ba
//流程模块【assetmuse.固定资产申领】下录入页面自定义js页面,初始函数 //流程模块【assetmuse.固定资产申领】下录入页面自定义js页面,初始函数
function initbodys(){ function initbodys(){
c.onselectdata['assetmnumb']=function(d){
js.ajax(geturlact('getassetmnumb'),{numb:d.value},function(ret){
if(ret.length == 0) {
return '未找到信息';
}
$('input[name="assetmname"]').val(ret.title);
$('input[name="assetmbuydate"]').val(ret.buydt);
$('input[name="assetmprice"]').val(ret.price);
$('textarea[name="assetmdetail"]').text(ret.info);
},'post,json');
};
} }
\ No newline at end of file
...@@ -26,5 +26,14 @@ class mode_assetmuseClassAction extends inputAction{ ...@@ -26,5 +26,14 @@ class mode_assetmuseClassAction extends inputAction{
protected function saveafter($table, $arr, $id, $addbo){ protected function saveafter($table, $arr, $id, $addbo){
} }
public function getassetmnumbAjax(){
$numb = $this->post('numb');
$data = m('assetm')->getone('id = '.$numb,"title,price,buydt,CONCAT('型号:',`model-xh`,' 机器编号:',`model-bh`,' 处理器(CPU):',`model-cpu`,' 内存:',`model-ram`,' 硬盘:',`model-hdd`,' 显卡:',`model-vc`,' 操作系统:',`model-os`) as info");
$this->returnjson($data);
}
} }
\ No newline at end of file
...@@ -62,15 +62,17 @@ class mode_contract_listClassAction extends inputAction{ ...@@ -62,15 +62,17 @@ class mode_contract_listClassAction extends inputAction{
public function getbankcodebymidAjax(){ public function getbankcodebymidAjax(){
$mid = $this->post('mid'); $mid = $this->post('mid');
$c = m('c_contract')->getone('id = '.$mid,'id,bankcode,parta_name,partb_name,receive'); $c = m('c_contract')->getone('id = '.$mid,'id,bankcode,parta_name,partb_name,partc_name,receive');
$ret = []; $ret = [];
$num = ''; $num = '';
if($c){ if($c){
$ret['bank'] = $c['bankcode']; $ret['bank'] = $c['bankcode'];
if($c['reveice'] == 1){ if($c['reveice'] == 1){
$num = $c['parta_name']; $num = $c['parta_name'];
} else { } elseif($c['reveice'] == 2) {
$num = $c['partb_name']; $num = $c['partb_name'];
}else{
$num = $c['partc_name'];
} }
$s = m('supplier')->getone('number = "'.$num.'"','id'); $s = m('supplier')->getone('number = "'.$num.'"','id');
if($s){ if($s){
...@@ -122,26 +124,26 @@ class mode_contract_listClassAction extends inputAction{ ...@@ -122,26 +124,26 @@ class mode_contract_listClassAction extends inputAction{
public function getparta(){ public function getparta(){
$fid = $this->get('receive'); $receive = $this->get('receive');
$data = []; $customer = m('common')->getcontract_customer();
if($fid == 1){ //如果甲方收款 $supplier = m('common')->getcontract_supplier();
$data = m('common')->getsupplier(); $data=array_merge($customer,$supplier);
} else if($fid == 2) { //乙方收款
$data = m('common')->getcustomer();
}
$this->returnjson($data); $this->returnjson($data);
} }
public function getpartb(){ public function getpartb(){
$fid = $this->get('receive'); $receive = $this->get('receive');
$data = []; $customer = m('common')->getcontract_customer();
if($fid == 1){ //如果甲方收款 $supplier = m('common')->getcontract_supplier();
$data = m('common')->getcustomer(); $data=array_merge($customer,$supplier);
} else if($fid == 2) { //乙方收款 乙方就是供应商
$data = m('common')->getsupplier();
}
$this->returnjson($data); $this->returnjson($data);
} }
public function getpartc(){
$customer = m('common')->getcontract_customer();
$supplier = m('common')->getcontract_supplier();
$data=array_merge($customer,$supplier);
$this->returnjson($data);
}
} }
\ No newline at end of file
<?php
/**
* 此文件是流程模块【contract_list.合同管理】对应控制器接口文件。
*/
class mode_contract_listClassAction 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){
if($addbo){
//保存员工姓名
$arr['staffname'] = $arr['staff'];
//保存业务线
$arr['businame'] = $arr['busi_line'];
//保存创建的业务部门
$arr['deptname'] = $arr['departmentname'];
}
return ['rows'=>$arr];
}
/**
* 重写函数:保存后处理,主要保存其他表数据
* $table String 对应表名
* $arr Array 表单参数
* $id Int 对应表上记录Id
* $addbo Boolean 是否添加时
*/
protected function saveafter($table, $arr, $id, $addbo){
}
public function getbankcodeAjax(){
$numb = $this->post('numb');
//甲方收款
$model = 'supplier';
$sql = ' number = "'.$numb .'"';
$cdata = m($model)->getone($sql,'id,name');
if($cdata){
$sql = "select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]".$model."_bank_info where mid = ".$cdata['id'];
$data = $this->db->getall($sql);
}else{
$data=[];
}
$this->returnjson($data);
}
public function getbankcodebymidAjax(){
$mid = $this->post('mid');
$c = m('c_contract')->getone('id = '.$mid,'id,bankcode,parta_name,partb_name,partc_name,receive');
$ret = [];
$num = '';
if($c){
$ret['bank'] = $c['bankcode'];
if($c['reveice'] == 1){
$num = $c['parta_name'];
} elseif($c['reveice'] == 2) {
$num = $c['partb_name'];
}else{
$num = $c['partc_name'];
}
$s = m('supplier')->getone('number = "'.$num.'"','id');
if($s){
$sql = "select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]supplier_bank_info where mid = ".$s['id'];
$ret['data'] = $this->db->getall($sql);
}
}
$this->returnjson($ret);
}
//模拟客户接口
public function getcustomerAjax(){
$name = $this->post('cname');
$data = m('option')->getone('`name` like "'.$name.'%"','id,name');
$this->returnjson($data);
}
//格式化子表数据
public function savesubbefore($data,$tables)
{
if($tables == 'c_rhythm'){
if (count($data) >= 1) {
foreach ($data as $key => $arr) {
if ($arr['amount'] != '') {
$data[$key]['cycle_numb'] = $key + 1;
}
}
}
}
return $data;
}
public function gettypesAjax(){
$pid = $this->post('pid');
if($pid == 0)
$data = m('option')->getall(' pid in (676,955)','num as value,name');
else
$data = m('option')->getall(' pid = "'.$pid.'"','num as value,name');
$this->returnjson($data);
}
public function getcontractinfoAjax(){
$id = $this->post('id');
$data = m('c_contract')->getone(' id = '.$id);
$this->returnjson($data);
}
public function getparta(){
$receive = $this->get('receive');
$customer = m('common')->getcontract_customer();
$supplier = m('common')->getcontract_supplier();
$data=array_merge($customer,$supplier);
$this->returnjson($data);
}
public function getpartb(){
$receive = $this->get('receive');
$customer = m('common')->getcontract_customer();
$supplier = m('common')->getcontract_supplier();
$data=array_merge($customer,$supplier);
$this->returnjson($data);
}
public function getpartc(){
$customer = m('common')->getcontract_customer();
$supplier = m('common')->getcontract_supplier();
$data=array_merge($customer,$supplier);
$this->returnjson($data);
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论