fixed
This commit is contained in:
@@ -82,24 +82,24 @@ class Reporttt
|
||||
return json(Tools::set_fail('content必须'));
|
||||
}
|
||||
|
||||
$content[] = ["role" => "user", "content" => '【姓名】:'.$basedata['name']];
|
||||
$content[] = ["role" => "user", "content" => '【性别】:'.$basedata['gender']];
|
||||
$content[] = ["role" => "user", "content" => '【年龄】:'.$basedata['age']];
|
||||
$content[] = ["role" => "user", "content" => '【教育程度】:'.$basedata['edu']];
|
||||
$content[] = ["role" => "user", "content" => '【职业及年限】:'.$basedata['career_year']];
|
||||
$content[] = ["role" => "user", "content" => '【体力要求】:'.$basedata['power']];
|
||||
$content[] = ["role" => "user", "content" => '【经济满意度】:'.$basedata['satisfaction']];
|
||||
$content[] = ["role" => "user", "content" => '【过往职业及年限】:'.$basedata['old_career_year']];
|
||||
$content[] = ["role" => "user", "content" => '【社会支持度】:'.$basedata['support']];
|
||||
$content[] = ["role" => "user", "content" => '【婚姻状况】:'.$basedata['marriage']];
|
||||
$content[] = ["role" => "user", "content" => '【居住情况】:'.$basedata['live']];
|
||||
$content[] = ["role" => "user", "content" => '【家庭关系】:'.$basedata['home']];
|
||||
$content[] = ["role" => "user", "content" => '【地址】:'.$basedata['address']];
|
||||
$content[] = ["role" => "user", "content" => '【联系方式】:'.$basedata['phone']];
|
||||
$content[] = ["role" => "user", "content" => '【微信号】:'.$basedata['wechat_no']];
|
||||
|
||||
//设置基本信息
|
||||
$chatobj->setBefore($content);
|
||||
//$content[] = ["role" => "user", "content" => '【姓名】:'.$basedata['name']];
|
||||
//$content[] = ["role" => "user", "content" => '【性别】:'.$basedata['gender']];
|
||||
//$content[] = ["role" => "user", "content" => '【年龄】:'.$basedata['age']];
|
||||
//$content[] = ["role" => "user", "content" => '【教育程度】:'.$basedata['edu']];
|
||||
//$content[] = ["role" => "user", "content" => '【职业及年限】:'.$basedata['career_year']];
|
||||
//$content[] = ["role" => "user", "content" => '【体力要求】:'.$basedata['power']];
|
||||
//$content[] = ["role" => "user", "content" => '【经济满意度】:'.$basedata['satisfaction']];
|
||||
//$content[] = ["role" => "user", "content" => '【过往职业及年限】:'.$basedata['old_career_year']];
|
||||
//$content[] = ["role" => "user", "content" => '【社会支持度】:'.$basedata['support']];
|
||||
//$content[] = ["role" => "user", "content" => '【婚姻状况】:'.$basedata['marriage']];
|
||||
//$content[] = ["role" => "user", "content" => '【居住情况】:'.$basedata['live']];
|
||||
//$content[] = ["role" => "user", "content" => '【家庭关系】:'.$basedata['home']];
|
||||
//$content[] = ["role" => "user", "content" => '【地址】:'.$basedata['address']];
|
||||
//$content[] = ["role" => "user", "content" => '【联系方式】:'.$basedata['phone']];
|
||||
//$content[] = ["role" => "user", "content" => '【微信号】:'.$basedata['wechat_no']];
|
||||
//
|
||||
////设置基本信息
|
||||
//$chatobj->setBefore($content);
|
||||
|
||||
$sub_content = json_decode($contentstr,true);
|
||||
if(empty($sub_content)){
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 听译-病历报告(听译问诊)
|
||||
@@ -34,4 +35,55 @@ class Tymedicalreport extends Backend
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param $ids
|
||||
* @return string
|
||||
* @throws DbException
|
||||
* @throws \think\Exception
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
//查询随访记录
|
||||
$followup = Db::table('fa_ty_followup')->where('report_dataid', $row['id'])->select();
|
||||
$this->view->assign('follow_record', $followup);
|
||||
|
||||
$adminIds = $this->getDataLimitAdminIds();
|
||||
if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
|
||||
$this->error(__('You have no permission'));
|
||||
}
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
$params = $this->request->post('row/a');
|
||||
if (empty($params)) {
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
$params = $this->preExcludeFields($params);
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
//是否采用模型验证
|
||||
if ($this->modelValidate) {
|
||||
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||
$row->validateFailException()->validate($validate);
|
||||
}
|
||||
$result = $row->allowField(true)->save($params);
|
||||
Db::commit();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if (false === $result) {
|
||||
$this->error(__('No rows were updated'));
|
||||
}
|
||||
$this->success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,31 +76,36 @@ class Followup extends Backend
|
||||
});
|
||||
}
|
||||
|
||||
//function getfollowup(){
|
||||
//
|
||||
// //设置过滤方法
|
||||
// //$this->request->filter(['strip_tags', 'trim']);
|
||||
// //if (false === $this->request->isAjax()) {
|
||||
// // return $this->view->fetch();
|
||||
// //}
|
||||
// ////如果发送的来源是 Selectpage,则转发到 Selectpage
|
||||
// //if ($this->request->request('keyField')) {
|
||||
// // return $this->selectpage();
|
||||
// //}
|
||||
// //[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||
// //$list = $this->model
|
||||
// // ->where($where)
|
||||
// // ->order($sort, $order)
|
||||
// // ->paginate($limit);
|
||||
// //$result = ['total' => $list->total(), 'rows' => $list->items()];
|
||||
// //return json($result);
|
||||
//
|
||||
// //报告数据id
|
||||
// $report_dataid = input('report_dataid');
|
||||
// $report = Db::table('fa_tt_followup')->where('id',$report_dataid)->select();
|
||||
//
|
||||
// $this->assign('rows',$report);
|
||||
// $html = view('index')->getContent();
|
||||
// return json(Tools::set_ok('ok',$html));
|
||||
//}
|
||||
public function addFollowUpTy()
|
||||
{
|
||||
//报告数据id
|
||||
$report_dataid = input('report_dataid');
|
||||
$report = Db::table('fa_ty_medical_report')->where('id',$report_dataid)->find();
|
||||
//$user = Db::table('fa_tt_users')->where('username',$report['username'])->find();
|
||||
|
||||
$userbaseinfo = Db::table('fa_ty_userbaseinfo')->where('id',$report['id'])->find();
|
||||
$this->assign('user',$userbaseinfo);
|
||||
$html = view('add')->getContent();
|
||||
return json(Tools::set_ok('ok',$html));
|
||||
}
|
||||
function submitFollowUpTy(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$content = input('content');
|
||||
if(empty($content)){
|
||||
return Tools::set_fail( '请填写随访内容');
|
||||
}
|
||||
$report_dataid = input('report_dataid');
|
||||
if(empty($report_dataid)){
|
||||
return Tools::set_fail( '请选择诊断报告');
|
||||
}
|
||||
$data = [
|
||||
'report_dataid'=>$report_dataid,
|
||||
'content'=>$content,
|
||||
'create_time'=>date('Y-m-d H:i:s')
|
||||
];
|
||||
Db::table('fa_ty_followup')->insert($data);
|
||||
return Tools::set_ok('添加成功');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-phone" class="form-control" name="row[phone]" type="text" value="{:isset($user)?$user['phone']:''}">
|
||||
<input id="c-phone" class="form-control" name="row[phone]" type="text" value="{:isset($user['phone'])?$user['phone']:''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -18,16 +18,28 @@
|
||||
<textarea id="c-report_content" class="form-control editor" rows="5" name="row[report_content]" cols="50">{$row.report_content|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
{volist name='follow_record' key='k' id='vo' empty='没有随访记录'}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{$k==1?'初诊':'复诊'}随访:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea class="form-control editor" rows="5" cols="50">{$vo.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
|
||||
<button type="button" id="add_follow_report" class="btn btn-danger btn-embossed " data-id="{:$row.id}">添加随访</button>
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">修改病历报告</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -82,43 +82,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
},'json');
|
||||
});
|
||||
|
||||
//查询随访报告
|
||||
$('#get_follow_report').on('click',function () {
|
||||
let report_dataid = $('#add_follow_report').attr('data-id');
|
||||
//添加随访记录
|
||||
let url = 'tt/Followup/getfollowup';
|
||||
$.post(url,{report_dataid:report_dataid},function (res) {
|
||||
|
||||
layer.open({
|
||||
type: 1,
|
||||
title:'添加随访',
|
||||
area: '80%',
|
||||
content:res.data,
|
||||
btn: ['确定', '取消'],
|
||||
yes: function(index, layero){
|
||||
//按钮【按钮一】的回调
|
||||
|
||||
// let content = $('#c-content').val();
|
||||
//
|
||||
// let url = 'tt/Followup/submitfollowup';
|
||||
// $.post(url,{content:content,report_dataid:report_dataid},function (res) {
|
||||
//
|
||||
// layer.msg(res.msg);
|
||||
// },'json');
|
||||
},
|
||||
btn2: function(index, layero){
|
||||
//按钮【按钮二】的回调
|
||||
|
||||
//return false 开启该代码可禁止点击该按钮关闭
|
||||
},
|
||||
cancel: function(){
|
||||
//右上角关闭回调
|
||||
|
||||
//return false 开启该代码可禁止点击该按钮关闭
|
||||
}
|
||||
});
|
||||
},'json');
|
||||
});
|
||||
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
|
||||
@@ -41,6 +41,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
|
||||
$('#add_follow_report').on('click',function () {
|
||||
let report_dataid = $('#add_follow_report').attr('data-id');
|
||||
//添加随访记录
|
||||
let url = 'tt/Followup/addFollowUpTy';
|
||||
$.post(url,{report_dataid:report_dataid},function (res) {
|
||||
|
||||
layer.open({
|
||||
type: 1,
|
||||
title:'添加随访',
|
||||
area: '80%',
|
||||
content:res.data,
|
||||
btn: ['完成添加', '取消'],
|
||||
yes: function(index, layero){
|
||||
//按钮【按钮一】的回调
|
||||
|
||||
let content = $('#c-content').val();
|
||||
|
||||
let url = 'tt/Followup/submitFollowUpTy';
|
||||
$.post(url,{content:content,report_dataid:report_dataid},function (res) {
|
||||
|
||||
layer.msg(res.msg);
|
||||
if(res.code==200){
|
||||
layer.close(index);
|
||||
location.href = '';
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
btn2: function(index, layero){
|
||||
//按钮【按钮二】的回调
|
||||
|
||||
//return false 开启该代码可禁止点击该按钮关闭
|
||||
},
|
||||
cancel: function(){
|
||||
//右上角关闭回调
|
||||
|
||||
//return false 开启该代码可禁止点击该按钮关闭
|
||||
}
|
||||
});
|
||||
},'json');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
|
||||
Reference in New Issue
Block a user