作者 魏强
1 个管道 的构建 通过 耗费 1 秒

转诊待答操作

@@ -14,6 +14,8 @@ use app\user\model\TransferModel; @@ -14,6 +14,8 @@ use app\user\model\TransferModel;
14 use app\user\model\UserModel; 14 use app\user\model\UserModel;
15 use cmf\controller\WeChatBaseController; 15 use cmf\controller\WeChatBaseController;
16 use EasyWeChat\Foundation\Application; 16 use EasyWeChat\Foundation\Application;
  17 +use Qiniu\Auth;
  18 +use Qiniu\Storage\UploadManager;
17 use think\Db; 19 use think\Db;
18 20
19 class ExpertController extends WeChatBaseController 21 class ExpertController extends WeChatBaseController
@@ -153,4 +155,187 @@ class ExpertController extends WeChatBaseController @@ -153,4 +155,187 @@ class ExpertController extends WeChatBaseController
153 155
154 return $this->fetch(); 156 return $this->fetch();
155 } 157 }
  158 +
  159 + /**
  160 + * 转诊疑问
  161 + */
  162 + public function replyTransfer(){
  163 + $data=$this->request->param();
  164 + $update['reply']=$this->getSaveContent($data,'reply');
  165 + $update['id']=$data['id'];
  166 + $model=new TransferModel();
  167 + $model->adminEdit($update);
  168 +
  169 + //todo 生成卡片
  170 + $this->success('提交成功','',$model->getLastSql());
  171 + }
  172 +
  173 + /**
  174 + * 同意转诊
  175 + */
  176 + public function agreeTransfer(){
  177 + $data=$this->request->param();
  178 + $update['reply_again']=$this->getSaveContent($data,'reply_again');
  179 + $update['id']=$data['id'];
  180 + $update['receive_hospital']=$data['receive_hospital'];
  181 + $update['receive_expert']=$data['receive_expert'];
  182 + $update['receive_address']=$data['receive_address'];
  183 + $update['receive_time']=strtotime($data['receive_time']);
  184 + $update['status']=1;
  185 + $model=new TransferModel();
  186 + $model->adminEdit($update);
  187 +
  188 + //todo 生成卡片
  189 + $this->success('');
  190 + }
  191 +
  192 + /**
  193 + * 驳回转诊
  194 + */
  195 + public function refuseTransfer(){
  196 + $id=$this->request->param('id');
  197 + $model=new TransferModel();
  198 + $row=$model->where(['id'=>$id])->setField('status',2);
  199 + if($row){
  200 + $this->success('驳回成功');
  201 + }else{
  202 + $this->error('驳回失败');
  203 + }
  204 + }
  205 +
  206 +
  207 +
  208 +
  209 +
  210 +
  211 +
  212 + /**
  213 + * 内容处理
  214 + * @param $input
  215 + * @param $name
  216 + * @return mixed
  217 + */
  218 + protected function getSaveContent($input,$name){
  219 +
  220 + $return['type']=$input[$name.'_type'];
  221 + if ($return['type']==1){
  222 + $return['content']=explode(',',$input[$name]);
  223 + $dir=[];
  224 + foreach ($return['content'] as $k=>$v) {
  225 + $dir[$k]=$this->saveWxVoice($v);
  226 + }
  227 + $return['dir']=$dir;
  228 + }else{
  229 + $return['content']=$input[$name];
  230 + }
  231 + return $return;
  232 + }
  233 +
  234 + /**
  235 + * 获取微信语音到本地
  236 + * @param $audioID
  237 + */
  238 + protected function saveWxVoice($mediaId){
  239 + $config=config('wechat_config');
  240 + $Wechat=new Application($config);
  241 + $temporary = $Wechat->material_temporary;
  242 + $dir=ROOT_PATH.'public/'.'upload/inquery'.'/';
  243 + $name=date('YmdHis',time()).rand(1000,9999);
  244 + $file=$name.'.amr';
  245 + $data=$temporary->download($mediaId,"$dir", "$file");
  246 + $filePath=$dir.$file;
  247 +
  248 + $result=$this->upChange($filePath,$name);
  249 + if($result['err']==0){
  250 + return $result['data'];
  251 + }else{
  252 + $this->error($result['msg']);
  253 + }
  254 + }
  255 +
  256 + /**
  257 + * 录音文件amr转mp3
  258 + * @param $filePath 文件绝对路径
  259 + * @param $name 文件名不含后缀
  260 + * @return mixed
  261 + */
  262 + protected function upChange($filePath,$name){
  263 +
  264 + //转码时使用的队列名称
  265 + $pipeline = 'jyht_list';
  266 +
  267 + //要进行转码的转码操作
  268 + $fops = "avthumb/mp3/ab/320k/ar/44100/acodec/libmp3lame";
  269 +
  270 + //可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当间
  271 + $savekey = \Qiniu\base64_urlSafeEncode("jyht_list:$name.mp3");
  272 + $fops = $fops.'|saveas/'.$savekey;
  273 +
  274 + $policy = array(
  275 + 'persistentOps' => $fops,
  276 + 'persistentPipeline' => $pipeline
  277 + );
  278 + $key = "$name.mp3";
  279 + $ret=$this->uploadToQiniu($filePath,$key,$policy);
  280 + return $ret;
  281 + }
  282 +
  283 + /**
  284 + * @return mixed
  285 + * @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException
  286 + */
  287 + public function upload_wx_pic_mul($mediaId)
  288 + {
  289 + $config=config('wechat_config');
  290 + $Wechat=new Application($config);
  291 + $temporary = $Wechat->material_temporary;
  292 + $dir=ROOT_PATH.'public/'.'upload/friend'.'/';
  293 + $name=date('YmdHis',time()).rand(1000,9999).'.jpg';
  294 + $data=$temporary->download($mediaId,"$dir", "$name");
  295 + $filePath=$dir.$name;
  296 + $result=$this->uploadToQiniu($filePath,$name);
  297 + if($result['err']===0){
  298 + return $result['data'];
  299 + }else{
  300 + $this->error($result['msg']);
  301 + }
  302 + return $data;
  303 + }
  304 +
  305 + /**
  306 + * @param $filePath
  307 + * @param $save_name
  308 + * @param $policy
  309 + * @return array
  310 + */
  311 + protected function uploadToQiniu($filePath,$save_name,$policy=null){
  312 + $plugin=Db::name('plugin')->field('config')->where(['name'=>'Qiniu'])->find();
  313 + $config=json_decode($plugin['config'],true);
  314 +
  315 + // 上传到七牛后保存的文件名
  316 + $key =$save_name;
  317 +
  318 + require_once VENDOR_PATH . 'qiniu/php-sdk/autoload.php';
  319 +
  320 + // 需要填写你的 Access Key 和 Secret Key
  321 + $accessKey = $config['accessKey'];
  322 + $secretKey = $config['secretKey'];
  323 + // 构建鉴权对象
  324 + $auth = new Auth($accessKey,$secretKey);
  325 + // 要上传的空间
  326 + $bucket = $config['bucket'];
  327 + $token = $auth->uploadToken($bucket, null, 3600, $policy);
  328 + // 初始化 UploadManager 对象并进行文件的上传
  329 + $uploadMgr = new UploadManager();
  330 + // 调用 UploadManager 的 putFile 方法进行文件的上传
  331 + list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);
  332 +
  333 + if ($err !== null) {
  334 + return ["err"=>1,"msg"=>$err,"data"=>""];
  335 + } else {
  336 + unlink($filePath);
  337 + return ["err"=>0,"msg"=>"上传完成","data"=>cmf_get_asset_url($ret['key'])];
  338 + }
  339 + }
  340 +
