orderScan_body.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title>AUI快速完成布局</title>
  8. <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  9. <link rel="stylesheet" type="text/css" href="../../css/html.css" />
  10. <style>
  11. @media screen and (-webkit-min-device-pixel-ratio: 1.5) {
  12. .aui-list .aui-list-item {
  13. background-image: none;
  14. }
  15. }
  16. @media screen and (-webkit-min-device-pixel-ratio: 1.5) {
  17. .aui-list {
  18. background-image: none;
  19. }
  20. }
  21. .aui-list .aui-list-header {
  22. padding: 0.5rem;
  23. }
  24. body {
  25. padding-bottom: 3rem;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <div id="app">
  31. <zmqalert v-bind:info = "alertInfo" v-on:donechoose="alertBtn"></zmqalert>
  32. <div class="aui-content aui-margin-b-15 zmq-width-90 zmq-margin-top-10 zmq-radius-5">
  33. <ul class="aui-list aui-form-list zmq-border-none">
  34. <li class="aui-list-header zmq-bg-white zmq-flex zmq-flex-start zmq-text-msg zmq-text-font-08">
  35. <img src="../../image/drawable-xhdpi/sp.png" class="zmq-icon-inline-middle" />配料信息
  36. </li>
  37. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  38. <li class="aui-list-item zmq-border-none">
  39. <div class="aui-list-item-inner">
  40. <div class="aui-list-item-label zmq-text-font-07">
  41. 配料编号
  42. </div>
  43. <div class="aui-list-item-input">
  44. <img class="zmq-btnIcon-right" src="../../image/drawable-xhdpi/scanbtn.png" v-on:click="scanCode"/>
  45. <input type="number" placeholder="请输入配料编号" v-model="storeInfo.serialNumber" readonly="readonly" v-on:click= "alertInfo.show = true" class="zmq-text-font-07" />
  46. </div>
  47. </div>
  48. </li>
  49. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  50. <li class="aui-list-item zmq-border-none">
  51. <div class="aui-list-item-inner">
  52. <div class="aui-list-item-label zmq-text-font-07">
  53. 配料名称
  54. </div>
  55. <div class="aui-list-item-input">
  56. <input type="text" placeholder="请输入配料名称" v-model = "storeInfo.comName" class="zmq-text-font-07">
  57. </div>
  58. </div>
  59. </li>
  60. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  61. <li class="aui-list-item">
  62. <div class="aui-list-item-inner">
  63. <div class="aui-list-item-label zmq-text-font-07">
  64. 配料类别
  65. </div>
  66. <div class="aui-list-item-input" v-on:click="chooseType">
  67. <div class="zmq-text-done zmq-text-font-07" v-cloak>
  68. {{typeItem.name}}
  69. </div>
  70. </div>
  71. </div>
  72. </li>
  73. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  74. <li class="aui-list-item">
  75. <div class="aui-list-item-inner">
  76. <div class="aui-list-item-label zmq-text-font-07">
  77. 配料品牌
  78. </div>
  79. <div class="aui-list-item-input">
  80. <input type="text" placeholder="请输入品牌" v-model = "storeInfo.brand" class="zmq-text-font-07">
  81. </div>
  82. </div>
  83. </li>
  84. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  85. <li class="aui-list-item">
  86. <div class="aui-list-item-inner">
  87. <div class="aui-list-item-label zmq-text-font-07">
  88. 配料规格
  89. </div>
  90. <div class="aui-list-item-input">
  91. <input type="text" placeholder="请输入配料规格" v-model = "storeInfo.spec" class="zmq-text-font-07">
  92. </div>
  93. </div>
  94. </li>
  95. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  96. <li class="aui-list-item">
  97. <div class="aui-list-item-inner">
  98. <div class="aui-list-item-label zmq-text-font-07">
  99. 配料型号
  100. </div>
  101. <div class="aui-list-item-input">
  102. <input type="text" placeholder="请输入配料型号" v-model = "storeInfo.model" class="zmq-text-font-07">
  103. </div>
  104. </div>
  105. </li>
  106. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  107. <li class="aui-list-item">
  108. <div class="aui-list-item-inner">
  109. <div class="aui-list-item-label zmq-text-font-07">
  110. 配料单位
  111. </div>
  112. <div class="aui-list-item-input">
  113. <input type="text" placeholder="请输入配料单位" v-model = "storeInfo.unti" class="zmq-text-font-07">
  114. </div>
  115. </div>
  116. </li>
  117. </ul>
  118. </div>
  119. <div class="aui-content aui-margin-b-15 zmq-width-90 zmq-margin-top-10 zmq-radius-5">
  120. <ul class="aui-list aui-form-list zmq-border-none">
  121. <li class="aui-list-header zmq-bg-white zmq-flex zmq-flex-start zmq-text-msg zmq-text-font-08">
  122. <img src="../../image/drawable-xhdpi/orderCode.png" class="zmq-icon-inline-middle" />配料价格
  123. </li>
  124. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  125. <li class="aui-list-item zmq-border-none">
  126. <div class="aui-list-item-inner">
  127. <div class="aui-list-item-label zmq-text-font-07">
  128. 进价
  129. </div>
  130. <div class="aui-list-item-input">
  131. <input type="number" placeholder="请输入配料进价" v-model = "storeInfo.bid" class="zmq-text-font-07">
  132. </div>
  133. </div>
  134. </li>
  135. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  136. <li class="aui-list-item zmq-border-none">
  137. <div class="aui-list-item-inner">
  138. <div class="aui-list-item-label zmq-text-font-07">
  139. 批发价
  140. </div>
  141. <div class="aui-list-item-input">
  142. <input type="number" placeholder="请输入配料批发价" v-model = "storeInfo.wholesale" class="zmq-text-font-07">
  143. </div>
  144. </div>
  145. </li>
  146. <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
  147. <li class="aui-list-item zmq-border-none">
  148. <div class="aui-list-item-inner">
  149. <div class="aui-list-item-label zmq-text-font-07">
  150. 销售价
  151. </div>
  152. <div class="aui-list-item-input">
  153. <input type="number" placeholder="请输入配料销售价" v-model = "storeInfo.marketing" class="zmq-text-font-07">
  154. </div>
  155. </div>
  156. </li>
  157. </ul>
  158. </div>
  159. <div class="zmq-footer-fixed zmq-padding-vertical-5">
  160. <div class="zmq-width-90 zmq-btn-img zmq-padding-vertical-10 zmq-textAlign-center zmq-text-white" v-on:click="addStore">
  161. 提交信息
  162. </div>
  163. </div>
  164. </div>
  165. </body>
  166. <script src="../../script/api.js" type="text/javascript"></script>
  167. <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  168. <script type="text/javascript" src="../../script/vue.js"></script>
  169. <script type="text/javascript" src="../../script/elememt-ui.js"></script>
  170. <script type="text/javascript" src="../../script/httpRequest.js"></script>
  171. <script type="text/javascript" src="../../script/vue_plugins.js"></script>
  172. <script type="text/javascript">
  173. apiready = function() {
  174. var id = api.pageParam.id;
  175. var page = api.pageParam.page;
  176. //var id = 0,page = 0;
  177. new Vue({
  178. el : '#app',
  179. data : {
  180. page : page,
  181. // 添加配料
  182. addStoreUrl : 'addStoreUrl',
  183. imageType : ['album', 'camera'], // 选择图片路径
  184. imgs : '', // 选择的图片
  185. // 配料类别
  186. getStoreTypeUrl : 'getStoreTypeUrl',
  187. typeList : [], // 配料类别数据
  188. // 配料详情
  189. storeInfo : {
  190. wlbm : '', // 物料编码
  191. comName : '', // 配料名称 ;
  192. serialNumber : '', //条形码 ;
  193. brand : '', // 品牌
  194. spec : '', // 规格 ;
  195. model : '', // 型号;
  196. goodstypeId : '', // 分类主键
  197. goodsType : '', //分类名称 ;
  198. unti : '', //单位 ;
  199. marketing : '', // 销售价 ;
  200. bid : '', //进价 ;
  201. wholesale : '', // 批发价
  202. remark : '', //备注 ;
  203. retailerId : '', //门店主键 ;
  204. spcx : '', // 适配车型
  205. },
  206. // 选择器
  207. UIActionSelector : '',
  208. FNScanner : '', // 扫码
  209. xwScanner : '',
  210. // 选择的分类
  211. typeItem : {
  212. name : '点击选择分类',
  213. id : ''
  214. },
  215. // 根据扫出来的轮胎码获取配料
  216. getStoreUrl : 'jinstoreByScanUrl',
  217. // 根据扫出来的码获取配料 0705
  218. getStoreUrl0705 : 'addStoreByScanUrl',
  219. // 弹出框信息
  220. alertInfo : {
  221. show : false,
  222. title : '请输入条码号',
  223. showMsg : true,
  224. msg : '请输入配料号',
  225. content : '',
  226. },
  227. },
  228. methods : {
  229. init : function() {
  230. // 获取配料类别
  231. var _this = this;
  232. this.storeInfo.retailerId = $api.getStorage("retailerid");
  233. if (page == 'get') {
  234. this.getStoreInfo();
  235. } else {
  236. this.getStore();
  237. }
  238. this.FNScanner = api.require('FNScanner');
  239. this.xwScanner = api.require('xwScanner');
  240. this.UIActionSelector = api.require('UIActionSelector');
  241. this.addEvent("refushModel", function() {
  242. _this.getStore();
  243. })
  244. // this.imageBrowser = api.require('imageBrowser');
  245. },
  246. // 获取配料详情
  247. getStoreInfo : function() {
  248. var data = {
  249. retailer_id : this.storeInfo.retailerId
  250. }, url = this.getStoreInfoUrl, _this = this;
  251. _this.$post(url, data, function(ret) {
  252. if (ret.code == 0) {
  253. var storeInfo = ret.bizGoodsDto;
  254. _this.storeInfo = {
  255. wlbm : this.wlbm,
  256. comName : storeInfo.comName, // 配料名称 ;
  257. serialNumber : storeInfo.serialNumber, //条形码 ;
  258. goodsNum : storeInfo.goodsNum, //配料编号;
  259. spec : storeInfo.spec, //规格 ;
  260. brand : storeInfo.brand, // 品牌
  261. model : storeInfo.model, // 配料型号
  262. goodsNum : storeInfo.goodsNum, // 配料库存数量
  263. goodstypeId : storeInfo.goodstypeId, // 分类主键
  264. goodsType : storeInfo.goodsType, //分类名称 ;
  265. unti : storeInfo.unti, //单位 ;
  266. marketing : storeInfo.marketing, // 销售价 ;
  267. wholesale : storeInfo.wholesale, // 批发价
  268. bid : storeInfo.bid, //进价 ;
  269. remark : storeInfo.remark, //备注 ;
  270. }
  271. }
  272. }, id);
  273. },
  274. // 点击了弹出层的按钮
  275. alertBtn : function(type) {
  276. this.storeInfo.serialNumber = this.alertInfo.content;
  277. this.getStoreInfoScan();
  278. },
  279. // 点击扫码获取条形码
  280. scanCode : function() {
  281. var _this = this;
  282. this.scant(this.xwScanner, function(content) {
  283. _this.storeInfo.serialNumber = content;
  284. _this.alertInfo.content = content;
  285. _this.getStoreInfoScan0705();
  286. })
  287. },
  288. getStoreInfoScan0705 : function() {
  289. var _this = this;
  290. var url = this.getStoreUrl0705;
  291. var data = {
  292. serialNumber : _this.storeInfo.serialNumber,
  293. retailerId : this.storeInfo.retailerId,
  294. url : 'json',
  295. type : 'body'
  296. }
  297. _this.$post(url, data, function(ret) {
  298. if (ret.code == 0) {
  299. var storeInfo = ret.data;
  300. if (storeInfo == null) {
  301. _this.storeInfo = {
  302. wlbm : '',
  303. serialNumber : _this.storeInfo.serialNumber,
  304. comName : '', // 配料名称 ;
  305. brand : '', // 品牌
  306. spec : '', // 规格 ;
  307. model : '', // 型号;
  308. goodstypeId : '', // 分类主键
  309. goodsType : '', //分类名称 ;
  310. unti : '', //单位 ;
  311. marketing : '', // 销售价 ;
  312. bid : '', //进价 ;
  313. wholesale : '', // 批发价
  314. remark : '', //备注 ;
  315. retailerId : _this.storeInfo.retailerId, //门店主键 ;
  316. spcx : '', // 适配车型
  317. }
  318. return;
  319. } else {
  320. _this.storeInfo = {
  321. serialNumber : _this.storeInfo.serialNumber,
  322. comName : storeInfo.materialName, // 配料名称 ;
  323. spec : storeInfo.specs, //规格 ;
  324. brand : storeInfo.brand, // 品牌
  325. model : storeInfo.model, // 配料型号
  326. goodsType : '轮胎', // 配料分类
  327. goodstypeId : '', // 分类主键
  328. wlbm : storeInfo.materialCode, // 物料编码
  329. unti : '', //单位 ;
  330. marketing : '', // 销售价 ;
  331. bid : '', //进价 ;
  332. wholesale : '', // 批发价
  333. remark : '', //备注 ;
  334. retailerId : _this.storeInfo.retailerId, //门店主键 ;
  335. spcx : '', // 适配车型
  336. }
  337. }
  338. }
  339. });
  340. },
  341. // 根据扫出来的码获取配料
  342. getStoreInfoScan : function() {
  343. var _this = this;
  344. var url = this.getStoreUrl;
  345. _this.$post(url, "", function(ret) {
  346. if (ret.code == 0) {
  347. var storeInfo = ret.materialDto;
  348. if (storeInfo == null) {
  349. api.toast({
  350. msg : '暂无该条码对应配料信息,请自行完善'
  351. });
  352. _this.storeInfo = {
  353. serialNumber : _this.storeInfo.serialNumber,
  354. comName : '', // 配料名称 ;
  355. brand : '', // 品牌
  356. spec : '', // 规格 ;
  357. model : '', // 型号;
  358. goodstypeId : '', // 分类主键
  359. goodsType : '', //分类名称 ;
  360. unti : '', //单位 ;
  361. marketing : '', // 销售价 ;
  362. bid : '', //进价 ;
  363. wholesale : '', // 批发价
  364. remark : '', //备注 ;
  365. retailerId : $api.getStorage("retailerid"), //门店主键 ;
  366. spcx : '', // 适配车型
  367. }
  368. return;
  369. } else {
  370. _this.storeInfo = {
  371. comName : storeInfo.materialName, // 配料名称 ;
  372. spec : storeInfo.specs, //规格 ;
  373. brand : storeInfo.brand, // 品牌
  374. model : storeInfo.model, // 配料型号
  375. goodsType : '轮胎', // 配料分类
  376. goodstypeId : '', // 分类主键
  377. }
  378. }
  379. }
  380. }, _this.storeInfo.serialNumber);
  381. },
  382. // 点击选择分类
  383. chooseType : function() {
  384. var _this = this;
  385. if (this.typeList == null || this.typeList.length == 0) {
  386. // 还没有维护分类信息
  387. this.showModal("温馨提示", "检测到您还未完善配料类别信息,请先完善配料类别", ["立即完善", "稍后完善"], function(index) {
  388. if (index == 1) {
  389. var page = {
  390. type : 2
  391. }
  392. _this.goWin("addModel_win", "./addModel_win.html", page);
  393. }
  394. return;
  395. })
  396. } else {
  397. this.chooseRegion(this.UIActionSelector, 1, this.typeList, function(ret) {
  398. if (ret.eventType == 'ok') {
  399. _this.typeItem = ret.selectedInfo[0];
  400. }
  401. });
  402. }
  403. },
  404. // 获取配料分类
  405. getStore : function() {
  406. var data = {
  407. retailer_id : this.storeInfo.retailerId,
  408. url : 'json',
  409. type : 'body'
  410. }, url = this.getStoreTypeUrl, _this = this;
  411. _this.$post(url, data, function(ret) {
  412. if (ret.code == 0) {
  413. _this.typeList = _this.actionSelectorData(ret.list, {
  414. name : "typeName",
  415. id : "id"
  416. });
  417. }
  418. })
  419. },
  420. // 提交添加配料
  421. addStore : function() {
  422. if (this.typeItem.id == '') {
  423. api.toast({
  424. msg : '请选择配料分类'
  425. });
  426. return;
  427. }
  428. // 判断信息 -- 价格必须填写
  429. // marketing : '', // 销售价 ;
  430. // bid : '', //进价 ;
  431. // wholesale : '', // 批发价
  432. if(this.storeInfo.bid == ''){
  433. api.toast({
  434. msg:'请填写配料进价'
  435. });
  436. return;
  437. }
  438. if(this.storeInfo.wholesale == ''){
  439. api.toast({
  440. msg:'请填写配料批发价'
  441. });
  442. return;
  443. }
  444. if(this.storeInfo.marketing == ''){
  445. api.toast({
  446. msg:'请填写配料销售价'
  447. });
  448. return;
  449. }
  450. this.storeInfo.goodsType = this.typeItem.name;
  451. this.storeInfo.goodstypeId = this.typeItem.id;
  452. // , {image : this.imgs}
  453. var data = this.storeInfo, url = this.addStoreUrl, _this = this;
  454. _this.$post(url, data, function(ret) {
  455. if (ret.code == 0) {
  456. api.toast({
  457. msg : '添加配料信息成功'
  458. });
  459. // 需要刷新外面列表
  460. _this.sendEvent("refushView");
  461. _this.sendEvent("refushStock");
  462. setTimeout(function() {
  463. api.closeWin({
  464. });
  465. }, 500);
  466. }
  467. })
  468. },
  469. // 选择图品
  470. ci : function() {
  471. var _this = this;
  472. this.chooseImage(function(path) {
  473. _this.imgs = path;
  474. })
  475. },
  476. },
  477. mounted : function() {
  478. this.init();
  479. }
  480. })
  481. }
  482. </script>
  483. </html>