save.blade.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <style>
  5. .for_area {
  6. display: inline-block;
  7. width: 200px;
  8. }
  9. .upload_img {
  10. height: 150px;
  11. }
  12. .select1{
  13. width: 350px;
  14. }
  15. </style>
  16. @endsection
  17. @section('content')
  18. <body class="gray-bg">
  19. <div class="wrapper wrapper-content animated fadeInRight">
  20. <div class="row">
  21. <div class="col-sm-12">
  22. <div class="ibox float-e-margins">
  23. <div class="ibox-content">
  24. <form class="form-horizontal" id="form">
  25. <div class="form-group">
  26. <label class="col-sm-2 control-label" for="cn_title"><span class="red">* </span>项目名称(中文):</label>
  27. <div class="col-sm-8">
  28. <input type="text" class="form-control select1" id="cn_title" name="cn_title"
  29. value="{{$data->cn_title ?? ''}}">
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label class="col-sm-2 control-label" for="en_title"><span class="red">* </span>项目名称(英文):</label>
  34. <div class="col-sm-8">
  35. <input type="text" class="form-control select1" id="en_title" name="en_title"
  36. value="{{$data->en_title ?? ''}}">
  37. </div>
  38. </div>
  39. {{-- <div class="form-group">
  40. <label class="col-sm-2 control-label" for="old_id">项目原始Id:</label>
  41. <div class="col-sm-8">
  42. <input type="text" class="form-control select1" id="old_id" name="old_id"
  43. value="{{$data->old_id ?? ''}}">
  44. </div>
  45. </div>--}}
  46. <div class="form-group">
  47. <label class="col-sm-2 control-label" for="domain"><span class="red">* </span>域名:</label>
  48. <div class="col-sm-8">
  49. <input type="text" class="form-control select1" id="domain" name="domain"
  50. value="{{$data->domain??''}}">
  51. <span style="font-size: 12px;color: grey">如果有直接填写进去,如果无,请填写意向域名。请填写主域,不要包含www。例:baidu.com</span>
  52. </div>
  53. </div>
  54. <div class="hr-line-dashed"></div>
  55. <div class="form-group">
  56. <label class="col-sm-2 control-label" for="site_type"><span class="red">* </span>项目类型:</label>
  57. <div class="col-sm-8">
  58. <select class="form-control select1" id="site_type" name="site_type">
  59. <option value="">请选择</option>
  60. <option value="1" @if(($data->site_type??'')==1) selected @endif>企业网站</option>
  61. <option value="2" @if(($data->site_type??'')==2) selected @endif>电商网站</option>
  62. </select>
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <label class="col-sm-2 control-label" for="nature_type"><span class="red">* </span>公司性质:</label>
  67. <div class="col-sm-8">
  68. <select class="form-control select1"
  69. id="nature_type" name="nature_type">
  70. <option value="">请选择公司性质</option>
  71. @foreach($natures as $nature)
  72. <option value="{{$nature['inx']}}"
  73. @if(($data->nature_type??null)==$nature['inx']) selected @endif>{{$nature['val']}}</option>
  74. @endforeach
  75. </select>
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label class="col-sm-2 control-label" for="business_id"><span class="red">* </span>所属行业:</label>
  80. <div class="col-sm-8 ">
  81. <select class="form-control select1"
  82. id="business_id" name="business_id">
  83. <option value="">请选择行业</option>
  84. @foreach ($businesses as $business)
  85. <option value="{{$business->id}}"
  86. @if(($data->business_id??null)==$business->id) selected @endif>{{$business->title}}</option>
  87. @endforeach
  88. </select>
  89. </div>
  90. </div>
  91. <div class="form-group contacts">
  92. <div class="col-sm-10 col-sm-offset-1">
  93. <label for="contact_ids">客户联系人Ⅰ&nbsp;姓名:</label>
  94. <input type="text" class="form-control"
  95. style="width: 200px;display: inline-block;margin-left: 20px"
  96. name="contact_name" title="" value="{{$data->contacts[0]['name']??''}}">
  97. <label for="contact_ids" style="margin-left: 10px">邮箱:</label>
  98. <input type="email" class="form-control" style="width: 300px;display: inline-block;"
  99. name="contact_email" title="" value="{{$data->contacts[0]['email']??''}}">
  100. <label for="contact_ids" style="margin-left: 10px">手机:</label>
  101. <input type="text" class="form-control"
  102. style="width: 300px;display: inline-block;" title="" name="contact_mobile"
  103. value="{{$data->contacts[0]['mobile']??''}}">
  104. <label style="margin-left: 10px">职位:</label>
  105. <input type="text" class="form-control" style="width: 200px;display: inline-block;" name="contact_position"
  106. value="{{$data->contacts[0]['position']??''}}">
  107. </div>
  108. </div>
  109. <div class="form-group contacts">ctm
  110. <div class="col-sm-10 col-sm-offset-1">
  111. <label>客户联系人Ⅱ&nbsp;姓名:</label>
  112. <input type="text" class="form-control"
  113. style="width: 200px;display: inline-block;margin-left: 20px"
  114. name="contact_name" title="" value="{{$data->contacts[1]['name']??''}}">
  115. <label style="margin-left: 10px">邮箱:</label>
  116. <input type="email" class="form-control" style="width: 300px;display: inline-block;"
  117. name="contact_email" title="" value="{{$data->contacts[1]['email']??''}}">
  118. <label style="margin-left: 10px">手机:</label>
  119. <input type="text" class="form-control"
  120. style="width: 300px;display: inline-block;" title="" name="contact_mobile"
  121. value="{{$data->contacts[1]['mobile']??''}}">
  122. <label style="margin-left: 10px">职位:</label>
  123. <input type="text" class="form-control"
  124. style="width: 200px;display: inline-block;" name="contact_position"
  125. value="{{$data->contacts[1]['position']??''}}">
  126. </div>
  127. </div>
  128. <div class="form-group">
  129. <label class="col-sm-2 control-label" for="customer_demand_type"><span class="red">* </span>客户需求:</label>
  130. <div class="col-sm-8">
  131. <select class="form-control select1" id="customer_demand_type" name="customer_demand_type">
  132. <option value="">请选择</option>
  133. <option value="1" @if(($data->customer_demand_type??'')==1) selected @endif>客户询盘</option>
  134. <option value="2" @if(($data->customer_demand_type??'')==2) selected @endif>营销推广</option>
  135. <option value="3" @if(($data->customer_demand_type??'')==3) selected @endif>两者兼有</option>
  136. </select>
  137. </div>
  138. </div>
  139. <div class="form-group">
  140. <label class="col-sm-2 control-label" for="sign_amount"><span class="red">* </span>签单价格:</label>
  141. <div class="col-sm-8">
  142. <input type="text" class="form-control select1" id="sign_amount" name="sign_amount"
  143. value="{{$data->sign_amount??''}}">
  144. </div>
  145. </div>
  146. <div class="form-group">
  147. <label class="col-sm-2 control-label" for="pay_way"><span class="red">* </span>付款方式:</label>
  148. <div class="col-sm-8">
  149. <select class="form-control select1" id="pay_way" name="pay_way">
  150. <option value="">请选择</option>
  151. <option value="1" @if(($data->pay_way??'')==1) selected @endif>分期</option>
  152. <option value="2" @if(($data->pay_way??'')==2) selected @endif>全款</option>
  153. </select>
  154. </div>
  155. </div>
  156. <div class="form-group">
  157. <label class="col-sm-2 control-label" for="data_prepare_level"><span class="red">* </span>客户资料准备程度:</label>
  158. <div class="col-sm-8">
  159. <select class="form-control select1" id="data_prepare_level" name="data_prepare_level">
  160. <option value="">请选择</option>
  161. <option value="1" @if(($data->data_prepare_level??'')==1) selected @endif>已经准备</option>
  162. <option value="2" @if(($data->data_prepare_level??'')==2) selected @endif>一般准备</option>
  163. <option value="3" @if(($data->data_prepare_level??'')==3) selected @endif>还未准备</option>
  164. </select>
  165. </div>
  166. </div>
  167. <div class="form-group">
  168. <label class="col-sm-2 control-label" for="keyword_know_level"><span class="red">* </span>对关键词了解程度:</label>
  169. <div class="col-sm-8">
  170. <select class="form-control select1" id="keyword_know_level" name="keyword_know_level">
  171. <option value="">请选择</option>
  172. <option value="1" @if(($data->keyword_know_level??'')==1) selected @endif>已经了解</option>
  173. <option value="2" @if(($data->keyword_know_level??'')==2) selected @endif>一般了解</option>
  174. <option value="3" @if(($data->keyword_know_level??'')==3) selected @endif>不太了解</option>
  175. </select>
  176. </div>
  177. </div>
  178. <div class="form-group">
  179. <label class="col-sm-2 control-label" for="is_rebuild">客户是否了解要重新建站:</label>
  180. <div class="col-sm-8">
  181. <select class="form-control select1" id="is_rebuild" name="is_rebuild">
  182. <option value="">请选择</option>
  183. <option value="1" @if(($data->is_rebuild??'')==1) selected @endif>是</option>
  184. <option value="2" @if(($data->is_rebuild??'')==2) selected @endif>否</option>
  185. </select>
  186. </div>
  187. </div>
  188. <div class="form-group">
  189. <label class="col-sm-2 control-label" for="is_design_all">客户是否要整站设计:</label>
  190. <div class="col-sm-8">
  191. <select class="form-control select1" id="is_design_all" name="is_design_all">
  192. <option value="">请选择</option>
  193. <option value="1" @if(($data->is_design_all??'')==1) selected @endif>是</option>
  194. <option value="2" @if(($data->is_design_all??'')==2) selected @endif>否</option>
  195. </select>
  196. </div>
  197. </div>
  198. <div class="form-group">
  199. <label class="col-sm-2 control-label"><span class="red">* </span>地区:</label>
  200. <div class="col-sm-8" data-toggle="distpicker" id="distpicker">
  201. <select class="form-control for_area" title=""
  202. data-province="{{$data->area_text[0]??''}}"
  203. name="area_text"></select>
  204. <select class="form-control for_area" title=""
  205. data-city="{{$data->area_text[1]??''}}"
  206. name="area_text"></select>
  207. <select class="form-control for_area" title=""
  208. data-district="{{$data->area_text[2]??''}}"
  209. name="area_text"></select>
  210. </div>
  211. </div>
  212. <div class="hr-line-dashed"></div>
  213. <div class="form-group">
  214. <label class="col-sm-2 control-label" for="contract_ids"><span class="red">* </span>服务项目:</label>
  215. <div class="col-sm-8 ">
  216. <select class="form-control" style="width:350px;"
  217. id="contract_ids" name="contract_ids" multiple size="5">
  218. @foreach ($contracts as $item)
  219. <option value="{{$item->id}}"
  220. @if(in_array($item->id,$data->contract_ids??[])) selected @endif>{{$item->title}}</option>
  221. @endforeach
  222. </select>
  223. <span style="color: red;font-size: 12px">ctrl+鼠标点击/shift+鼠标点击 多选</span>
  224. </div>
  225. </div>
  226. <div class="form-group">
  227. <label class="col-sm-2 control-label" for="keyword_goal"><span class="red">* </span>关键词达标数:</label>
  228. <div class="col-sm-8">
  229. <input type="text" class="form-control select1" id="keyword_goal" name="keyword_goal"
  230. value="{{$data->keyword_goal??''}}">
  231. </div>
  232. </div>
  233. <div class="form-group">
  234. <label class="col-sm-2 control-label" for="link_goal"><span class="red">* </span>外链平台数:</label>
  235. <div class="col-sm-8">
  236. <input type="text" class="form-control select1" id="link_goal" name="link_goal"
  237. value="{{$data->link_goal??''}}">
  238. </div>
  239. </div>
  240. <div class="form-group">
  241. <label class="col-sm-2 control-label" for="article_goal"><span class="red">* </span>软文达标数:</label>
  242. <div class="col-sm-8">
  243. <input type="text" class="form-control select1" id="article_goal" name="article_goal"
  244. value="{{$data->article_goal??''}}">
  245. </div>
  246. </div>
  247. <div class="form-group">
  248. <label class="col-sm-2 control-label" for="other_demand">其他需求:</label>
  249. <div class="col-sm-8">
  250. <textarea class="form-control select1" id="other_demand"
  251. name="other_demand">{{$data->other_demand??''}}</textarea>
  252. </div>
  253. </div>
  254. <div class="hr-line-dashed"></div>
  255. <div class="form-group">
  256. <label class="col-sm-2 control-label" for="remark">其他备注:</label>
  257. <div class="col-sm-8">
  258. <textarea class="form-control select1" id="remark"
  259. name="remark">{{$data->remark??''}}</textarea>
  260. </div>
  261. </div>
  262. <div class="hr-line-dashed"></div>
  263. <div class="form-group">
  264. <label class="col-sm-2 control-label" for="head">首付:</label>
  265. <div class="col-sm-8">
  266. <input type="text" class="form-control select1" id="head" name="head"
  267. value="{{$payment->head??''}}">
  268. </div>
  269. </div>
  270. <div class="hr-line-dashed"></div>
  271. <div class="form-group">
  272. <label class="col-sm-2 control-label" for="done">建站收款:</label>
  273. <div class="col-sm-8">
  274. <input type="text" class="form-control select1" id="done" name="done"
  275. value="{{$payment->done??''}}">
  276. </div>
  277. </div>
  278. <div class="hr-line-dashed"></div>
  279. <div class="form-group">
  280. <label class="col-sm-2 control-label" for="reach">达标尾款:</label>
  281. <div class="col-sm-8">
  282. <input type="text" class="form-control select1" id="reach" name="reach"
  283. value="{{$payment->reach??''}}">
  284. </div>
  285. </div>
  286. <div class="hr-line-dashed"></div>
  287. <div class="form-group">
  288. <label class="col-sm-2 control-label" for="service_final_payment">服务期尾款:</label>
  289. <div class="col-sm-8">
  290. <input type="text" class="form-control select1" id="service_final_payment" name="service_final_payment"
  291. value="{{$payment->service_final_payment??''}}">
  292. </div>
  293. </div>
  294. <div class="hr-line-dashed"></div>
  295. <div class="form-group">
  296. <label class="col-sm-2 control-label" for="renewal">续费:</label>
  297. <div class="col-sm-8">
  298. <input type="text" class="form-control select1" id="renewal" name="renewal"
  299. value="{{$payment->renewal??''}}">
  300. </div>
  301. </div>
  302. <div class="hr-line-dashed"></div>
  303. <div class="form-group">
  304. <div class="col-sm-4 col-sm-offset-2">
  305. <button class="btn btn-primary" type="button" data-id="{{$data->id??0}}" id="save"
  306. onclick="units.save({{$data->id??0}})">
  307. 保存
  308. </button>
  309. <button class="btn btn-white closeLayer" type="button" id="cancel">取消</button>
  310. </div>
  311. </div>
  312. </form>
  313. </div>
  314. </div>
  315. </div>
  316. </div>
  317. </div>
  318. </body>
  319. @endsection
  320. @section('footer')
  321. <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
  322. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  323. <script src="{{asset('js/plugins/distpicker-master/dist/distpicker.js?v=1')}}"></script>
  324. <script>
  325. var config = {".chosen-select": {}};
  326. for (var selector in config) $(selector).chosen(config[selector]);
  327. laydate.render({
  328. elem: '#order_at', //指定元素
  329. type: 'date'
  330. });
  331. var units = {
  332. save: function (id) {
  333. var contacts = [];
  334. $(".contacts").each(function () { //客户联系人
  335. contacts.push({
  336. name: $(this).find("[name=contact_name]").val(),
  337. email: $(this).find("[name=contact_email]").val(),
  338. mobile: $(this).find("[name=contact_mobile]").val(),
  339. position: $(this).find("[name=contact_position]").val()
  340. });
  341. });
  342. var areaText = [];
  343. $("[name=area_text]").each(function () { //地区
  344. if ($(this).val().length !== 0) {
  345. areaText.push($(this).val());
  346. }
  347. });
  348. var site = tips.getFormValues('#form');
  349. site.contacts = contacts;
  350. site.area_text = areaText;
  351. site.contract_ids=$("#contract_ids").val();
  352. var payment = {
  353. head: $("#head").val(),
  354. //head_pic: $("#head_pic").val(),
  355. done: $("#done").val(),
  356. //done_pic: $("#done_pic").val(),
  357. reach: $("#reach").val(),
  358. //reach_pic: $("#reach_pic").val(),
  359. renewal: $("#renewal").val(),
  360. //renewal_pic: $("#renewal_pic").val(),
  361. service_final_payment:$("#service_final_payment").val(),
  362. };
  363. var ajaxConfig = {
  364. url: '/admin/sites/' + id,
  365. type: 'put',
  366. data: {site: site, payment: payment},
  367. success: function (result) {
  368. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  369. window.parent.tips.tableRefresh('#table');
  370. tips.closeParentLayer();
  371. });
  372. }
  373. };
  374. tips.ajax(ajaxConfig);
  375. }
  376. };
  377. $(document).on('click', '[name=file_upload]', function () {
  378. $(this).next().trigger('click');
  379. });
  380. $(document).on('change', '[name=uploadFile]', function () {
  381. var _this = this;
  382. if (!$(this)[0].files[0]) {
  383. return;
  384. }
  385. var formData = new FormData();
  386. formData.append('file', $(this)[0].files[0]);
  387. var ln;
  388. $.ajax({
  389. url: '/admin/tool/upload',
  390. type: 'POST',
  391. cache: false,
  392. data: formData,
  393. processData: false,
  394. contentType: false,
  395. beforeSend: function () {
  396. ln = layer.load();
  397. },
  398. complete: function () {
  399. layer.close(ln);
  400. },
  401. success: function (result) {
  402. var data = result.data;
  403. $('#' + $(_this).data('for')).attr('src', data.file_url);
  404. $(_this).next().val(data.file_url);
  405. },
  406. error: function (XMLHttpRequest) {
  407. if (XMLHttpRequest.status === 500) {
  408. layer.alert("异步请求失败", {icon: 5});
  409. return;
  410. }
  411. layer.alert(JSON.parse(XMLHttpRequest.responseText).message, {icon: 0});
  412. }
  413. });
  414. });
  415. </script>
  416. @endsection