提交 3c54d701 authored 作者: wangkr's avatar wangkr

合并分支 'release' 到 'master'

Release 查看合并请求 PHP/OA!24
config/config.php merge=ours
webmain/model/loginModel.php merge=ours
webmain/webmainConfig.php merge=ours
.idea/ merge=ours
images/OA二维码.png merge=ours
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
function initbodys(){
if(!form('applydt'))return;
$.getScript('js/rmb.js');
form('applydt').readOnly=true;
form('money').readOnly=true;
addchengesss();
if(mid=='0'){
if(form('cardid'))js.ajax(geturlact('getlast'),{},function(d){
if(d){
form('paytype').value=d.paytype;
form('cardid').value=d.cardid;
form('openbank').value=d.openbank;
form('fullname').value=d.fullname;
}
},'get,json');
}
}
function addchengesss(){
if(isedit==0)return;
$("[name^='sdt0_']").unbind('change').change(function(){
// cchangtongss();
});
$("[name^='name0_']").unbind('change').change(function(){
// cchangtongss();
});
$("[name^='money0_']").unbind('change').change(function(){
// cchangtongss();
});
}
function changesubmit(){
var jg = parseFloat(form('money').value);
if(jg<=0)return '报销金额不能小于0';
}
function changesubmitbefore(){
// cchangtongss();
}
function eventaddsubrows(){
// cchangtongss();
addchengesss();
}
function eventdelsubrows(){
// cchangtongss();
}
function initbodys(){
if(!form('applydt'))return;
$.getScript('js/rmb.js');
form('applydt').readOnly=true;
form('money').readOnly=true;
addchengesss();
if(mid=='0'){
if(form('cardid'))js.ajax(geturlact('getlast'),{},function(d){
if(d){
form('paytype').value=d.paytype;
form('cardid').value=d.cardid;
form('openbank').value=d.openbank;
form('fullname').value=d.fullname;
}
},'get,json');
}
}
function addchengesss(){
if(isedit==0)return;
$("[name^='sdt0_']").unbind('change').change(function(){
// cchangtongss();
});
$("[name^='name0_']").unbind('change').change(function(){
// cchangtongss();
});
$("[name^='money0_']").unbind('change').change(function(){
// cchangtongss();
});
}
function changesubmit(d){
var jg = parseFloat(form('money').value);
if(jg<=0)return '报销金额不能小于0';
var subs = d.sub_totals0;
var reg = new RegExp(/^[0-9a-zA-Z]+$/);
for(i=0;i<subs;i++){
var skey = 'invoice0_' + i;
console.log(d[skey])
if(!reg.test(d[skey])){
return '第'+ (i+1) +'条费用明细,发票号只能填写英文字母与数字'
}
}
}
function changesubmitbefore(){
addchengesss()
}
function eventaddsubrows(){
// cchangtongss();
addchengesss();
}
function eventdelsubrows(){
// cchangtongss();
}
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
//流程模块【oafk.付款申请单】下录入页面自定义js页面,初始函数
function initbodys(){
c.onselectdata['payee']=function(d){
js.ajax(geturlact('getbankinfo'),{numb:d.value},function(ret){
if(ret.status == 1){
$(form('fkinfo')).text(ret.info);
} else {
return ret.info;
}
},'post,json');
}
//流程模块【oafk.付款申请单】下录入页面自定义js页面,初始函数
function initbodys(){
c.onselectdata['payee']=function(d){
js.ajax(geturlact('getbankinfo'),{numb:d.value},function(ret){
if(ret.status == 1){
$(form('fkinfo')).text(ret.info);
} else {
return ret.info;
}
},'post,json');
}
}
function changesubmit(d){
var subs = d.sub_totals0;
var reg = new RegExp(/^[0-9a-zA-Z]+$/);
for(i=0;i<subs;i++){
var skey = 'receipt_id0_' + i;
console.log(d[skey])
if(!reg.test(d[skey])){
return '第'+ (i+1) +'条款项明细,发票号只能填写英文字母与数字'
}
}
}
\ No newline at end of file
//流程模块【oayfk.预付款申请单】下录入页面自定义js页面,初始函数
function initbodys(){
//流程模块【oayfk.预付款申请单】下录入页面自定义js页面,初始函数
function initbodys(){
}
function changesubmit(d){
var subs = d.sub_totals0;
var reg = new RegExp(/^[0-9a-zA-Z]+$/);
for(i=0;i<subs;i++){
var skey = 'receipt_id0_' + i;
console.log(d[skey])
if(!reg.test(d[skey])){
return '第'+ (i+1) +'条费用明细,发票号只能填写英文字母与数字'
}
}
}
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -11,7 +11,7 @@ $(document).ready(function(){
{params}
var modenum = 'oayfk',modename='预付款申请单',isflow=1,modeid='103',atype = params.atype,pnum=params.pnum,modenames='';
if(!atype)atype='';if(!pnum)pnum='';
var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"fkinfo","name":"\u6536\u6b3e\u4eba\u4fe1\u606f","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"0"},{"fields":"userid","name":"\u7528\u6237\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"paymentMethod","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"payee","name":"\u6536\u6b3e\u65b9","fieldstype":"selectdatafalse","ispx":"1","isalign":"0","islb":"0"},{"fields":"paymentBy","name":"\u4ed8\u6b3e\u4e8b\u7531","fieldstype":"textarea","ispx":"1","isalign":"0","islb":"0"},{"fields":"fkorg","name":"\u4ed8\u6b3e\u7ec4\u7ec7","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"application","name":"\u7533\u8bf7\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"fujian","name":"\u9644\u4ef6","fieldstype":"uploadfile","ispx":"0","isalign":"0","islb":"0"},{"fields":"applydate","name":"\u7533\u8bf7\u65e5\u671f","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"docnum","name":"\u5355\u636e\u7f16\u53f7","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"yfkname","name":"\u6807\u9898","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"amountOfThisPayment","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"}],fieldsselarr= {"columns_oayfk_all":"base_name,base_deptname,applydate,docnum,yfkname,amountOfThisPayment,caozuo"};
var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"fkinfo","name":"\u6536\u6b3e\u4eba\u4fe1\u606f","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"0"},{"fields":"userid","name":"\u7528\u6237\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"paymentMethod","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"payee","name":"\u6536\u6b3e\u65b9","fieldstype":"selectdatafalse","ispx":"1","isalign":"0","islb":"0"},{"fields":"paymentBy","name":"\u4ed8\u6b3e\u4e8b\u7531","fieldstype":"textarea","ispx":"1","isalign":"0","islb":"0"},{"fields":"fkorg","name":"\u4ed8\u6b3e\u7ec4\u7ec7","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"application","name":"\u7533\u8bf7\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"fujian","name":"\u9644\u4ef6","fieldstype":"uploadfile","ispx":"0","isalign":"0","islb":"0"},{"fields":"applydate","name":"\u7533\u8bf7\u65e5\u671f","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"docnum","name":"\u5355\u636e\u7f16\u53f7","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"yfkname","name":"\u6807\u9898","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"amountOfThisPayment","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"}],fieldsselarr= {"columns_oayfk_all":"base_name,base_deptname,sericnum,applydate,docnum,yfkname,amountOfThisPayment,caozuo"};
var c = {
reload:function(){
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
差异被折叠。
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
差异被折叠。
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<?php
class fkDetailClassModel extends Model
{
public function initModel()
{
$this->settable('c_fund_details_fk');
}
}
\ No newline at end of file
<?php
class fkClassModel extends Model
{
public function initModel()
{
$this->settable('c_fininfom_oafk');
}
}
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
差异被折叠。
<?php
class yfkDetailClassModel extends Model
{
public function initModel()
{
$this->settable('c_fund_details_yfk');
}
}
\ No newline at end of file
<?php
class yfkClassModel extends Model
{
public function initModel()
{
$this->settable('c_fininfom_oayfk');
}
}
\ No newline at end of file
......@@ -14,12 +14,20 @@ class opencustomerClassAction extends openapiAction
//客户列表
public function listAction(){
$post = $_POST;
$page = $post['size'] ? $post['size']:0;
$page_size = $post['page_size']? $post['page_size']:10;
$sort =$post['sort']? $post['sort']: 'desc';
$sql = 'select id,contract_number,name from [Q]customer as c order by c.id '.$sort.' limit '.$page.','.$page_size;
$post = $_POST;
$email=$post['email'];
$sql = "select u.id,u.email from oa_userinfo u where u.email = '$email'";
$data = $this->db->getall($sql);
$uid=$data[0]['id'];//用户id
$data = $this->db->getall('select id,contract_number,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');
foreach ($data as $key => $vo){
$supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]customer_bank_info where mid='.$vo['id'];
$contacts ='select name,job,tel,email,adress,remarks from [Q]contracts where mid='.$vo['id'];
......
<?php
/**
* Created by PhpStorm.
* User: chouchou
* Date: 2020-4-2
* Time: 0:17
*/
class openfkClassAction extends openapiAction
{
public $data = [];
public $subdata = [];
public $model = null;
public $ext = 'oa';
public function initAction()
{
$data = json_decode($this->post('data'),true);
if(empty($data)) $this->showreturn([], '请求的参数不能为空!', '201');
if(!empty($data['docnum'])) $this->data['docnum'] = $data['docnum']; //如果是编辑则携带编码
$user = $this->getUser($data['uname']);
if ($data['type'] == 1) {
$this->model = 'fk';
$this->data['applicationdpt'] = $data['dept'];
};
if ($data['type'] == 2) {
$this->model = 'yfk';
$this->data['application'] = $data['dept'];
};
//构建主表
$this->data[$this->model.'name'] = $data['title'];
$this->data['payee'] = $data['payee'];
$this->data['paymentMethod'] = $data['payType'];
$this->data['applicant'] = $user['name'];
$this->data['fkorg'] = $data['payOrg'];
$this->data['paymentBy'] = $data['remarks'];
$this->data['fkinfo'] = $data['fkinfo'];
$this->data['applydt'] = $this->data['optdt'] = $this->data['applydate'] = $data['date'] ?: date('Y-m-d');
$this->data['uid']= $this->data['optid'] = $user['id'];
$this->data['docnum'] = $this->data['docnum'] ?: $this->getDocNum();
$this->data['status'] = 0;
$this->subdata = $this->getSubData($data['details']);
$this->data['amountOfThisPayment'] = $this->AmountSum();
}
//返回不存在的接口方法
public function __call($name, $arguments)
{
$msg = $name . ' action not found';
$this->showreturn([], $msg, '201');
}
//创建预付款单
public function createAction()
{
$id = m($this->model)->insert($this->data);
if ($id) {
//插入子表数据
$smode = m($this->model.'Detail');
foreach ($this->subdata as $sub){
$sub['mid'] = $id;
$sub['comid'] = 1;
$smode->insert($sub);
}
//启动流程
$this->goflow($id);
$this->showreturn(['numb' => $this->data['docnum']], '插入数据成功', '200');
} else $this->showreturn([], '插入数据失败', '201');
}
public function updateAction(){
$mid = $this->getIdByDocNum($this->data['docnum']);
if(!$mid) $this->showreturn([], '修改数据失败,不匹配的数据记录', '201');
$where = 'id='.$mid;
unset($this->data['docnum']);
$res = m($this->model)->update($this->data,$where);
if(!$res) $this->showreturn([], '修改数据失败,数据字段异常或字段不匹配', '201');
$smode = m($this->model.'Detail');
//1.获取子表数据,子表数据必须要携带子表id
//2.查询所有子表ID 如果子表ID存在于 记录中则是修改 否则是新增
$scount = 0;
foreach ($this->subdata as $k=>$sub){
if(empty($sub['id'])){ //插入操作
$sub['mid'] = $mid;
$sub['comid'] = 1;
$smode->insert($sub);
} else { //新增
//如果已经存在的子表数据则修改
if($smode->getone('id='.$sub['id'])){
$smode->update($sub,'id='.$sub['id']);
} else {
$sub['mid'] = $mid;
$sub['comid'] = 1;
$smode->insert($sub);
}
}
$scount++;
}
$this->showreturn([], '修改数据成功,子表数据成功修改'.$scount.'条记录', '200');
}
public function getUser($username)
{
$where = "email='".$username."@gonn.com.cn'";
return $this->db->getone('oa_userinfo',$where);
}
public function getSubData($details=[]){
$arr = [];
foreach ($details as $k=>$d){
if(!empty($d['id'])) $arr[$k]['id'] = $d['id'];
$arr[$k]['charge_type'] = $d['chargeType'];
$arr[$k]['charge_amount'] = $d['amount'];
$arr[$k]['cbzx_code'] = $d['projectNumber'];
$arr[$k]['contract_id'] = $d['contractNumber'];
$arr[$k]['receipt_id'] = $d['receipt'];
}
return $arr;
}
//子表金额求和
public function AmountSum(){
$sum = 0;
foreach ($this->subdata as $v){
$sum += $v['charge_amount'];
}
return $sum;
}
private function getDocNum()
{
$pre = 'OA-FK-';
if($this->model == 'yfk') $pre = 'OA-YFK-';
$cext = $pre . date("Ymd");
$where = "`docnum` like '%" . $cext . "%'";
$mode = m($this->model);
$data = $mode->getone($where, 'id,docnum', 'id desc');
$num = '001';
if ($data) {
$num = (int)substr($data['docnum'], strlen($cext)) + 1;
if (strlen($num) == 2) {
$num = '0' . $num;
} else if (strlen($num) == 1) {
$num = '00' . $num;
}
}
return $cext . $num;
}
private function getIdByDocNum($docnum){
$data = m($this->model)->getone("`docnum`='".$docnum."'", 'id,docnum');
return $data['id'] ?: 0;
}
private function goflow($id){
$num = $this->ext.$this->model;
$mode = m("flow:".$num);
$mode->initdata($num);
$mode->loaddata($id);
$mode->submit();
}
}
\ No newline at end of file
<?php
/**
*
* Class
*/
class openfkinfoClassAction extends openapiAction
{
public function __call($name, $arguments)
{
$msg = $name.' action not found';
return $this->showreturn([],$msg,'201');
}
public function listAction(){
$post = $_POST;
if($post){
$arr=$post['docnum'];
$arr=explode(',', $arr);
$str = " ' " . join("','", array_values($arr) ) . " ' "; // 使用需要的符号拼接
$str = " ' ".str_replace( ",","','", implode(',',$arr)); //使用需要的符号替换
$str = join( ', ',array_map(function( $v ){ return "'".$v."'";},$arr) );
$sql='select a.id,a.docnum,a.status,b.nowcheckname from oa_c_fininfom_oafk as a INNER JOIN oa_flow_bill as b on a.docnum=b.sericnum where a.docnum in '."(".$str.")";
$data = $this->db->getall($sql);
foreach ($data as $key => $value) {
$data[$key]['url']="http://chengye-dev.gonn.tech/task.php?a=p&num=oafk&mid=".$value['id'];
}
}else{
$data = $this->db->getall('select a.id,a.docnum,a.status,b.nowcheckname from oa_c_fininfom_oafk as a INNER JOIN oa_flow_bill as b on a.docnum=b.sericnum ');
foreach ($data as $key => $value) {
$data[$key]['url']="http://chengye-dev.gonn.tech/task.php?a=p&num=oafk&mid=".$value['id'];
}
}
return $this->showreturn($data,'SUCCESS','200');
}
public function fkinforAction(){
$post = $_POST;
switch ($post['type']) {
case '1':
$sql='select o.name,o.num from oa_option as o where o.pid=516';
$data = $this->db->getall($sql);
break;
case '2':
$sql='select o.name,o.num from oa_option as o where o.pid=933';
$data = $this->db->getall($sql);
break;
case '3':
$sql='select o.name,o.num from oa_option as o where o.pid=678';
$data = $this->db->getall($sql);
break;
default:
return $this->showreturn([],'error','201');
break;
}
return $this->showreturn($data,'SUCCESS','200');
}
}
\ No newline at end of file
......@@ -15,11 +15,17 @@ class opensupplierClassAction extends openapiAction
//供应商列表
public function listAction(){
$post = $_POST;
$page = $post['size'] ? $post['size']:0;
$page_size = $post['page_size']? $post['page_size']:10;
$sort =$post['sort']? $post['sort']: 'desc';
$sql = 'select id,number,name from [Q]supplier as c order by c.id '.$sort.' limit '.$page.','.$page_size;
$email=$post['email'];
$sql = "select u.id,u.email from oa_userinfo u where u.email = '$email'";
$data = $this->db->getall($sql);
$uid=$data[0]['id'];//用户id
$data = $this->db->getall('select id,number,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');
foreach ($data as $key => $vo){
$supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]supplier_bank_info where mid='.$vo['id'];
$contacts ='select name,job,tel,email,adress,remarks from [Q]supplier_contract where mid='.$vo['id'];
......
File mode changed from 100644 to 100755
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论