提交 7caaa332 authored 作者: fengzy's avatar fengzy

固定资产、合同、资金划拨

上级 a4f19416
...@@ -25,22 +25,21 @@ function initbodys(){ ...@@ -25,22 +25,21 @@ function initbodys(){
$(form('bankcode')).find("option").remove() $(form('bankcode')).find("option").remove()
}) })
c.onselectdata['part_c']=function(d){
form('partc_name').value = d.value;
};
c.onselectdatabefore=function(fid,zb){ c.onselectdatabefore=function(fid,zb){
var receive = $("select[name='receive'] option:selected").val(); var receive = $("select[name='receive'] option:selected").val();
var financetype = $("select[name='finance_type'] option:selected").val(); var financetype = $("select[name='finance_type'] option:selected").val();
if(fid == 'part_b' || fid == 'part_a') { if(fid == 'part_b' || fid == 'part_a' || fid == 'part_c') {
if(financetype == '') { if(financetype == '') {
return '请选择类型'; return '请选择类型';
} }
if (receive != 1 && receive != 2) { if (receive == '') {
return '请选择收款方,否则无法获取银行账号信息'; return '请选择收款方,否则无法获取银行账号信息';
} }
} }
return {'receive':receive} return {'receive':receive,'financetype':financetype}
} }
...@@ -76,6 +75,22 @@ function initbodys(){ ...@@ -76,6 +75,22 @@ function initbodys(){
},'post,json'); },'post,json');
} }
}; };
c.onselectdata['part_c']=function(d){
var receive = $("select[name='receive'] option:selected").val();
form('partc_name').value = d.value;
if (receive == 3) {
$(form('bankcode')).find("option").remove()
js.ajax(geturlact('getbankcode'),{numb:d.value,receive:receive},function(ret){
if(ret.length == 0) {
$(form('bankcode')).find("option").remove()
return '未找到银行信息,请到供应商/客户 补充银行信息';
}
js.setselectdata(form('bankcode'),ret,'value')
},'post,json');
}
};
bindeventchange() bindeventchange()
} }
......
...@@ -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
...@@ -111,4 +111,45 @@ class CommonClassModel extends Model ...@@ -111,4 +111,45 @@ class CommonClassModel extends Model
{ {
return (new Action())->adminid; return (new Action())->adminid;
} }
//获取合同供应商列表
public function getcontract_supplier()
{
$uid = $this->getuid();
$data = $this->db->getall('select `number` as value,CONCAT(name, "(","供应商",")") as name from
oa_supplier
where (uid = ' . $uid . '
or department_id=(select deptname from oa_userinfo where id=' . $uid . ')
or department_id like concat((select deptname from oa_userinfo where id=' . $uid . '),",%")
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '))
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '),",%"))
and status = 1
order by id desc');
return $data;
}
//获取合同客户列表
public function getcontract_customer()
{
$uid = $this->getuid();
$data = $this->db->getall('select `contract_number` as value,CONCAT(name, "(","客户",")") as name from
oa_customer
where (uid = ' . $uid . '
or department_id=(select deptname from oa_userinfo where id=' . $uid . ')
or department_id like concat((select deptname from oa_userinfo where id=' . $uid . '),",%")
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '))
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '),",%"))
and status = 1
order by id desc');
return $data;
}
//固定资产申领
public function getassetmuse()
{
$data = m('assetm')->getall('state = 0', 'id as value, CONCAT(num, "(",title,")") as name');
return $data;
}
} }
...@@ -17,7 +17,7 @@ class flow_fund_depositClassModel extends flowModel ...@@ -17,7 +17,7 @@ class flow_fund_depositClassModel extends flowModel
//提交时调用 //提交时调用
protected function flowsubmit($na, $sm){ protected function flowcheckfinsh($na, $sm){
$name=$this->rs['toaccount']; $name=$this->rs['toaccount'];
$data=m('c_fund_account')->getone("`name`='$name'"); $data=m('c_fund_account')->getone("`name`='$name'");
$zfarr = array( $zfarr = array(
......
...@@ -35,13 +35,8 @@ class flow_fund_transferClassModel extends flowModel ...@@ -35,13 +35,8 @@ class flow_fund_transferClassModel extends flowModel
return $rs; return $rs;
} }
//作废单据时调用,$sm作废说明
// protected function flowzuofeibill($sm){
// var_dump($sm);
// }
//提交时调用 //提交时调用
protected function flowcheckfinsh($zt){ protected function flowcheckfinsh($zt){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论