dispatch_add3.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .rr{
  5. padding-right: 10px;
  6. }
  7. </style>
  8. <div class="row" id="formApp">
  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. <div class="col-sm-12">
  14. <div class="form-group">
  15. <label class="control-label">任务内容</label></br>
  16. <textarea name="content" class="form-control" cols="30" rows="3" id="value"></textarea>
  17. </div>
  18. </div>
  19. <div class="col-sm-12">
  20. <div class="form-group">
  21. <label class="control-label">部门</label></br>
  22. <input type="hidden" name="dep_id" id="dep" value="{$dep_id|default=0}">
  23. <el-select v-model="dep_id" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  24. <el-option
  25. v-for="item in dep"
  26. :key="item.id"
  27. :label="item.title"
  28. :value="item.id.toString()">
  29. </el-option>
  30. </el-select>
  31. </div>
  32. </div>
  33. {if $dispatch_type==0 && $two_dispatch_off==1}
  34. <div class="col-sm-12">
  35. <div class="form-group">
  36. <label class="control-label">执行人类型<span class="text-danger">*</span></label></br>
  37. <select name="userType" onchange="setType(this.value)" class="form-control">
  38. <option value="0">员工</option>
  39. <option value="1">二级调度</option>
  40. </select>
  41. </div>
  42. </div>
  43. {/if}
  44. <div id="type1" style="display:none">
  45. <div class="col-sm-12">
  46. <div class="form-group">
  47. <label class="control-label">二级调度<span class="text-danger">*</span></label></br>
  48. <input type="hidden" id="to_roles_id" name="to_roles_id">
  49. <el-select
  50. v-model="roles_id"
  51. multiple
  52. collapse-tags
  53. filterable
  54. size="small"
  55. style="width:100%"
  56. placeholder="请选择"
  57. >
  58. <el-option
  59. v-for="item in to_roles"
  60. :key="item.id"
  61. :label="item.title"
  62. :value="item.id.toString()">
  63. </el-option>
  64. </el-select>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="col-sm-12">
  69. <div class="form-group" id="type2">
  70. <label class="control-label">执行人<span class="text-danger">*</span></label></br>
  71. {if $send_user_num==0} <!--多选-->
  72. <input type="hidden" name="to_user_id" id="user_id">
  73. <el-select v-model="user_id" filterable clearable multiple placeholder="请选择" size="small"
  74. style="width:100%">
  75. <el-option-group
  76. v-for="group in user"
  77. :key="group.id"
  78. :label="group.name">
  79. <el-option
  80. v-for="item in group.user"
  81. :key="item.id"
  82. :label="item.real_name"
  83. :value="item.id.toString()">
  84. </el-option>
  85. </el-option-group>
  86. </el-select>
  87. {else}<!--单选-->
  88. <input type="hidden" name="to_user_id" id="user_id">
  89. <el-select v-model="user_id" filterable clearable placeholder="请选择" size="small"
  90. style="width:100%">
  91. <el-option-group
  92. v-for="group in user"
  93. :key="group.id"
  94. :label="group.name">
  95. <el-option
  96. v-for="item in group.user"
  97. :key="item.id"
  98. :label="item.real_name"
  99. :value="item.id.toString()">
  100. </el-option>
  101. </el-option-group>
  102. </el-select>
  103. {/if}
  104. </div>
  105. </div>
  106. <div class="col-sm-6">
  107. <div class="form-group">
  108. <label class="control-label">运送类型<span class="text-danger">*</span></label></br>
  109. <div class="rr">
  110. <input type="hidden" name="type" id="type">
  111. <div>
  112. <el-select v-model="type" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  113. <el-option
  114. v-for="item in types"
  115. :key="item.id"
  116. :label="item.title"
  117. :value="item.id">
  118. </el-option>
  119. </el-select>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="col-sm-6">
  125. <div class="form-group">
  126. <label class="control-label">始发空间<span class="text-danger">*</span></label></br>
  127. <input type="hidden" value="{$user.addr_id==0?'':$user.addr_id}" name="start" id="start">
  128. <el-select v-model="start" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  129. <el-option
  130. v-for="item in starts"
  131. :key="item.id"
  132. :label="item.title"
  133. :value="item.id.toString()">
  134. </el-option>
  135. </el-select>
  136. </div>
  137. </div>
  138. <div class="col-sm-6">
  139. <div class="form-group">
  140. <label class="control-label">优 &nbsp;先 &nbsp;级</label></br>
  141. <div class="rr">
  142. <input type="hidden" name="priority" id="priority">
  143. <el-select v-model="priority" size="small" clearable style="width: 100%" placeholder="请选择">
  144. <el-option
  145. v-for="(item,index) in prioritys"
  146. :key="index"
  147. :label="item"
  148. :value="index.toString()">
  149. </el-option>
  150. </el-select>
  151. </div>
  152. </div>
  153. </div>
  154. <div class="col-sm-6">
  155. <div class="form-group">
  156. <label class="control-label">目的空间<span class="text-danger">*</span></label></br>
  157. <input type="hidden" name="end" id="end">
  158. <el-select v-model="end" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  159. <el-option
  160. v-for="item in ends"
  161. :key="item.id"
  162. :label="item.title"
  163. :value="item.id">
  164. </el-option>
  165. </el-select>
  166. </div>
  167. </div>
  168. <div class="col-sm-12">
  169. <div class="form-group">
  170. <label class="control-label">运送设备</label></br>
  171. <input type="hidden" name="device_id" id="device">
  172. <el-select v-model="device" size="small" style="width: 100%" clearable filterable placeholder="请选择">
  173. <el-option
  174. v-for="item in devices"
  175. :key="item.id"
  176. :label="item.title"
  177. :value="item.id">
  178. </el-option>
  179. </el-select>
  180. </div>
  181. </div>
  182. <div class="col-sm-6">
  183. <div class="form-group">
  184. <label class="control-label">需求时间<span class="text-danger">*</span></label></br>
  185. <input type="hidden" name="xq_time" id="xqtime">
  186. <div class="rr">
  187. <el-date-picker
  188. style="width: 100%"
  189. size="small"
  190. v-model="xq_time"
  191. type="datetime"
  192. :editable="false"
  193. value-format="yyyy-MM-dd HH:mm"
  194. :clearable="true"
  195. placeholder="选择日期时间">
  196. </el-date-picker>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="col-sm-6">
  201. <div class="form-group">
  202. <label class="control-label">应完成时间<span class="text-danger">*</span></label></br>
  203. <input type="hidden" name="ywc_time" id="ywctime">
  204. <el-date-picker
  205. style="width: 100%"
  206. size="small"
  207. v-model="ywc_time"
  208. type="datetime"
  209. :editable="false"
  210. value-format="yyyy-MM-dd HH:mm"
  211. :clearable="true"
  212. placeholder="选择日期时间">
  213. </el-date-picker>
  214. </div>
  215. </div>
  216. <div class="col-sm-6">
  217. <div class="form-group">
  218. <label class="control-label">联系人</label></br>
  219. <div class="rr">
  220. <input type="text" class="form-control" name="name">
  221. </div>
  222. </div>
  223. </div>
  224. <div class="col-sm-6">
  225. <div class="form-group">
  226. <label class="control-label">联系电话</label></br>
  227. <input type="text" class="form-control" name="phone">
  228. </div>
  229. </div>
  230. <div class="col-sm-12">
  231. <div class="form-group">
  232. <label class="control-label">备注</label></br>
  233. <textarea name="todo_content" class="form-control" cols="30" rows="3" ></textarea>
  234. </div>
  235. </div>
  236. <div id="patient">
  237. <div class="col-sm-4">
  238. <div class="form-group">
  239. <label class="control-label">床号</label></br>
  240. <div class="rr">
  241. <input type="text" class="form-control" name="bed_number">
  242. </div>
  243. </div>
  244. </div>
  245. <div class="col-sm-4">
  246. <div class="form-group">
  247. <label class="control-label">姓名</label></br>
  248. <div class="rr">
  249. <input type="text" class="form-control" name="p_name">
  250. </div>
  251. </div>
  252. </div>
  253. <div class="col-sm-4">
  254. <div class="form-group">
  255. <label class="control-label">病案号</label></br>
  256. <div class="rr">
  257. <input type="text" class="form-control" name="ba_number">
  258. </div>
  259. </div>
  260. </div>
  261. <div class="col-sm-6">
  262. <div class="form-group">
  263. <label class="control-label">性别</label></br>
  264. <div class="rr">
  265. <select name="gender" class="form-control">
  266. <option value="0">未知</option>
  267. <option value="1">男</option>
  268. <option value="2">女</option>
  269. </select>
  270. </div>
  271. </div>
  272. </div>
  273. <div class="col-sm-6">
  274. <div class="form-group">
  275. <label class="control-label">是否往返</label></br>
  276. <select name="back" class="form-control">
  277. <option value="0">否</option>
  278. <option value="1">是</option>
  279. </select>
  280. </div>
  281. </div>
  282. </div>
  283. <div class="col-sm-12">
  284. <div class="hr-line-dashed">
  285. </div>
  286. </div>
  287. <div class="form-group">
  288. <div class="col-sm-6 col-sm-offset-2">
  289. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  290. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  291. </div>
  292. </div>
  293. </form>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. {/block}
  299. {block name="script"}
  300. <script>
  301. function setType(val) {
  302. if(val==1){
  303. $("#type1").css('display','block')
  304. $("#type2").css('display','none')
  305. }else {
  306. $("#type2").css('display','block')
  307. $("#type1").css('display','none')
  308. }
  309. }
  310. $(document).ready(function(){
  311. formSetValue("back", {$info.back|default=0});
  312. });
  313. $('#patient').hide();
  314. var vdevices = {:json_encode($order_device)};
  315. new Vue({
  316. el: '#formApp',
  317. data: function() {
  318. return {
  319. starts: {:json_encode($address)},
  320. start: "{$user.addr_id==0?'':$user.addr_id}",
  321. ends: {:json_encode($address)},
  322. end: '',
  323. types: {:json_encode($order_convey_type)},
  324. type: '',
  325. prioritys:{:json_encode($priority)},
  326. priority: '',
  327. devices: {:json_encode($order_device)},
  328. device: '',
  329. xq_time: '',
  330. ywc_time:'',
  331. dep: {:json_encode($dep_list)},
  332. dep_id: '{$dep_id}',
  333. user: {:json_encode($user_list)},
  334. user_id: '',
  335. to_roles: {:json_encode($dispatch_roles)},
  336. to_roles_id: '',
  337. roles_id:''
  338. }
  339. },
  340. watch: {
  341. type: function (newtype, oldtype) {
  342. $('#type').val(newtype);
  343. this.types.forEach((item) => {
  344. if(item.id == newtype){
  345. console.log(item);
  346. this.end = item.ends > 0?parseInt(item.ends):'';
  347. this.xq_time = item.xq_time?item.xq_time:'';
  348. this.ywc_time = item.ywc_time?item.ywc_time:'';
  349. this.priority = item.priority > 0?item.priority.toString():'';
  350. if(item.cate == 1){
  351. let devices = [];
  352. vdevices.forEach((item) => {
  353. if(item.patient == 1){
  354. devices.push(item);
  355. }
  356. });
  357. this.devices = devices;
  358. $('#patient').show();
  359. }else{
  360. this.devices = vdevices;
  361. $('#patient').hide();
  362. }
  363. }
  364. });
  365. },
  366. start: function (newtype, oldtype) {
  367. $('#start').val(newtype);
  368. },
  369. end: function (newtype, oldtype) {
  370. $('#end').val(newtype);
  371. },
  372. priority: function (newtype, oldtype) {
  373. $('#priority').val(newtype);
  374. },
  375. device: function (newtype, oldtype) {
  376. $('#device').val(newtype);
  377. },
  378. xq_time: function (newtype, oldtype) {
  379. $('#xqtime').val(newtype);
  380. },
  381. ywc_time: function (newtype, oldtype) {
  382. $('#ywctime').val(newtype);
  383. },
  384. dep_id: function (newtype, oldtype) {
  385. $('#dep').val(newtype);
  386. },
  387. user_id: function (newtype, oldtype) {
  388. if("{$send_user_num}"==="0"){
  389. $('#user_id').val(newtype.join(','));
  390. }else {
  391. $('#user_id').val(newtype);
  392. }
  393. },
  394. roles_id: function (newtype, oldtype) {
  395. $('#to_roles_id').val(newtype);
  396. },
  397. }
  398. })
  399. $('.cancel-btn').click(function () {
  400. parent.layer.closeAll();
  401. })
  402. </script>
  403. {/block}