self_add3.html 20 KB

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