addOrder.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>B2B商务采购单-添加</title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="Keywords" content="" />
  8. <meta name="Description" content="" />
  9. <link rel="stylesheet" href="static/css/add.css " />
  10. </head>
  11. <style>
  12. #pub .purc li div span .select02 {
  13. background: none;
  14. -webkit-appearance: inherit;
  15. appearance: inherit;
  16. -o-appearance: inherit;
  17. -moz-appearance: inherit;
  18. -ms-appearance: inherit;
  19. border: #bfbfbf 1px solid !important;
  20. width: 187px;
  21. }
  22. .dropdown-menu tr td button {
  23. border: none;
  24. }
  25. .oder-change .purc li .dropdown-menu {
  26. padding: 0;
  27. margin: 0;
  28. width: 185px;
  29. }
  30. .oder-change .purc li .dropdown-menu li {
  31. margin-bottom: 0;
  32. height: 34px;
  33. line-height: 34px;
  34. }
  35. .oder-change .purc li .dropdown-menu>li>a {
  36. display: inline-block;
  37. width: 100%;
  38. padding: 0;
  39. height: 34px;
  40. line-height: 34px;
  41. padding-left: 10px;
  42. }
  43. .dropdown-menu>.active>a, .dropdown-menu>.active>a:hover, .dropdown-menu>.active>a:focus
  44. {
  45. background: #5078cb;
  46. }
  47. .com_title01 a {
  48. float: right;
  49. color: #5078cb;
  50. font-weight: normal;
  51. margin-right: 30px;
  52. margin-top: 20px;
  53. font-size: 14px;
  54. }
  55. </style>
  56. <body>
  57. <div class="wrap" id="pub">
  58. <div class="content">
  59. <!--<div class="com_title">服务>采购模块>采购单<font>>新增采购单</font></div>-->
  60. <div class="com_head">
  61. <span>新增采购单</span>
  62. </div>
  63. <!--B2B商务采购变更-添加-->
  64. <form class="oder-change clearfix" name="orderForm" id="orderForm">
  65. <ul class="purc">
  66. <li>
  67. <div class="fl">
  68. <em>流水号:</em> <span>{{::order.code}}</span>
  69. </div>
  70. <div class="fr">
  71. <em>录入时间:</em> <span>{{::order.date | date:'yyyy-MM-dd
  72. HH:mm:ss'}}</span>
  73. </div>
  74. </li>
  75. <li>
  76. <div class="fl">
  77. <em>供应商:</em> <span><input type="text"
  78. ng-model="order.cust.enName" placeholder="输入供应商名称" class="bor01"
  79. ng-required="true"
  80. ng-change="getSimilarVendors(order.cust.enName)" name="enName"
  81. ng-focus="onFocus('enName')"
  82. typeahead="order.vendName for order in getSimilarVendors($viewValue)"
  83. autocomplete="off"
  84. typeahead-on-select="onAssociateCmpClick($item, order)"
  85. spellcheck="false" style="width: 147px;"> <a class="btn"
  86. ng-click="dbfindVend()"
  87. style="width: 40px; border: #bfbfbf 1px solid !important; border-radius: 0px; margin-left: -5px; margin-top: -3px;"><i
  88. class="fa fa-search" aria-hidden="true"></i></a> </span>
  89. </div>
  90. <div class="fr">
  91. <em>供应商联系人:</em> <span> <select class="select01"
  92. ng-model="order.vendor" required="required"
  93. ng-options="(contact.venduser + '' + contact.tel) for contact in contacts">
  94. <option value="">请选择供应商联系人</option>
  95. </select> <a class="add-address" ng-if="id!=null"
  96. ng-click="addContact(venduu)">+增加联系人</a>
  97. </span>
  98. </div>
  99. </li>
  100. <li>
  101. <div class="fl">
  102. <em>付款方式:</em> <span> <input ng-model="order.payments"
  103. list="paymentmethod" class="select02 wid152"
  104. placeholder="选择付款方式" /> <datalist id="paymentmethod">
  105. <option value="月结30天">月结30天</option>
  106. <option value="月结60天">月结60天</option>
  107. <option value="现金支付">现金支付</option>
  108. </datalist>
  109. </span>
  110. </div>
  111. <div class="fr">
  112. <em>交易币别:</em> <span> <select name=""
  113. class="select02 wid100" ng-model="order.currency"
  114. ng-init="order.currency = 'RMB'">
  115. <option value="RMB">RMB</option>
  116. <option value="USD">USD</option>
  117. <option value="HKD">HKD</option>
  118. </select>
  119. </span>
  120. </div>
  121. </li>
  122. <li>
  123. <div class="fr address">
  124. <em>收货信息:</em> <span class="fr" required="required"> <select
  125. class="select fl" ng-model="order.shipadd" required="required"
  126. ng-options="(ship.address + ship.addressdet + ' ' + ship.receiver + ' ' + ship.usertel) for ship in ships">
  127. <option value="">请选择收货地址</option>
  128. </select> <a href="javascript:void(0);" class="add-address">+新增收货信息</a>
  129. </span>
  130. </div>
  131. </li>
  132. <li class="beizhu">
  133. <div class="fl">
  134. <em>备注:</em> <span><input type="text"
  135. ng-model="order.remark" class="bor01" placeholder="请填写备注"
  136. style="cursor: pointer; width: 568px;" /></span>
  137. </div>
  138. </li>
  139. <li ng-show="false">
  140. <div class="fl">
  141. <em>税率:</em> <span class="fl" required="required"
  142. ng-if="order.currency == 'RMB'"> <select
  143. class="select02 wid100" ng-model="order.rate"
  144. required="required">
  145. <option value="17">17</option>
  146. <option value="0">0</option>
  147. </select>
  148. </span> <span class="fl" required="required"
  149. ng-if="order.currency != 'RMB'"> <input
  150. class="text select02 wid100" value="0" readonly>
  151. </span>
  152. </div>
  153. </li>
  154. </ul>
  155. <div class="com_title01"
  156. ng-if="order.orderItems[0].code == null && !order.cust.uu">
  157. <span>请先选择供应商</span>
  158. </div>
  159. <div class="com_title01"
  160. ng-if="order.orderItems[0].code == null && order.cust.uu">
  161. <span>请先选择供应商产品</span> <a ng-click="uplodaByBatch()">批量导入</a>
  162. </div>
  163. <div class="com_title01"
  164. ng-if="order.orderItems[0].code != null && order.cust.uu">
  165. <span>产品信息</span> <a ng-click="uplodaByBatch()">批量导入</a>
  166. </div>
  167. <!--产品信息-->
  168. <dl ng-if="order.orderItems[0].code != null">
  169. <dt>
  170. <b>序号</b> <b class="wid01">产品信息</b> <b>单位</b> <b>数量</b> <b>单价</b>
  171. <b>税率(%)</b> <b>交货日期</b> <b>备注</b> <b class="wid02">&nbsp;</b>
  172. </dt>
  173. <dd ng-repeat="item in order.orderItems">
  174. <b>{{$index + 1}}</b> <b class="wid01">
  175. <p>{{item.code}}</p>
  176. <p>{{item.title}}</p>
  177. <p>{{item.spec}}</p>
  178. </b> <b>{{item.unit}}</b> <b><input class="editable" type="text"
  179. ng-model="item.qty" placeholder="数量" style="cursor: pointer;"
  180. required="true"
  181. ng-pattern="/^(([0-9]+\.[0-9]{1,3})|([0-9]*[1-9][0-9]*\.[0-9]{1,3})|([0-9]*[1-9][0-9]*))$/" /></b>
  182. <b><input class="editable" type="text" ng-model="item.price"
  183. placeholder="单价" style="cursor: pointer;" required="true"
  184. ng-pattern="/^(([0-9]+\.[0-9]{1,6})|([0-9]*[1-9][0-9]*\.[0-9]{1,6})|([0-9]*[1-9][0-9]*))$/" /></b>
  185. <b ng-if="order.currency == 'RMB'"><input class="editable"
  186. type="text" ng-model="item.taxrate" placeholder="税率"
  187. style="cursor: pointer;" ng-pattern="/^[0-9][0-9]{0,1}$/" /></b> <b
  188. ng-if="order.currency != 'RMB'"><input class="editable"
  189. type="text" style="cursor: pointer;" value="0"
  190. readonly="readonly" /></b> <b> <input ng-model="item.delivery"
  191. type="text" class="editable" placeholder="选择时间"
  192. datepicker-popup="yyyy-MM-dd" is-open="item.$endDateOpen"
  193. min-date="getMinDate()" ng-required="true" current-text="今天"
  194. clear-text="清除" close-text="关闭"
  195. datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
  196. ng-focus="openDatePicker($event, item.$endDateOpen)"
  197. readonly="readonly"
  198. ng-click="openDatePicker($event, item.$endDateOpen, $index)">
  199. </b> <b class="textMore"><input class="editable" type="text"
  200. ng-model="item.remark" placeholder="备注" /></b> <b class="wid02"><a
  201. ng-click="deleteProduct($index)"><i class="fa fa-close"></i></a></b>
  202. </dd>
  203. </dl>
  204. <div class="save" ng-if="order.orderItems[0].code != null">
  205. <button ng-click="addToOrder(order)"
  206. ng-disabled="orderForm.$invalid">立即购买</button>
  207. <button ng-click="addToCart(order)"
  208. ng-disabled="orderForm.$invalid">添加购物车</button>
  209. </div>
  210. </form>
  211. <!-- 搜索结果列表-->
  212. <div class="pro-add-data02" style="min-height: 500px;"
  213. ng-if="order.cust.uu">
  214. <!--<div class="pro-search">
  215. <div class="search-result fl"><img src="static/img/purc/search01.png"/>搜索“{{tip}}”,为您找到<em>{{total}}</em>个结果</div>
  216. <div class="search fr">
  217. <input type="text" placeholder="输入供应商物料关键字查询" ng-model="keyword" autofocus ng-search="onSearch(keyword)"/>
  218. <a class="seek" ng-click="onSearch(keyword)">搜索</a>
  219. </div>
  220. </div>-->
  221. <div class="pro-search">
  222. <div class="col-xs-2 search-title fl">供应商产品库</div>
  223. <div class="col-xs-8 fr">
  224. <div class="col-xs-9 search" style="margin-right: 0;">
  225. <input type="text" placeholder="输入供应商物料关键字查询" ng-model="keyword"
  226. ng-search="onSearch(keyword)" /> <a class="seek"
  227. ng-click="onSearch(keyword)" style="right: inherit;">搜索</a>
  228. </div>
  229. <div class="col-xs-3 result-title fr">
  230. 搜索到<em>{{total}}</em>条
  231. </div>
  232. </div>
  233. </div>
  234. <table class="block table table-default table-striped"
  235. ng-table="tableParams">
  236. <thead>
  237. <tr class="header">
  238. <th width="250">名称</th>
  239. <th width="160">编号</th>
  240. <th>规格</th>
  241. <th width="80">单位</th>
  242. <th width="80">选择</th>
  243. </tr>
  244. </thead>
  245. <tbody ng-if="tableParams.total() == 0">
  246. <tr>
  247. <td class="text-center" colspan="7" ng-if="tip != null"><br>
  248. <div class="text-muted" style="font-size: 14px;">
  249. <i class="fa fa-spinner"></i> 搜索"{{tip}}"未找到产品信息,请重新输入搜索条件
  250. </div></td>
  251. <td class="text-center" colspan="7" ng-if="tip == null"><br>
  252. <div class="text-muted" style="font-size: 14px;">
  253. <i class="fa fa-spinner"></i> 您的供应商还未添加商品信息,请尽快通知供应商
  254. </div></td>
  255. </tr>
  256. </tbody>
  257. <tbody>
  258. <tr ng-repeat="product in $data">
  259. <td class="text-center" ng-bind="::product.title"></td>
  260. <td class="text-center" ng-bind="::product.code"></td>
  261. <td class="text-center f12" ng-bind="::product.spec"></td>
  262. <td class="text-center" ng-bind="::product.unit"></td>
  263. <td class="text-center"><a title="添加"
  264. href="javascript:void(0)" ng-click="check(product)"
  265. style="text-decoration: none; color: #327ebe;" id="click"
  266. class="add01">添加</a>
  267. <div class="add-tanchuang">
  268. <ul>
  269. <li>
  270. <div class="fl">数量:</div>
  271. <div class="fr">
  272. <div class="btn-wrap">
  273. <span class="number"> <a href="###" class="reduce">-</a>
  274. <input type="text" value="100"> <a href="###"
  275. class="add">+</a>
  276. </span>
  277. </div>
  278. </div>
  279. </li>
  280. <li>
  281. <div class="fl">交期:</div>
  282. <div class="fr">
  283. <input type="text" class="price-input" value="时间选择">
  284. </div>
  285. </li>
  286. <li>
  287. <div class="fl">单价:</div>
  288. <div class="fr">
  289. <input type="text" class="price-input" value="¥1.23">
  290. </div>
  291. </li>
  292. <li class="add-btn">
  293. <div class="fl">&nbsp;</div>
  294. <div class="fr">
  295. <a href="javascript:void(0);" class="off">取消</a><a
  296. href="javascript:void(0);" class="ok">确认</a>
  297. </div>
  298. </li>
  299. </ul>
  300. </div></td>
  301. </tr>
  302. </tbody>
  303. </table>
  304. </div>
  305. </div>
  306. </div>
  307. <!--设置-企业设置-收货地址编辑-->
  308. <div class="bomb-box" style="display: none">
  309. <form class="box04 box" name="shipAddress" id="shipAddress">
  310. <i class="off"><img src="static/img/purc/close.png" alt="" /></i>
  311. <p>收货人资料</p>
  312. <ul>
  313. <li class="line01">
  314. <div class="fl">
  315. <span class="fl"><em>*</em>收货人:
  316. </span> <span class="fr"><input type="text" placeholder="填写收货人"
  317. ng-model="ship.receiver" required="true"
  318. ng-pattern="/^[\u4e00-\u9fa5]{1,6}$|^[\dA-Za-z]{1,12}$/" /></span>
  319. </div>
  320. <div class="fr">
  321. <span class="fl"><em>*</em>手机:
  322. </span> <span class="fr"><input type="text"
  323. ng-model="ship.usertel" required="true"
  324. ng-pattern="/^1(3|4|5|7|8)\d{9}$/" /></span>
  325. </div>
  326. </li>
  327. <li class="line01">
  328. <div class="fl">
  329. <span class="fl">固定电话<em></em>:
  330. </span> <span class="fr"><input type="text" ng-model="ship.phone"
  331. ng-pattern="/([0-9]{3,4}-)?[0-9]{7,8}/" /></span>
  332. </div>
  333. <div class="fr">
  334. <span class="fl">邮箱:</span> <span class="fr emaill"><input
  335. type="text" ng-model="ship.email"
  336. ng-pattern="/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/" /><i>用于接收订单提醒邮件,便于您及时了解订单状态</i></span>
  337. </div>
  338. </li>
  339. <li class="line02 margin-top40">
  340. <div class="fl">
  341. <em>*</em>所在地址:
  342. </div> <!--<div class="select fr"><input type="text" placeholder="请选择" ng-model="ship.address" required="true"/><i class="fa fa-angle-down"></i></div>-->
  343. <div class="select fr">
  344. <select required="" class="area-select" ng-model="ship.province"
  345. ng-options="key as key for (key,value) in provinces"
  346. ng-change="ship.city='';ship.district='';" required="true">
  347. <option value="">省</option>
  348. </select> <select class="area-select" ng-model="ship.city"
  349. ng-options="key as key for (key,value) in provinces[ship.province]"
  350. ng-change="ship.district='';" required="true">
  351. <option value="">市</option>
  352. </select> <select class="area-select" ng-model="ship.district"
  353. ng-options="value as value for value in provinces[ship.province][ship.city]"
  354. required="true">
  355. <option value="">区</option>
  356. </select>
  357. </div>
  358. </li>
  359. <li class="line02">
  360. <div class="fl">
  361. <em>*</em>详细地址:
  362. </div>
  363. <div class="fr">
  364. <input type="text" ng-model="ship.addressdet" required="true" />
  365. </div>
  366. </li>
  367. <li class="line02">
  368. <div class="fl">地址别名:</div>
  369. <div class="fr address">
  370. <input type="text" ng-model="ship.addalias" /><i>建议填写常用名称:家里/父母家/公司</i>
  371. </div>
  372. </li>
  373. </ul>
  374. <div class="many-file-btn">
  375. <button class="btn01" ng-click="saveShipAddress(ship)"
  376. ng-disabled="shipAddress.$invalid">保存</button>
  377. <a href="#" class="btn02">取消</a>
  378. </div>
  379. </form>
  380. </div>
  381. <script src="static/lib/jquery/jquery.min.js"></script>
  382. <script>
  383. $(function(){
  384. /*下拉效果*/
  385. $('.select p').click(function(e){
  386. $('.select').toggleClass('open');
  387. e.stopPropagation();
  388. });
  389. $('.select ul li').click(function(e){
  390. var title=$(this).html();
  391. $('.select p').html(title);
  392. $(this).addClass('selected').siblings().removeClass('selected');
  393. $('.select').removeClass('open');
  394. e.stopPropagation();
  395. });
  396. $(document).click(function(){
  397. $('.select').removeClass('open');
  398. })
  399. /*鼠标移动上去删除*/
  400. $('.oder-change dl dd').hover(function(){
  401. $(this).find('a').toggle();
  402. });
  403. /*点击添加弹出框*/
  404. $(".pro-add-data02 .add01").click(function(){
  405. $(".add-tanchuang").show();
  406. $(this).parents("dd").addClass("active").siblings().removeClass("active");
  407. });
  408. $(".add-tanchuang a.off").click(function(){
  409. $(this).parents(".add-tanchuang").hide();
  410. $(this).parents(".pro-add-data02").find("dd").removeClass("active");
  411. });
  412. //增加数量
  413. $(document).on('click','.add-tanchuang .btn-wrap span.number a.add',function () {
  414. var sum = parseInt($(this).prev().val())+1;
  415. $(this).prev().val(sum)
  416. });
  417. //减少数量
  418. $(document).on('click','.add-tanchuang .btn-wrap span.number a.reduce',function () {
  419. var sum = parseInt($(this).next().val())-1;
  420. $(this).next().val(sum);
  421. });
  422. //新增收货地址
  423. $(".oder-change ul li .add-address").click(function(){
  424. document.getElementById('shipAddress').reset();
  425. $(".bomb-box").show();
  426. });
  427. $(".bomb-box .box04 .off,.box04 .many-file-btn .btn02").click(function(){
  428. $(".bomb-box").hide();
  429. })
  430. $(".bomb-box .box04 .off,.box04 .many-file-btn .btn01").click(function(){
  431. $(".bomb-box").hide();
  432. })
  433. })
  434. </script>
  435. </body>
  436. </html>