self_add3.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row" id="formApp">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <form method="post" action="{:url('selfAdd',[],'')}/mode/{$mode}" class="form-horizontal">
  8. <div class="col-sm-12">
  9. <div class="form-group">
  10. <label class="control-label">任务内容</label></br>
  11. <textarea name="content" class="form-control" cols="30" rows="3" id="value"></textarea>
  12. </div>
  13. </div>
  14. <div class="col-sm-12">
  15. <div class="form-group">
  16. <label class="control-label">部门</label></br>
  17. <input type="hidden" name="dep_id" id="dep">
  18. <el-select v-model="dep_id" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  19. <el-option
  20. v-for="item in dep"
  21. :key="item.id"
  22. :label="item.title"
  23. :value="item.id.toString()">
  24. </el-option>
  25. </el-select>
  26. </div>
  27. </div>
  28. <div class="col-sm-6">
  29. <div class="form-group">
  30. <label class="control-label">运送类型<span class="text-danger">*</span></label></br>
  31. <input type="hidden" name="type" id="type">
  32. <div style="padding-right: 10px">
  33. <el-select v-model="type" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  34. <el-option
  35. v-for="item in types"
  36. :key="item.id"
  37. :label="item.title"
  38. :value="item.id">
  39. </el-option>
  40. </el-select>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="col-sm-6">
  45. <div class="form-group">
  46. <label class="control-label">始发空间<span class="text-danger">*</span></label></br>
  47. <input type="hidden" value="{$user.addr_id==0?'':$user.addr_id}" name="start" id="start">
  48. <div >
  49. <el-select v-model="start" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  50. <el-option
  51. v-for="item in starts"
  52. :key="item.id"
  53. :label="item.title"
  54. :value="item.id.toString()">
  55. </el-option>
  56. </el-select>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="col-sm-6">
  61. <div class="form-group">
  62. <label class="control-label">优 &nbsp;先 &nbsp;级</label></br>
  63. <input type="hidden" name="priority" id="priority">
  64. <div style="padding-right: 10px">
  65. <el-select v-model="priority" size="small" clearable style="width: 100%" placeholder="请选择">
  66. <el-option
  67. v-for="(item,index) in prioritys"
  68. :key="index"
  69. :label="item"
  70. :value="index.toString()">
  71. </el-option>
  72. </el-select>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="col-sm-6">
  77. <div class="form-group">
  78. <label class="control-label">目的空间<span class="text-danger">*</span></label></br>
  79. <input type="hidden" name="end" id="end">
  80. <div >
  81. <el-select v-model="end" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  82. <el-option
  83. v-for="item in ends"
  84. :key="item.id"
  85. :label="item.title"
  86. :value="item.id">
  87. </el-option>
  88. </el-select>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="col-sm-12">
  93. <div class="form-group">
  94. <label class="control-label">运送设备</label></br>
  95. <input type="hidden" name="device_id" id="device">
  96. <el-select v-model="device" size="small" style="width: 100%" clearable filterable placeholder="请选择">
  97. <el-option
  98. v-for="item in devices"
  99. :key="item.id"
  100. :label="item.title"
  101. :value="item.id">
  102. </el-option>
  103. </el-select>
  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. <input type="hidden" name="xq_time" id="xqtime">
  110. <div style="padding-right: 10px">
  111. <el-date-picker
  112. style="width: 100%"
  113. size="small"
  114. v-model="xq_time"
  115. type="datetime"
  116. :editable="false"
  117. value-format="yyyy-MM-dd HH:mm"
  118. :clearable="true"
  119. placeholder="选择日期时间">
  120. </el-date-picker>
  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" name="ywc_time" id="ywctime">
  128. <el-date-picker
  129. style="width: 100%"
  130. size="small"
  131. v-model="ywc_time"
  132. type="datetime"
  133. :editable="false"
  134. value-format="yyyy-MM-dd HH:mm"
  135. :clearable="true"
  136. placeholder="选择日期时间">
  137. </el-date-picker>
  138. </div>
  139. </div>
  140. <div class="col-sm-6">
  141. <div class="form-group">
  142. <label class="control-label">联系人</label></br>
  143. <div style="padding-right: 10px">
  144. <input type="text" class="form-control" name="name">
  145. </div>
  146. </div>
  147. </div>
  148. <div class="col-sm-6">
  149. <div class="form-group">
  150. <label class="control-label">联系电话</label></br>
  151. <input type="text" class="form-control" name="phone">
  152. </div>
  153. </div>
  154. <div id="patient">
  155. <div class="col-sm-4">
  156. <div class="form-group">
  157. <label class="control-label">床号</label></br>
  158. <div style="padding-right: 10px">
  159. <input type="text" class="form-control" name="bed_number">
  160. </div>
  161. </div>
  162. </div>
  163. <div class="col-sm-4">
  164. <div class="form-group">
  165. <label class="control-label">姓名</label></br>
  166. <div style="padding-right: 10px">
  167. <input type="text" class="form-control" name="p_name">
  168. </div>
  169. </div>
  170. </div>
  171. <div class="col-sm-4">
  172. <div class="form-group">
  173. <label class="control-label">病案号</label></br>
  174. <input type="text" class="form-control" name="ba_number">
  175. </div>
  176. </div>
  177. <div class="col-sm-6">
  178. <div class="form-group">
  179. <label class="control-label">性别</label></br>
  180. <div style="padding-right: 10px">
  181. <select name="gender" class="form-control">
  182. <option value="0">未知</option>
  183. <option value="1">男</option>
  184. <option value="2">女</option>
  185. </select>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="col-sm-6">
  190. <div class="form-group">
  191. <label class="control-label">是否往返</label></br>
  192. <select name="back" class="form-control">
  193. <option value="0">否</option>
  194. <option value="1">是</option>
  195. </select>
  196. </div>
  197. </div>
  198. </div>
  199. <div class="col-sm-12">
  200. <div class="hr-line-dashed">
  201. </div>
  202. </div>
  203. <div class="form-group">
  204. <div class="col-sm-6 col-sm-offset-2">
  205. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  206. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  207. </div>
  208. </div>
  209. </form>
  210. </div>
  211. </div>
  212. </div>
  213. </div>
  214. {/block}
  215. {block name="script"}
  216. <script>
  217. $(document).ready(function(){
  218. formSetValue("back", {$info.back|default=0});
  219. });
  220. $('#patient').hide();
  221. var vdevices = {:json_encode($order_device)};
  222. new Vue({
  223. el: '#formApp',
  224. data: function() {
  225. return {
  226. starts: {:json_encode($address)},
  227. start: "{$user.addr_id==0?'':$user.addr_id}",
  228. ends: {:json_encode($address)},
  229. end: '',
  230. types: {:json_encode($order_convey_type)},
  231. type: '',
  232. prioritys:{:json_encode($priority)},
  233. priority: '',
  234. devices: {:json_encode($order_device)},
  235. device: '',
  236. xq_time: '',
  237. ywc_time:'',
  238. dep: {:json_encode($dep_list)},
  239. dep_id: '{$dep_id}',
  240. }
  241. },
  242. watch: {
  243. type: function (newtype, oldtype) {
  244. $('#type').val(newtype);
  245. this.types.forEach((item) => {
  246. if(item.id == newtype){
  247. console.log(item);
  248. this.end = item.ends > 0?parseInt(item.ends):'';
  249. this.xq_time = item.xq_time?item.xq_time:'';
  250. this.ywc_time = item.ywc_time?item.ywc_time:'';
  251. this.priority = item.priority > 0?item.priority.toString():'';
  252. if(item.cate == 1){
  253. let devices = [];
  254. vdevices.forEach((item) => {
  255. if(item.patient == 1){
  256. devices.push(item);
  257. }
  258. });
  259. this.devices = devices;
  260. $('#patient').show();
  261. }else{
  262. this.devices = vdevices;
  263. $('#patient').hide();
  264. }
  265. }
  266. });
  267. },
  268. start: function (newtype, oldtype) {
  269. $('#start').val(newtype);
  270. },
  271. end: function (newtype, oldtype) {
  272. $('#end').val(newtype);
  273. },
  274. priority: function (newtype, oldtype) {
  275. $('#priority').val(newtype);
  276. },
  277. device: function (newtype, oldtype) {
  278. $('#device').val(newtype);
  279. },
  280. xq_time: function (newtype, oldtype) {
  281. $('#xqtime').val(newtype);
  282. },
  283. ywc_time: function (newtype, oldtype) {
  284. $('#ywctime').val(newtype);
  285. },
  286. dep_id: function (newtype, oldtype) {
  287. $('#dep').val(newtype);
  288. }
  289. }
  290. })
  291. $('.cancel-btn').click(function () {
  292. parent.layer.closeAll();
  293. })
  294. </script>
  295. {/block}