优化下游个人打款设置

master
chenzhi 5 years ago
parent 62f91bb0df
commit ec7b333fa4

@ -502,12 +502,18 @@ class CompanyStatementPoolController extends ThinkController
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("pool_id='{$id}'")
->select();
foreach($CompanyInfo as $k=>&$v){
if($v['verify_status'] == 2){
$v['is_payment'] = 2;
}else{
$v['is_payment'] = 1;
}
$v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? '';
$v['company_info']['ali_account'] ?? '';
}
$this->assign("CompanyInfo",$CompanyInfo);
$this->assign("id",$id);
$this->display();
@ -520,20 +526,26 @@ class CompanyStatementPoolController extends ThinkController
//循环保存
foreach($info as $k=>$v){
$ydata = $CompanyInfo->where("id= '{$k}'")->find();
if($ydata['verify_status'] == 2){continue;}
$company_info = json_decode($ydata['company_info'],true);
$company_info['ali_user'] = $v['ali_user'];
$company_info['ali_account'] = $v['ali_account'];
if($ydata['verify_status'] == 2){
$company_info['payee_name'] = $v['payee_name'];
$company_info['bank_account'] = $v['bank_account'];
$company_info['opening_bank'] = $v['opening_bank'];
}else{
$company_info['ali_user'] = $v['ali_user'];
$company_info['ali_account'] = $v['ali_account'];
}
$savedata = [
"company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
"remark"=>$v['remark'],
"id"=>$k
];
if(empty($v['ali_user']) || empty($v['ali_account'])){
$savedata['verify_status'] = -1;
}else{
$savedata['verify_status'] = 1;
if($ydata['verify_status'] != 2){
if(empty($v['ali_user']) || empty($v['ali_account'])){
$savedata['verify_status'] = -1;
}else{
$savedata['verify_status'] = 1;
}
}
$CompanyInfo->save($savedata);
}

@ -430,7 +430,7 @@
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
area: ['80%', '80%'],
content: url
});
})

@ -105,10 +105,14 @@
<tr>
<th style="border-right: solid 1px #b6cad2;">序号</th>
<th style="border-right: solid 1px #b6cad2;">合作公司</th>
<th style="border-right: solid 1px #b6cad2;">支付宝真实名称</th>
<th style="border-right: solid 1px #b6cad2;">支付宝账号</th>
<th style="border-right: solid 1px #b6cad2;">是否支付宝打款</th>
<th style="border-right: solid 1px #b6cad2;">户名</th>
<th style="border-right: solid 1px #b6cad2;">帐号</th>
<th style="border-right: solid 1px #b6cad2;">开户行</th>
<th style="border-right: solid 1px #b6cad2;">关联结算汇总单订单号</th>
<th style="border-right: solid 1px #b6cad2;">金额(元)</th>
<th style="border-right: solid 1px #b6cad2;">结算金额(元)</th>
<th style="border-right: solid 1px #b6cad2;">备注</th>
</tr>
</thead>
@ -118,8 +122,18 @@
<tr>
<td>{$key-0+1}</td>
<td>{$vo.company_name}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_user" value="{$vo.company_info.ali_user}" placeholder="支付宝真实名称"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_account" value="{$vo.company_info.ali_account}" placeholder="支付宝账号"></td>
<if condition="$vo['is_payment'] eq 1">
<td></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_user" value="{$vo.company_info.ali_user}" placeholder="支付宝真实名称"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_account" value="{$vo.company_info.ali_account}" placeholder="支付宝账号"></td>
<td></td>
<else />
<td></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="payee_name" value="{$vo.company_info.payee_name}" placeholder="银行帐户名"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="bank_account" value="{$vo.company_info.bank_account}" placeholder="银行帐号"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="opening_bank" value="{$vo.company_info.opening_bank}" placeholder="开户行"></td>
</if>
<td>{$vo.statement_num}</td>
<td>{$vo.statement_money}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="remark" value="{$vo.remark}" placeholder="备注"></td>
@ -128,8 +142,18 @@
<tr>
<td>{$key-0+1}</td>
<td>{$vo.company_name}</td>
<td>{$vo.company_info.ali_user}</td>
<td>{$vo.company_info.ali_account}</td>
<if condition="$vo['is_payment'] eq 1">
<td></td>
<td>{$vo.company_info.ali_user}</td>
<td>{$vo.company_info.ali_account}</td>
<td></td>
<else />
<td></td>
<td>{$vo.company_info.payee_name}</td>
<td>{$vo.company_info.bank_account}</td>
<td>{$vo.company_info.opening_bank}</td>
</if>
<td>{$vo.statement_num}</td>
<td>{$vo.statement_money}</td>
<td>{$vo.remark}</td>
@ -139,7 +163,7 @@
</foreach>
<tr>
<td colspan="2">合计:</td>
<td colspan="5">打款总金额:{$CompanyInfo[0]['all_money']}</td>
<td colspan="7">结算总金额:{$CompanyInfo[0]['all_money']}</td>
</tr>
</tbody>
@ -155,47 +179,20 @@
<script>
$("#setPayment").on("click",function(){
var sendObj = {};
var url = "{:U('editPayment')}"
$("input[name='ali_user']").map(function(index,elem) {
var id = $(elem).data("id");
var to = {
"ali_user":$(elem).val(),
"ali_account":'',
"remark":''
}
sendObj[id]=to;
});
$("input[name='ali_account']").map(function(index,elem) {
var id = $(elem).data("id");
if(id in sendObj){
sendObj[id]['ali_account']=$(elem).val();
}else{
var to = {
"ali_account":$(elem).val(),
"ali_user":'',
"remark":''
}
sendObj[id]=to;
}
});
$("input[name='remark']").map(function(index,elem) {
var url = "{:U('editPayment')}";
$("input[name='ali_user'],input[name='ali_account'],input[name='remark'],input[name='payee_name'],input[name='bank_account'],input[name='opening_bank']").map(function(index,elem) {
var id = $(elem).data("id");
var e = $(elem).attr("name");
var v = $(elem).val();
if(id in sendObj){
sendObj[id]['remark']=$(elem).val();
sendObj[id][e] = v;
}else{
var to = {
"remark":$(elem).val(),
"ali_user":'',
"ali_account":''
}
sendObj[id]=to;
sendObj[id] = {};
sendObj[id][e] = v;
}
});
layer.confirm("若支付宝账号及真实姓名不全的公司,将无法进行打款。请认真核对,点击取消返回",{title:false}, function(index){
layer.confirm("若支付宝账号及真实姓名不全的公司,将无法进行打款。请认真核对,点击取消返回",{title:false}, function(index){
$.ajax({
type: "POST",
url: url,
@ -215,7 +212,6 @@
}
}
});
});
})

Loading…
Cancel
Save