Commit f1bc9ba7 by 孙龙

up

parent 4f6cd31d
......@@ -154,10 +154,10 @@ Class AjaxController extends Controller
* 推送模板消息到erp
*/
protected function pushTemplateErp($t_id=0){
return true;
// return true;
try{
$template = TemplateListModel::find($t_id);
//dump($template);
//登录
$soap = new \SoapClient(env("ERP_DOMAIN").'/ormrpc/services/EASLogin?wsdl');
$res = $soap->login( 'TC', 'unicom', 'eas', env('ERP_DB_NAME'), 'L2', 1, 'BaseDB');
......@@ -305,6 +305,22 @@ Class AjaxController extends Controller
}
/*
* 推送模板信息到erp
*/
public function push_template_erp($request){
$id = $request->input("t_id",0);
$template = TemplateListModel::where(["create_userid"=>$request->user->userId])->find($id);
if(!$template){
return $this->ajaxReturn(-1,"没找到属于您的模板相关信息");
}
//此处推送到erp
if(!$this->pushTemplateErp($template->id)){
return $this->ajaxReturn(-1,"模板信息推送至erp失败");
}
return $this->ajaxReturn(0,"推送模板成功");
}
/*
* 复制模板
......
......@@ -23,8 +23,8 @@ layui.use(['form', 'table', 'laydate'], function(){
,cols: [[ //表头
{title: 'ID',field:"id",fixed: 'left', width: 80}
,{field: 'template_name', title: '模板名称(可点击修改)',edit: 'text'}
,{field: 'status', title: '状态',templet:"#status"}
,{field: 'create_username', title: '创建人'}
,{field: 'status', title: '状态',templet:"#status",width: 80}
,{field: 'create_username', title: '创建人',width: 100}
,{field: 'create_time', title: '创建时间', sort: true}
,{field: 'update_time', title: '更新时间', sort: true}
,{ title: '操作', fixed: 'right', toolbar: '#action'}
......@@ -110,6 +110,12 @@ layui.use(['form', 'table', 'laydate'], function(){
url = '/ajax/copy_template';
datax = {t_id:data.id}
enable_tool(title,content,url,datax);
}else if(layEvent == "push"){
title = '推送模板信息到erp';
content = '确定推送?';
url = '/ajax/push_template_erp';
datax = {t_id:data.id}
enable_tool(title,content,url,datax);
}
})
......
......@@ -65,7 +65,8 @@
@{{# }else{ }}
<a class="btn btn-xs btn-outline btn-info" lay-event="forbid">禁用</a>
@{{# } }}
<a class="btn btn-xs btn-outline btn-info" lay-event="copy">复制</a>
<a title="复制一份该模板" class="btn btn-xs btn-outline btn-info" lay-event="copy">复制</a>
<a title="推送模板信息到erp" class="btn btn-xs btn-outline btn-info" lay-event="push">推送</a>
</script>
<script type="text/html" id="status">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment