0
0

self_add3.html 19 KB

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