add.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <link rel="stylesheet" href="/static/bootstrap-3.3.7/css/bootstrap.css">
  9. <script type="text/javascript" src="/static/jquery-2.2.4.min.js"></script>
  10. <script type="text/javascript" src="/static/layer/layer.js"></script>
  11. <script src="http://md.jya-tech.com/static/elementui2.15.5/vue-2.6.14.js"></script>
  12. <script src="http://md.jya-tech.com/static/elementui2.15.5/index.js"></script>
  13. <link rel="stylesheet" href="http://md.jya-tech.com/repair/style.css">
  14. <link rel="stylesheet" href="http://md.jya-tech.com/static/elementui2.15.5/index.css"/>
  15. <link rel="stylesheet" href="http://md.jya-tech.com/static/elementui2.15.5/style/theme/index.css">
  16. <title>{$title}</title>
  17. </head>
  18. <body>
  19. <div class="container">
  20. <form method="post" action="{:url('add')}" class="form-horizontal" id="form">
  21. <input type="hidden" name="mode" value="{$mode}">
  22. <div class="add-content-box">
  23. <textarea name="content" id="" placeholder="请输入内容..." ></textarea>
  24. </div>
  25. <div class="add-img-box">
  26. <div class="upload-bx">
  27. {:widget_view('common/upimg',['name'=>'images','multi'=>9,'val'=>''])}
  28. </div>
  29. </div>
  30. <div class="add-contacts-info-box">
  31. <div class="header-box">联系人信息</div>
  32. <div class="add-form-group">
  33. <label class="control-label">姓名</label>
  34. <div class="input-right">
  35. <input type="text" name="name" value="" placeholder="请输入">
  36. </div>
  37. </div>
  38. <div class="add-form-group">
  39. <label class="control-label">电话</label>
  40. <div class="input-right">
  41. <input type="text" name="phone" value="" placeholder="请输入">
  42. </div>
  43. </div>
  44. </div>
  45. {if $mode == 3}
  46. <div class="add-content-box" style="padding-left: 10px;padding-top: 20px;height: 330px!important;" id="vueapp">
  47. <div class="col-sm-12">
  48. <div class="form-group">
  49. <label class="control-label" style="display: inline-block;float: left">运送类型<span class="text-danger">*</span></label></br>
  50. <div class="rr" style="width: 60%;display: inline-block;float: left;margin-top: -20px">
  51. <input type="hidden" name="type" id="type">
  52. <div>
  53. <el-select v-model="type" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  54. <el-option
  55. v-for="item in types"
  56. :key="item.id"
  57. :label="item.title"
  58. :value="item.id">
  59. </el-option>
  60. </el-select>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="col-sm-12">
  66. <div class="form-group" >
  67. <label class="control-label" style="display: inline-block;float: left">开始地点<span class="text-danger">*</span></label></br>
  68. <input type="hidden" value="0" name="start" id="start">
  69. <div class="rr" style="width: 60%;display: inline-block;float: left;margin-top: -20px">
  70. <el-select v-model="start" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  71. <el-option
  72. v-for="item in starts"
  73. :key="item.id"
  74. :label="item.title"
  75. :value="item.id">
  76. </el-option>
  77. </el-select>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="col-sm-12">
  82. <div class="form-group">
  83. <label class="control-label" style="display: inline-block;float: left">结束地点<span class="text-danger">*</span></label></br>
  84. <input type="hidden" name="end" id="end">
  85. <div style="width: 60%;display: inline-block;float: left;margin-top: -20px">
  86. <el-select v-model="end" size="small" clearable style="width: 100%" filterable placeholder="请选择">
  87. <el-option
  88. v-for="item in ends"
  89. :key="item.id"
  90. :label="item.title"
  91. :value="item.id">
  92. </el-option>
  93. </el-select>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="col-sm-12">
  98. <div class="form-group">
  99. <label class="control-label" style="display: inline-block;float: left">需求时间<span class="text-danger">*</span></label></br>
  100. <input type="hidden" name="xqTime" id="xqtime">
  101. <div class="rr" style="width: 60%;display: inline-block;float: left;margin-top: -20px">
  102. <el-date-picker
  103. style="width: 100%"
  104. size="small"
  105. v-model="xq_time"
  106. type="datetime"
  107. :editable="false"
  108. value-format="yyyy-MM-dd HH:mm"
  109. :clearable="true"
  110. @change="xqDateChange"
  111. placeholder="选择日期时间">
  112. </el-date-picker>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="col-sm-12">
  117. <div class="form-group">
  118. <label class="control-label" style="display: inline-block;float: left">应完成时间<span class="text-danger">*</span></label></br>
  119. <input type="hidden" name="ywcTime" id="ywctime">
  120. <div style="width: 60%;display: inline-block;float: left;margin-top: -20px">
  121. <el-date-picker
  122. style="width: 100%"
  123. size="small"
  124. v-model="ywc_time"
  125. type="datetime"
  126. :editable="false"
  127. value-format="yyyy-MM-dd HH:mm"
  128. :clearable="true"
  129. placeholder="选择日期时间">
  130. </el-date-picker>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="col-sm-12">
  135. <div class="form-group">
  136. <label class="control-label" style="display: inline-block;float: left">优 &nbsp;先 &nbsp;级</label></br>
  137. <input type="hidden" name="priority" id="priority">
  138. <div style="width: 60%;display: inline-block;float: left;margin-top: -13px">
  139. <el-radio v-model="priority" label="2">常规</el-radio>
  140. <el-radio v-model="priority" label="3">紧急</el-radio>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. {/if}
  146. <!-- <button type="submit" target-form="form-horizontal" class="add-btn ajax-post" >提交</button>-->
  147. <div class="add-btn" id="addBtn">提交</div>
  148. </form>
  149. </div>
  150. {if $mode == 2}
  151. <!-- <div class="add-table-record-box">-->
  152. <!-- <table class="table table-bordered">-->
  153. <!-- <tbody>-->
  154. <!-- {if isset($list)}-->
  155. <!-- {foreach $list as $k=>$v}-->
  156. <!-- <tr>-->
  157. <!-- <td>{$v['create_time']}</td>-->
  158. <!-- <td>{$v['addrName']}</td>-->
  159. <!-- <td>{$v['content']}</td>-->
  160. <!-- <td>{$v['statusTxt']}({$v['userName']})</td>-->
  161. <!-- </tr>-->
  162. <!-- {/foreach}-->
  163. <!-- {/if}-->
  164. <!-- </tbody>-->
  165. <!-- </table>-->
  166. <!-- </div>-->
  167. {/if}
  168. </body>
  169. </html>
  170. <script>
  171. $('#addBtn').click(function (){
  172. $.ajax({
  173. type: "POST",
  174. dataType: "json",
  175. url: '{:url("repair/add")}' ,
  176. data: $('#form').serialize(),
  177. success: function (res) {
  178. if (res.code == 1) {
  179. layer.msg('操作成功',{time:2000},function (){
  180. window.location.href = "{:url('addSuccess')}";
  181. })
  182. }else{
  183. layer.msg(res.msg,{time:2000},)
  184. }
  185. },
  186. error : function() {
  187. layer.msg('网络异常')
  188. }
  189. });
  190. })
  191. new Vue({
  192. el: '#vueapp',
  193. data: function() {
  194. return {
  195. starts: {:json_encode($address)},
  196. start: "",
  197. ends: {:json_encode($address)},
  198. end: '',
  199. types: {:json_encode($order_convey_type)},
  200. type: '',
  201. prioritys:{:json_encode($priority)},
  202. priority: "",
  203. devices: {:json_encode($order_device)},
  204. device: '',
  205. xq_time: '',
  206. ywc_time:'',
  207. }
  208. },
  209. watch: {
  210. type: function (newtype, oldtype) {
  211. $('#type').val(newtype);
  212. },
  213. start: function (newtype, oldtype) {
  214. $('#start').val(newtype);
  215. },
  216. end: function (newtype, oldtype) {
  217. $('#end').val(newtype);
  218. },
  219. priority: function (newtype, oldtype) {
  220. $('#priority').val(newtype);
  221. },
  222. device: function (newtype, oldtype) {
  223. $('#device').val(newtype);
  224. },
  225. xq_time: function (newtype, oldtype) {
  226. // var that = this;
  227. // $.post("{:url('getTime')}",{type:this.type,'start':newtype},function (res){
  228. // if(res.code == 1){
  229. // that.xq_time = res.data.xq_time;
  230. // that.ywc_time = res.data.ywc_time;
  231. // }
  232. //
  233. // })
  234. $('#xqtime').val(newtype);
  235. },
  236. ywc_time: function (newtype, oldtype) {
  237. $('#ywctime').val(newtype);
  238. },
  239. dep_id: function (newtype, oldtype) {
  240. $('#dep').val(newtype);
  241. },
  242. user_id: function (newtype, oldtype) {
  243. },
  244. roles_id: function (newtype, oldtype) {
  245. $('#to_roles_id').val(newtype);
  246. },
  247. },
  248. methods: {
  249. xqDateChange(e){
  250. // var that = this;
  251. // $.post("{:url('getTime')}",{type:this.type,'start':e},function (res){
  252. // if(res.code == 1){
  253. // that.xq_time = res.data.xq_time;
  254. // that.ywc_time = res.data.ywc_time;
  255. // }
  256. //
  257. // })
  258. // $('#xqtime').val(e);
  259. }
  260. }
  261. })
  262. </script>