156 } 341 }
@@ -21,7 +21,10 @@ class TransferModel extends Model @@ -21,7 +21,10 @@ class TransferModel extends Model
21 'inspected' => 'array', 21 'inspected' => 'array',
22 'diagnose' => 'array', 22 'diagnose' => 'array',
23 'used_drugs' => 'array', 23 'used_drugs' => 'array',
24 - 'problem' => 'array' 24 + 'problem' => 'array',
  25 + 'reply' => 'array',
  26 + 'problem_again' => 'array',
  27 + 'reply_again' => 'array',
25 ]; 28 ];
26 29
27 /** 30 /**
@@ -128,14 +128,14 @@ @@ -128,14 +128,14 @@
128 <div class="tab_content_box info_item question_yes"> 128 <div class="tab_content_box info_item question_yes">
129 <div class="tab_info inquiry_content title"> 129 <div class="tab_info inquiry_content title">
130 <text>提问</text> 130 <text>提问</text>
131 - <text class="iconfont icon-huatong voice_btn"></text> 131 + <text class="iconfont icon-huatong voice_btn voice_btn1"></text>
132 <text class="iconfont icon-tianxie"></text> 132 <text class="iconfont icon-tianxie"></text>
133 </div> 133 </div>
134 <div class="textarea_content"> 134 <div class="textarea_content">
135 - <textarea class="area" type="text" placeholder="请输入" maxlength="1000"></textarea> 135 + <textarea class="area textarea1" type="text" placeholder="请输入" maxlength="1000"></textarea>
136 <p class="text_num num_box"><span class="text-count">0</span>/1000</p> 136 <p class="text_num num_box"><span class="text-count">0</span>/1000</p>
137 </div> 137 </div>
138 - <div class="voice_module agree_box" video-id="1"> 138 + <div id="voice_module1" class="voice_module agree_box" video-id="1">
139 <div class="voice_list" voiceitemid="1"> 139 <div class="voice_list" voiceitemid="1">
140 <div class="voice_box voice_third"> 140 <div class="voice_box voice_third">
141 <div class="voice_item"> 141 <div class="voice_item">
@@ -160,6 +160,59 @@ @@ -160,6 +160,59 @@
160 </div> 160 </div>
161 </div> 161 </div>
162 162
  163 + <notempty name="info.reply">
  164 + <!--专家提问显示内容-->
  165 + <div class="tab_content_box">
  166 + <div class="tab_info">
  167 + <text>专家提问</text>
  168 + </div>
  169 + <div class="user_info_box">
  170 + <eq name="info.reply.type" value="1">
  171 + <div class="voice_box" >
  172 + <foreach name="info.reply.dir" item="item">
  173 + <div class="voice_item">
  174 + <text class="iconfont icon-luyin voice_icon voice_play" data-url="{$item}"></text>
  175 + <text class="iconfont icon-luying_ongoing voice_icon voice_puse"></text>
  176 + <text class="voice_font">点击图标开始播放</text>
  177 + </div>
  178 + </foreach>
  179 + </div>
  180 + <else/>
  181 + <div class="tab_textarea">
  182 + <textarea readonly>{$info.reply.content}</textarea>
  183 + </div>
  184 + </eq>
  185 + </div>
  186 + </div>
  187 + <!--回复专家的内容-->
  188 + <div class="tab_content_box">
  189 + <div class="tab_info">
  190 + <text>回答</text>
  191 + </div>
  192 + <div class="user_info_box">
  193 + <notempty name="info.problem_again">
  194 + <eq name="info.problem_again.type" value="1">
  195 + <div class="voice_box" >
  196 + <foreach name="info.problem_again.dir" item="item">
  197 + <div class="voice_item">
  198 + <text class="iconfont icon-luyin voice_icon voice_play" data-url="{$item}"></text>
  199 + <text class="iconfont icon-luying_ongoing voice_icon voice_puse"></text>
  200 + <text class="voice_font">点击图标开始播放</text>
  201 + </div>
  202 + </foreach>
  203 + </div>
  204 + <else/>
  205 + <div class="tab_textarea">
  206 + <textarea readonly>{$info.problem_again.content}</textarea>
  207 + </div>
  208 + </eq>
  209 + <else/>
  210 + 尚未回答
  211 + </notempty>
  212 + </div>
  213 + </div>
  214 + </notempty>
  215 +
163 <!--转诊意见内容部分--> 216 <!--转诊意见内容部分-->
164 <div class="tab_content_box info_item question_no"> 217 <div class="tab_content_box info_item question_no">
165 <div class="tab_info inquiry_content title"> 218 <div class="tab_info inquiry_content title">
@@ -195,29 +248,7 @@ @@ -195,29 +248,7 @@
195 </div> 248 </div>
196 </div> 249 </div>
197 </div> 250 </div>
198 -  
199 - <notempty name="info.reply">  
200 - <!--专家提问显示内容-->  
201 - <div class="tab_content_box">  
202 - <div class="tab_info">  
203 - <text>专家提问</text>  
204 - </div>  
205 - <div class="user_info_box">  
206 - {$info.reply}  
207 - </div>  
208 - </div>  
209 - <!--回复专家的内容-->  
210 - <div class="tab_content_box">  
211 - <div class="tab_info">  
212 - <text>回答</text>  
213 - </div>  
214 - <div class="user_info_box">  
215 - {$info.problem_again|default='尚未回答'}  
216 - </div>  
217 - </div>  
218 - </notempty>  
219 -  
220 - 251 +
221 <!--同意转诊须填表单--> 252 <!--同意转诊须填表单-->
222 <div class="tab_content_box question_no"> 253 <div class="tab_content_box question_no">
223 <div class="tab_content"> 254 <div class="tab_content">
@@ -226,19 +257,19 @@ @@ -226,19 +257,19 @@
226 <div class="info_box"> 257 <div class="info_box">
227 <div class="info_item"> 258 <div class="info_item">
228 <div class="title">接诊医院</div> 259 <div class="title">接诊医院</div>
229 - <div class="info_input"><input type="text" placeholder="请填写接诊医院"></div> 260 + <div class="info_input"><input type="text" id="receive_hospital" placeholder="请填写接诊医院"></div>
230 </div> 261 </div>
231 <div class="info_item"> 262 <div class="info_item">
232 <div class="title">转诊专家</div> 263 <div class="title">转诊专家</div>
233 - <div class="info_input"><input type="text" placeholder="请填写接诊医院"></div> 264 + <div class="info_input"><input type="text" id="receive_expert" placeholder="请填写转诊专家"></div>
234 </div> 265 </div>
235 <div class="info_item"> 266 <div class="info_item">
236 <div class="title">接诊地点</div> 267 <div class="title">接诊地点</div>
237 - <div class="info_input"><input type="text" placeholder="请填写接诊医院"></div> 268 + <div class="info_input"><input type="text" id="receive_address" placeholder="请填写接诊地点"></div>
238 </div> 269 </div>
239 <div class="info_item" id="showDatePicker"> 270 <div class="info_item" id="showDatePicker">
240 <div class="title">就诊时间</div> 271 <div class="title">就诊时间</div>
241 - <div class="info_input"><input class="time_value" type="text" placeholder="请填写接诊医院"> 272 + <div class="info_input"><input class="time_value" id="receive_time" type="text" placeholder="请选择就诊时间">
242 <text class="iconfont icon-xiala"></text> 273 <text class="iconfont icon-xiala"></text>
243 </div> 274 </div>
244 </div> 275 </div>
@@ -246,26 +277,33 @@ @@ -246,26 +277,33 @@
246 </div> 277 </div>
247 </div> 278 </div>
248 </div> 279 </div>
249 -  
250 - <!--确认回复按钮-->  
251 - <div class="agree_btn submit question_yes1">确认回复</div>  
252 - <!---->  
253 - <div class="bottom_box question_no">  
254 - <div class="agree_btn">同意</div>  
255 - <div class="bottom_btn">驳回</div>  
256 - </div> 280 +
  281 + <eq name="info.status" value="0">
  282 + <!--确认回复按钮-->
  283 + <div class="agree_btn submit question_yes1" id="submit_reply">确认回复</div>
  284 + <!---->
  285 + <div class="bottom_box question_no">
  286 + <div class="agree_btn" id="agree_transfer">同意</div>
  287 + <div class="bottom_btn">驳回</div>
  288 + </div>
  289 + </eq>
257 </div> 290 </div>
258 -<div class="mask_box" hidden> 291 +<div class="mask_box refuse_box" hidden>
259 <div class="referral_popup_box"> 292 <div class="referral_popup_box">
260 <div>确认驳回</div> 293 <div>确认驳回</div>
261 <div class="referral_info">确定驳回转诊吗?</div> 294 <div class="referral_info">确定驳回转诊吗?</div>
262 <div class="referral_btn_box"> 295 <div class="referral_btn_box">
263 <div class="btn cancel_btn">取消</div> 296 <div class="btn cancel_btn">取消</div>
264 - <div class="btn confirm_btn">确认</div> 297 + <div class="btn confirm_btn" id="refuse_transfer">确认</div>
265 </div> 298 </div>
266 </div> 299 </div>
267 </div> 300 </div>
268 301
  302 +<!--表单判断弹窗-->
  303 +<div class="form_popup_box" hidden>
  304 + <text></text>
  305 +</div>
  306 +
269 <!--录音弹窗--> 307 <!--录音弹窗-->
270 <div class="mask_box first" hidden> 308 <div class="mask_box first" hidden>
271 <div class="popup_box"> 309 <div class="popup_box">
@@ -339,6 +377,14 @@ @@ -339,6 +377,14 @@
339 <script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> 377 <script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
340 <!--<script src="__TMPL__/public/assets/js/referral.js"></script>--> 378 <!--<script src="__TMPL__/public/assets/js/referral.js"></script>-->
341 <script> 379 <script>
  380 + $('.bottom_btn').click(function () {
  381 + $('.refuse_box').show();
  382 + });
  383 +
  384 + $('.cancel_btn').click(function () {
  385 + $('.refuse_box').hide();
  386 + });
  387 +
342 wx.config({$sdk}); 388 wx.config({$sdk});
343 //文本框显示字数 389 //文本框显示字数
344 $(".area").on("input propertychange", function () { 390 $(".area").on("input propertychange", function () {
@@ -486,7 +532,7 @@ @@ -486,7 +532,7 @@
486 }) 532 })
487 533
488 //显示弹窗 534 //显示弹窗
489 - var videoid='' 535 + var videoid='';
490 //生命全局唯一 音频 536 //生命全局唯一 音频
491 var voiceBox; 537 var voiceBox;
492 $(document).on("click", ".mike", function () { 538 $(document).on("click", ".mike", function () {
@@ -496,34 +542,15 @@ @@ -496,34 +542,15 @@
496 $('.stopping').hide() 542 $('.stopping').hide()
497 $('.stop').hide() 543 $('.stop').hide()
498 $('.next_step').hide(); 544 $('.next_step').hide();
499 - // videoid=$(this).parents(".voice_module").attr("video-id")  
500 -  
501 - // $(this).parents(".voice_first").hide();  
502 - // $(this).parents(".voice_first").siblings(".voice_third").show()  
503 - //  
504 - // // vioceid=$(this).parents(".voice_first").attr("voiceid");  
505 - //  
506 545
507 voiceBox = $(this).parents('.voice_list'); 546 voiceBox = $(this).parents('.voice_list');
508 547
509 - // console.log(voiceBox)  
510 - // $('.submit_voice').attr('videoid')  
511 - //  
512 - // var videolist = $(".voice_module");  
513 - // console.log(videolist)  
514 - // for (var i = 0; i < videolist.length; i++) {  
515 - // if (videoid == title_id) {  
516 - // $(videolist[i]).children(".voice_list").children(".voice_list").hide();  
517 - // $(videolist[i]).children(".voice_list").children(".voice_third").show();  
518 - // }  
519 - // }  
520 -  
521 }); 548 });
522 549
523 //删除语音 550 //删除语音
524 $(".voice_module").on("click",".cancle_voice",function(){ 551 $(".voice_module").on("click",".cancle_voice",function(){
525 $(this).parents(".voice_box").remove(); 552 $(this).parents(".voice_box").remove();
526 - }) 553 + });
527 554
528 //开始录音 555 //开始录音
529 var localId; 556 var localId;
@@ -536,7 +563,7 @@ @@ -536,7 +563,7 @@
536 $('.next_step').hide() 563 $('.next_step').hide()
537 /*微信开始录音*/ 564 /*微信开始录音*/
538 wx.startRecord(); 565 wx.startRecord();
539 - }) 566 + });
540 567
541 //暂停 568 //暂停
542 $('.pause').click(function () { 569 $('.pause').click(function () {
@@ -544,7 +571,7 @@ @@ -544,7 +571,7 @@
544 $('.start').show() 571 $('.start').show()
545 $('.stopping').hide() 572 $('.stopping').hide()
546 573
547 - }) 574 + });
548 575
549 //停止录音 576 //停止录音
550 $('.stopping').click(function () { 577 $('.stopping').click(function () {
@@ -557,14 +584,14 @@ @@ -557,14 +584,14 @@
557 } 584 }
558 585
559 }); 586 });
560 - }) 587 + });
561 588
562 //下一步 589 //下一步
563 $('.next_step').click(function () { 590 $('.next_step').click(function () {
564 - $('.first').hide()  
565 - $('.second').show() 591 + $('.first').hide();
  592 + $('.second').show();
566 593
567 - }) 594 + });
568 595
569 //点击试听 596 //点击试听
570 $('.audition').click(function () { 597 $('.audition').click(function () {
@@ -719,8 +746,157 @@ @@ -719,8 +746,157 @@
719 $('.question_no').show(); 746 $('.question_no').show();
720 $(this).attr('data-id',1); 747 $(this).attr('data-id',1);
721 } 748 }
722 - }) 749 + });
723 750
  751 + //回复
  752 + $('#submit_reply').click(function () {
  753 + /*获取病人主诉*/
  754 + var display=$('.voice_btn1').css('display');
  755 + //console.log(display1);
  756 + if (display=='none'){
  757 + var reply='';
  758 + /*判断发送类型*/
  759 + var reply_type='1';
  760 + $('#voice_module1 .voice_third').each(function () {
  761 + /*拼接信息*/
  762 + var voiceId1=$(this).attr('data-serverid');
  763 + if (voiceId1!=undefined){
  764 + if (reply==''){
  765 + reply=voiceId1;
  766 + }else{
  767 + reply+=','+voiceId1;
  768 + }
  769 + }
  770 + })
  771 + }else{
  772 + var reply=$('.textarea1').val();
  773 + var reply_type='2';
  774 + if (!reply){
  775 + $('.form_popup_box').show();
  776 + $('.form_popup_box').text('回复内容不能为空');
  777 + $('.form_popup_box').delay(1000).hide(0);
  778 + return;
  779 + }
  780 + }
  781 + alert(JSON.stringify({
  782 + reply:reply,
  783 + reply_type:reply_type
  784 + }))
  785 + /*提交后台*/
  786 + $.ajax({
  787 + url:"{:url('replyTransfer',array('id'=>$info['id']))}",
  788 + type:'POST',
  789 + data:{
  790 + reply:reply,
  791 + reply_type:reply_type
  792 + },
  793 + success:function (res) {
  794 + console.log(res);
  795 + alert(JSON.stringify(res));
  796 + $('.box').show().delay(2000).hide(2)
  797 + },
  798 + error:function (res) {
  799 + alert(res);
  800 + }
  801 + })
  802 + });
  803 +
  804 + //同意
  805 + $('#agree_transfer').click(function () {
  806 +
  807 + /*获取病人主诉*/
  808 + var display2=$('.voice_btn2').css('display');
  809 + //console.log(display1);
  810 + if (display2=='none'){
  811 + var reply_again='';
  812 + /*判断发送类型*/
  813 + var ireply_again_type='1';
  814 + $('#voice_module2 .voice_third').each(function () {
  815 + /*拼接信息*/
  816 + var voiceId1=$(this).attr('data-serverid');
  817 + if (voiceId1!=undefined){
  818 + if (reply_again==''){
  819 + reply_again=voiceId1;
  820 + }else{
  821 + reply_again+=','+voiceId1;
  822 + }
  823 + }
  824 + })
  825 + }else{
  826 + var reply_again=$('.textarea2').val();
  827 + var reply_again_type='2';
  828 + if (!reply_again){
  829 + $('.form_popup_box').show();
  830 + $('.form_popup_box').text('转诊意见');
  831 + $('.form_popup_box').delay(1000).hide(0);
  832 + return;
  833 + }
  834 + }
  835 +
  836 + var receive_hospital = $('#receive_hospital').val();
  837 + var receive_expert = $('#receive_expert').val();
  838 + var receive_address = $('#receive_address').val();
  839 + var receive_time = $('#receive_time').val();
  840 + if (receive_hospital == '') {
  841 + $('.form_popup_box').show();
  842 + $('.form_popup_box').text('请填写接诊医院');
  843 + $('.form_popup_box').delay(1000).hide(0);
  844 + return false;
  845 + } else if (receive_expert == '') {
  846 + $('.form_popup_box').show();
  847 + $('.form_popup_box').text('请填写接诊专家');
  848 + $('.form_popup_box').delay(1000).hide(0);
  849 + return false;
  850 + } else if (receive_address == '') {
  851 + $('.form_popup_box').show();
  852 + $('.form_popup_box').text('请填写接诊地点');
  853 + $('.form_popup_box').delay(1000).hide(0);
  854 + return false;
  855 + } else if (receive_time == '') {
  856 + $('.form_popup_box').show();
  857 + $('.form_popup_box').text('请填写就诊时间');
  858 + $('.form_popup_box').delay(1000).hide(0);
  859 + return false;
  860 + }
  861 + /*提交后台*/
  862 + $.ajax({
  863 + url:"{:url('agreeTransfer',array('id'=>$info['id']))}",
  864 + type:'POST',
  865 + data:{
  866 + receive_hospital:receive_hospital,
  867 + receive_expert:receive_expert,
  868 + receive_address:receive_address,
  869 + receive_time:receive_time,
  870 + reply_again:reply_again,
  871 + reply_again_type:reply_again_type
  872 + },
  873 + success:function (res) {
  874 + console.log(res);
  875 + alert(JSON.stringify(res));
  876 + $('.box').show().delay(2000).hide(2)
  877 + },
  878 + error:function (res) {
  879 + alert(res);
  880 + }
  881 + })
  882 +
  883 + });
  884 +
  885 + //驳回
  886 + $('#refuse_transfer').click(function () {
  887 + $.ajax({
  888 + url:"{:url('refuseTransfer',array('id'=>$info['id']))}",
  889 + type:'POST',
  890 + success:function (res) {
  891 + console.log(res);
  892 + alert(JSON.stringify(res));
  893 + $('.box').show().delay(2000).hide(2)
  894 + },
  895 + error:function (res) {
  896 + alert(res);
  897 + }
  898 + })
  899 + });
724 </script> 900 </script>
725 </body> 901 </body>
726 </html> 902 </html>
@@ -950,7 +950,7 @@ @@ -950,7 +950,7 @@
950 } 950 }
951 }) 951 })
952 }else{ 952 }else{
953 - var inspected=$('.textarea1').val(); 953 + var inspected=$('.textarea2').val();
954 var inspected_type='2'; 954 var inspected_type='2';
955 if (!inspected){ 955 if (!inspected){
956 $('.form_popup_box').show(); 956 $('.form_popup_box').show();
@@ -1004,7 +1004,7 @@ @@ -1004,7 +1004,7 @@
1004 } 1004 }
1005 }) 1005 })
1006 }else{ 1006 }else{
1007 - var used_drugs=$('.textarea3').val(); 1007 + var used_drugs=$('.textarea4').val();
1008 var used_drugs_type='2'; 1008 var used_drugs_type='2';
1009 if (!used_drugs){ 1009 if (!used_drugs){
1010 $('.form_popup_box').show(); 1010 $('.form_popup_box').show();