0
0

yjhj_send.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .rr{
  5. padding-right: 10px;
  6. }
  7. </style>
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox float-e-margins">
  11. <div class="ibox-content">
  12. <form method="post" action="{:url('send',[],'')}/id/{$id}/mode/{$mode}" class="form-horizontal">
  13. <div class="col-sm-12">
  14. <div class="form-group">
  15. <label class="control-label">转单类型<span class="text-danger">*</span></label></br>
  16. <select name="work_type_mode" onchange="setWorkType(this.value)" class="form-control">
  17. <option value="-1">选择转单类型</option>
  18. {foreach $workType as $k=>$v}
  19. {if condition="in_array($v.id,$auths)"}
  20. <option value="{$v.id}">{$v.name}</option>
  21. {/if}
  22. {/foreach}
  23. </select>
  24. </div>
  25. </div>
  26. <div id="type3" style="display:none;">
  27. {if $dispatch_type==0 && $two_dispatch_off==1}
  28. <div class="col-sm-12">
  29. <div class="form-group" >
  30. <label class="control-label">执行人类型<span class="text-danger">*</span></label></br>
  31. <select name="userType" id="us" onchange="setType(this.value)" class="form-control">
  32. <option value="0">员工</option>
  33. <option value="1">二级调度</option>
  34. </select>
  35. </div>
  36. </div>
  37. {/if}
  38. </div>
  39. <div id="type1" style="display:none">
  40. {foreach $workType as $k=>$v}
  41. <div class="col-sm-12">
  42. <div id="d{$v.id}" style="display:none;">
  43. <div class="form-group">
  44. <label class="control-label">二级调度<span class="text-danger">*</span></label></br>
  45. {if $v.id==0}
  46. {:widget('common/multiselect',['name'=>'to_roles_id0','lists'=>$dispatch_roles0,'val'=>[]])}
  47. {/if}
  48. {if $v.id==1}
  49. {:widget('common/multiselect',['name'=>'to_roles_id1','lists'=>$dispatch_roles1,'val'=>[]])}
  50. {/if}
  51. {if $v.id==2}
  52. {:widget('common/multiselect',['name'=>'to_roles_id2','lists'=>$dispatch_roles2,'val'=>[]])}
  53. {/if}
  54. {if $v.id==3}
  55. {:widget('common/multiselect',['name'=>'to_roles_id3','lists'=>$dispatch_roles3,'val'=>[]])}
  56. {/if}
  57. {if $v.id==4}
  58. {:widget('common/multiselect',['name'=>'to_roles_id4','lists'=>$dispatch_roles4,'val'=>[]])}
  59. {/if}
  60. </div>
  61. </div>
  62. </div>
  63. {/foreach}
  64. </div>
  65. <div id="type2">
  66. {foreach $workType as $k=>$v}
  67. <div id="user{$v.id}" {if $dispatch_type==1 && $orders.work_type_mode==$v.id} style="display:block;" {else} style="display:none;"{/if} >
  68. <div class="col-sm-12">
  69. <div class="form-group">
  70. <label class="control-label">执行人<span class="text-danger">*</span></label></br>
  71. {if $v.id==0}
  72. {:widget('common/user-group-select',['name'=>'to_user_id0','lists'=>$user_list0,'multi'=>$send_user_num0,'val'=>'','msg'=>''])}
  73. {/if}
  74. {if $v.id==1}
  75. {:widget('common/user-group-select',['name'=>'to_user_id1','lists'=>$user_list1,'multi'=>$send_user_num1,'val'=>'','msg'=>''])}
  76. {/if}
  77. {if $v.id==2}
  78. {:widget('common/user-group-select',['name'=>'to_user_id2','lists'=>$user_list2,'multi'=>$send_user_num2,'val'=>'','msg'=>''])}
  79. {/if}
  80. {if $v.id==3}
  81. {:widget('common/user-group-select',['name'=>'to_user_id3','lists'=>$user_list3,'multi'=>$send_user_num3,'val'=>'','msg'=>''])}
  82. {/if}
  83. {if $v.id==4}
  84. {:widget('common/user-group-select',['name'=>'to_user_id4','lists'=>$user_list4,'multi'=>$send_user_num4,'val'=>'','msg'=>''])}
  85. {/if}
  86. </div>
  87. </div>
  88. </div>
  89. {/foreach}
  90. </div>
  91. <div id="bx" {if $orders.work_type_mode==1} style="display: block" {else} style="display: none" {/if}>
  92. <div class="col-sm-6">
  93. <div class="form-group">
  94. <label class="control-label">报修事项<span class="text-danger">*</span></label></br>
  95. <div class="rr">
  96. {:widget('common/select',['name'=>'type_id','lists'=>$order_type_list,'value'=>isset($order_repair) && !empty($order_repair)?$order_repair['type_id']:''])}
  97. </div>
  98. </div>
  99. </div>
  100. <div class="col-sm-6">
  101. <div class="form-group">
  102. <label class="control-label">报修地址</label></br>
  103. {:widget('common/select',['name'=>'address_id','lists'=>$address_list,'value'=>isset($order_repair) && !empty($order_repair)?$order_repair['address_id']:''])}
  104. </div>
  105. </div>
  106. <div class="col-sm-6">
  107. <div class="form-group">
  108. <label class="control-label">报修紧急程度</label></br>
  109. <select name="repair_priority" class="form-control" >
  110. <option value="2">普通</option>
  111. <option value="1">可延缓</option>
  112. <option value="3">紧急</option>
  113. </select>
  114. </div>
  115. </div>
  116. </div>
  117. <div id="ys" {if $orders.work_type_mode==3} style="display: block" {else} style="display: none" {/if}>
  118. <div class="col-sm-6">
  119. <div class="form-group">
  120. <label class="control-label">开始地点<span class="text-danger">*</span></label></br>
  121. <div class="rr">
  122. <input type="hidden" name="start" id="start" value="{$ocid.start}">
  123. <el-select v-model="start" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  124. <el-option
  125. v-for="item in starts"
  126. :key="item.id"
  127. :label="item.title"
  128. :value="item.id.toString()">
  129. </el-option>
  130. </el-select>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="col-sm-6">
  135. <div class="form-group">
  136. <label class="control-label">运送类型<span class="text-danger">*</span></label></br>
  137. <input type="hidden" name="type" id="type" value="{$ocid.type}">
  138. <el-select v-model="type" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  139. <el-option
  140. v-for="item in types"
  141. :key="item.id"
  142. :label="item.title"
  143. :value="item.id.toString()">
  144. </el-option>
  145. </el-select>
  146. </div>
  147. </div>
  148. <div class="col-sm-6">
  149. <div class="form-group">
  150. <label class="control-label">结束地点<span class="text-danger">*</span></label></br>
  151. <div class="rr">
  152. <input type="hidden" name="end" id="end" value="{$ocid.end}">
  153. <el-select v-model="end" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  154. <el-option
  155. v-for="item in ends"
  156. :key="item.id"
  157. :label="item.title"
  158. :value="item.id.toString()">
  159. </el-option>
  160. </el-select>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="col-sm-6">
  165. <div class="form-group">
  166. <label class="control-label">优 &nbsp;先 &nbsp;级</label></br>
  167. <input type="hidden" name="priority" id="priority" value="{$ocid.priority}">
  168. <el-select v-model="priority" size="small" clearable style="width: 100%" placeholder="请选择">
  169. <el-option
  170. v-for="(item,index) in prioritys"
  171. :key="index"
  172. :label="item"
  173. :value="index.toString()">
  174. </el-option>
  175. </el-select>
  176. </div>
  177. </div>
  178. <div class="col-sm-12">
  179. <div class="form-group">
  180. <label class="control-label">运送工具</label></br>
  181. <input type="hidden" name="device_id" id="device" value="{$ocid.device_id}">
  182. <el-select v-model="device" size="small" style="width: 100%" clearable filterable placeholder="请选择">
  183. <el-option
  184. v-for="item in devices"
  185. :key="item.id"
  186. :label="item.title"
  187. :value="item.id.toString()">
  188. </el-option>
  189. </el-select>
  190. </div>
  191. </div>
  192. <div class="col-sm-6">
  193. <div class="form-group">
  194. <label class="control-label">需求时间<span class="text-danger">*</span></label></br>
  195. <div class="rr">
  196. <input type="hidden" name="xq_time" id="xqtime" value="{$ocid.xq_time}">
  197. <el-date-picker
  198. style="width: 100%"
  199. size="small"
  200. v-model="xq_time"
  201. type="datetime"
  202. :editable="false"
  203. value-format="yyyy-MM-dd HH:mm"
  204. :clearable="true"
  205. placeholder="选择日期时间">
  206. </el-date-picker>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="col-sm-6">
  211. <div class="form-group">
  212. <label class="control-label">应完成时间<span class="text-danger">*</span></label></br>
  213. <input type="hidden" name="ywc_time" id="ywctime" value="{$ocid.ywc_time}">
  214. <el-date-picker
  215. style="width: 100%"
  216. size="small"
  217. v-model="ywc_time"
  218. type="datetime"
  219. :editable="false"
  220. value-format="yyyy-MM-dd HH:mm"
  221. :clearable="true"
  222. placeholder="选择日期时间">
  223. </el-date-picker>
  224. </div>
  225. </div>
  226. <div class="col-sm-6">
  227. <div class="form-group">
  228. <label class="control-label">联系人</label></br>
  229. <div class="rr">
  230. <input type="text" class="form-control" name="name">
  231. </div>
  232. </div>
  233. </div>
  234. <div class="col-sm-6">
  235. <div class="form-group">
  236. <label class="control-label">联系电话</label></br>
  237. <input type="text" class="form-control" name="phone">
  238. </div>
  239. </div>
  240. <div id="patient">
  241. <div class="col-sm-4">
  242. <div class="form-group">
  243. <label class="control-label">床号</label></br>
  244. <div class="rr">
  245. <input type="text" class="form-control" {if $opt && $opt.bed_number} value="{$opt.bed_number}" {/if} name="bed_number">
  246. </div>
  247. </div>
  248. </div>
  249. <div class="col-sm-4">
  250. <div class="form-group">
  251. <label class="control-label">姓名</label></br>
  252. <div class="rr">
  253. <input type="text" class="form-control" {if $opt && $opt.name} value="{$opt.name}" {/if} name="p_name">
  254. </div>
  255. </div>
  256. </div>
  257. <div class="col-sm-4">
  258. <div class="form-group">
  259. <label class="control-label">病案号</label></br>
  260. <input type="text" class="form-control" {if $opt && $opt.ba_number} value="{$opt.ba_number}" {/if} name="ba_number">
  261. </div>
  262. </div>
  263. <div class="col-sm-6">
  264. <div class="form-group">
  265. <label class="control-label">性别</label></br>
  266. <div class="rr">
  267. <select name="gender" class="form-control">
  268. <option {if $opt && $opt.gender==0} selected {/if} value="0">未知</option>
  269. <option {if $opt && $opt.gender==1} selected {/if} value="1">男</option>
  270. <option {if $opt && $opt.gender==2} selected {/if} value="2">女</option>
  271. </select>
  272. </div>
  273. </div>
  274. </div>
  275. <div class="col-sm-6">
  276. <div class="form-group">
  277. <label class="control-label">是否往返</label></br>
  278. <select name="back" class="form-control">
  279. <option value="0">否</option>
  280. <option value="1">是</option>
  281. </select>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. <div class="col-sm-12">
  287. <div class="form-group">
  288. <label class="control-label">备注</label></br>
  289. <textarea name="todo_content" class="form-control" cols="30" rows="3" ></textarea>
  290. </div>
  291. </div>
  292. <div class="col-sm-12">
  293. <div class="hr-line-dashed">
  294. </div>
  295. </div>
  296. <div class="form-group">
  297. <div class="col-sm-6 col-sm-offset-2">
  298. <button class="btn btn-primary ajax-post" data-layer="1" data-reload="1" target-form="form-horizontal" type="submit">确 定</button>
  299. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  300. </div>
  301. </div>
  302. </form>
  303. </div>
  304. </div>
  305. </div>
  306. </div>
  307. {/block}
  308. {block name="script"}
  309. <script>
  310. function setType(val) {
  311. if(val==1){
  312. $("#type1").css('display','block')
  313. $("#type2").css('display','none')
  314. }else {
  315. $("#type2").css('display','block')
  316. $("#type1").css('display','none')
  317. }
  318. }
  319. function setWorkType(val) {
  320. if(val <0){
  321. $("#user0").css('display','none')
  322. $("#user1").css('display','none')
  323. $("#user2").css('display','none')
  324. $("#user3").css('display','none')
  325. $("#user4").css('display','none')
  326. $("#bx").css('display','none')
  327. $("#ys").css('display','none')
  328. $("#type1").css('display','none')
  329. $("#type2").css('display','none')
  330. $("#type3").css('display','none')
  331. }else {
  332. $("#type3").css('display','block')
  333. if($('#us option:selected').val()==1){
  334. $("#type1").css('display','block')
  335. $("#type2").css('display','none')
  336. }else {
  337. $("#type2").css('display','block')
  338. $("#type1").css('display','none')
  339. }
  340. if(val==0){
  341. $("#user0").css('display','block')
  342. $("#d0").css('display','block')
  343. $("#user1").css('display','none')
  344. $("#d1").css('display','none')
  345. $("#user2").css('display','none')
  346. $("#d2").css('display','none')
  347. $("#user3").css('display','none')
  348. $("#d3").css('display','none')
  349. $("#user4").css('display','none')
  350. $("#d4").css('display','none')
  351. $("#bx").css('display','none')
  352. $("#ys").css('display','none')
  353. }
  354. if(val==1){
  355. $("#user0").css('display','none')
  356. $("#d0").css('display','none')
  357. $("#user1").css('display','block')
  358. $("#d1").css('display','block')
  359. $("#user2").css('display','none')
  360. $("#d2").css('display','none')
  361. $("#user3").css('display','none')
  362. $("#d3").css('display','none')
  363. $("#user4").css('display','none')
  364. $("#d4").css('display','none')
  365. $("#bx").css('display','block')
  366. $("#ys").css('display','none')
  367. }
  368. if(val==2){
  369. $("#user0").css('display','none')
  370. $("#d0").css('display','none')
  371. $("#user1").css('display','none')
  372. $("#d1").css('display','none')
  373. $("#user2").css('display','block')
  374. $("#d2").css('display','block')
  375. $("#user3").css('display','none')
  376. $("#d3").css('display','none')
  377. $("#user4").css('display','none')
  378. $("#d4").css('display','none')
  379. $("#bx").css('display','none')
  380. $("#ys").css('display','none')
  381. }
  382. if(val==3){
  383. $("#user0").css('display','none')
  384. $("#d0").css('display','none')
  385. $("#user1").css('display','none')
  386. $("#d1").css('display','none')
  387. $("#user2").css('display','none')
  388. $("#d2").css('display','none')
  389. $("#user3").css('display','block')
  390. $("#d3").css('display','block')
  391. $("#user4").css('display','none')
  392. $("#d4").css('display','none')
  393. $("#bx").css('display','none')
  394. $("#ys").css('display','block')
  395. }
  396. if(val==4){
  397. $("#user0").css('display','none')
  398. $("#d0").css('display','none')
  399. $("#user1").css('display','none')
  400. $("#d1").css('display','none')
  401. $("#user2").css('display','none')
  402. $("#d2").css('display','none')
  403. $("#user3").css('display','none')
  404. $("#d3").css('display','none')
  405. $("#user4").css('display','block')
  406. $("#d4").css('display','block')
  407. $("#bx").css('display','none')
  408. $("#ys").css('display','none')
  409. }
  410. }
  411. }
  412. if('{$ps}'=='1'){
  413. $('#patient').hide();
  414. }
  415. var vdevices = {:json_encode($order_device)};
  416. new Vue({
  417. el: '#ys',
  418. data: function() {
  419. return {
  420. starts: {:json_encode($address)},
  421. start: '{$ocid.start}',
  422. ends: {:json_encode($address)},
  423. end: '{$ocid.end}',
  424. types: {:json_encode($order_convey_type)},
  425. type:'{$ocid.type}',
  426. prioritys:{:json_encode($priority)},
  427. priority: '{$ocid.priority}',
  428. devices: {:json_encode($order_device)},
  429. device: '{$ocid.device_id}',
  430. xq_time: '{$ocid.xq_time}',
  431. ywc_time:'{$ocid.ywc_time}',
  432. }
  433. },
  434. watch: {
  435. type: function (newtype, oldtype) {
  436. $('#type').val(newtype);
  437. this.types.forEach((item) => {
  438. if(item.id == newtype){
  439. console.log(item);
  440. this.end = item.ends > 0?parseInt(item.ends).toString():'';
  441. this.xq_time = item.xq_time?item.xq_time:'';
  442. this.ywc_time = item.ywc_time?item.ywc_time:'';
  443. this.priority = item.priority > 0?item.priority.toString():'';
  444. if(item.cate == 1){
  445. let devices = [];
  446. vdevices.forEach((item) => {
  447. if(item.patient == 1){
  448. devices.push(item);
  449. }
  450. });
  451. this.devices = devices;
  452. $('#patient').show();
  453. }else{
  454. this.devices = vdevices;
  455. $('#patient').hide();
  456. }
  457. }
  458. });
  459. },
  460. start: function (newtype, oldtype) {
  461. $('#start').val(newtype);
  462. },
  463. end: function (newtype, oldtype) {
  464. $('#end').val(newtype);
  465. },
  466. priority: function (newtype, oldtype) {
  467. $('#priority').val(newtype);
  468. },
  469. device: function (newtype, oldtype) {
  470. $('#device').val(newtype);
  471. },
  472. xq_time: function (newtype, oldtype) {
  473. $('#xqtime').val(newtype);
  474. },
  475. ywc_time: function (newtype, oldtype) {
  476. $('#ywctime').val(newtype);
  477. },
  478. }
  479. })
  480. </script>
  481. {/block}