yjhj_dispatch_add.html 23 KB

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