rejectedIndex.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "/";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = 2);
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./resources/js/singles/rejectedIndex.js":
  89. /*!***********************************************!*\
  90. !*** ./resources/js/singles/rejectedIndex.js ***!
  91. \***********************************************/
  92. /*! no static exports found */
  93. /***/ (function(module, exports) {
  94. var vueList = new Vue({
  95. el: "#list",
  96. data: {
  97. filterParams: {
  98. created_at: '',
  99. owner_id: '',
  100. order_number: '',
  101. logistic_number_return: '',
  102. mobile_sender: '',
  103. barcode_goods: '',
  104. is_checked: '',
  105. created_at_start: '',
  106. created_at_end: '',
  107. id_quality_label: '',
  108. is_loaded: '',
  109. checked_numbers: '',
  110. paginate: '50'
  111. },
  112. checkBoxAll: [],
  113. rejectedBills: rejectedBills,
  114. rejectedBills_checkBoxes: [],
  115. owners: owners,
  116. qualityLabels: qualityLabels
  117. },
  118. mounted: function mounted() {
  119. $(".tooltipTarget").tooltip({
  120. 'trigger': 'hover'
  121. });
  122. this.initInputs();
  123. $('#list').removeClass('d-none');
  124. },
  125. methods: {
  126. filterRun: function filterRun() {
  127. var form = $("<form method='get'></form>");
  128. this.filterParams['page'] = '';
  129. for (var key in this.filterParams) {
  130. if (this.filterParams[key]) {
  131. form.append($("<input type='hidden' name='" + key + "' value='" + this.filterParams[key] + "'>"));
  132. }
  133. }
  134. $("body").append(form);
  135. form.submit();
  136. },
  137. created_at_startChange: function created_at_startChange(e) {
  138. this.filterParams.created_at_start = e.target.value;
  139. this.filterRun();
  140. },
  141. created_at_endChange: function created_at_endChange(e) {
  142. this.filterParams.created_at_end = e.target.value;
  143. this.filterRun();
  144. },
  145. owner_idChange: function owner_idChange(e) {
  146. this.filterParams.owner_id = e.target.value;
  147. this.filterRun();
  148. },
  149. is_checkedChange: function is_checkedChange(e) {
  150. this.filterParams.is_checked = e.target.value;
  151. this.filterRun();
  152. },
  153. id_quality_labelChange: function id_quality_labelChange(e) {
  154. this.filterParams.id_quality_label = e.target.value;
  155. this.filterRun();
  156. },
  157. is_loadedChange: function is_loadedChange(e) {
  158. this.filterParams.is_loaded = e.target.value;
  159. this.filterRun();
  160. },
  161. mobile_senderChange: function mobile_senderChange(e) {
  162. this.filterParams.mobile_sender = e.target.value;
  163. this.filterRun();
  164. },
  165. checked_numbersChange: function checked_numbersChange(e) {
  166. this.filterParams.checked_numbers = e.target.value;
  167. this.filterRun();
  168. },
  169. initInputs: function initInputs() {
  170. var data = this; // let uriParts = decodeURI(location.href).split("?");
  171. // if(uriParts.length>1){
  172. // let params = uriParts[1].split('&');
  173. // params.forEach(function(paramPair){
  174. // let pair=paramPair.split('=');
  175. // let key = pair[0], val = pair[1];
  176. // $('input[name="'+key+'"]').val(val);
  177. // $('select[name="'+key+'"]').val(val);
  178. // data.filterParams[key]=val;
  179. // });
  180. // }
  181. for (var key in paginateParams) {
  182. var val = paginateParams[key];
  183. $('input[name="' + key + '"]').val(val);
  184. $('select[name="' + key + '"]').val(val);
  185. data.filterParams[key] = val;
  186. }
  187. },
  188. edit: function edit(e) {
  189. var id = $(e.target).parents('tr').attr('data-id');
  190. var editFullUri = editUrl + id + "/edit"; // location.href = editFullUri;
  191. var form = $('<form action=\"' + editFullUri + '\" method="post" target="_blank"></form>');
  192. form.append('<input type="hidden" name="filterParams" value=\'' + JSON.stringify(this.filterParams) + '\'/>');
  193. form.append(csrfInput);
  194. $('body').append(form);
  195. form.submit();
  196. },
  197. destroy: function destroy(rejectedBill) {
  198. if (!confirm('确定要删除退货信息“' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '”吗?')) {
  199. return;
  200. }
  201. var data = this;
  202. var url = destroyUrl + rejectedBill.id;
  203. axios["delete"](url, {
  204. id: rejectedBill.id
  205. }).then(function (response) {
  206. if (response.data.success) {
  207. for (var i = 0; i < data.rejectedBills.length; i++) {
  208. if (data.rejectedBills[i].id === rejectedBill.id) {
  209. data.rejectedBills.splice(i, 1);
  210. break;
  211. }
  212. }
  213. tempTip.setDuration(1000);
  214. tempTip.showSuccess('删除退货信息"' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '"成功!');
  215. } else {
  216. tempTip.setDuration(1000);
  217. tempTip.show('删除退货信息"' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '"失败!');
  218. }
  219. })["catch"](function (err) {
  220. tempTip.setDuration(3000);
  221. tempTip.show('删除退货信息失败!' + '网络错误:' + err);
  222. console.log(err);
  223. });
  224. },
  225. created_at_startEntering: function created_at_startEntering(e) {
  226. if (e.key === 'Enter') {
  227. this.created_at_startChange(e);
  228. }
  229. },
  230. created_at_endEntering: function created_at_endEntering(e) {
  231. if (e.key === 'Enter') {
  232. this.created_at_endChange(e);
  233. }
  234. },
  235. owner_idEntering: function owner_idEntering(e) {
  236. if (e.key === 'Enter') {
  237. e.target.value = $('#owner_id').val();
  238. this.owner_idChange(e);
  239. e.target.value = '';
  240. }
  241. },
  242. locateOwner: function locateOwner(e) {
  243. str = e.target.value.trim();
  244. if (str === '') return;
  245. $("#owner_id option").attr("selected", false);
  246. var selectingOption = $("#owner_id").find("option:contains(" + str + ")").eq(0);
  247. selectingOption.attr("selected", true); // this.filterParams.owner_id=selectingOption.val();
  248. },
  249. order_numberEntering: function order_numberEntering(e) {
  250. if (e.key === 'Enter') {
  251. this.filterParams.order_number = e.target.value;
  252. this.filterRun();
  253. }
  254. },
  255. barcode_goodsEntering: function barcode_goodsEntering(e) {
  256. if (e.key === 'Enter') {
  257. this.filterParams.barcode_goods = e.target.value;
  258. this.filterRun();
  259. }
  260. },
  261. logistic_number_returnEntering: function logistic_number_returnEntering(e) {
  262. if (e.key === 'Enter') {
  263. this.filterParams.logistic_number_return = e.target.value;
  264. this.filterRun();
  265. }
  266. },
  267. logistic_numberEntering: function logistic_numberEntering(e) {
  268. if (e.key === 'Enter') {
  269. this.filterParams.logistic_number = e.target.value;
  270. this.filterRun();
  271. }
  272. },
  273. cancelCheckConfirmAll: function cancelCheckConfirmAll() {
  274. $('#checkConfirmingAll').tooltip('hide');
  275. setTimeout(function () {
  276. $(".tooltipTarget").tooltip({
  277. 'trigger': 'hover'
  278. });
  279. }, 10);
  280. this.checkBoxAll = false;
  281. this.rejectedBills.forEach(function (rejectedBill) {
  282. if (rejectedBill.is_checked === -1) rejectedBill.is_checked = '0';
  283. });
  284. },
  285. setIsLoaded_batch: function setIsLoaded_batch(e) {
  286. var _this = this;
  287. if (_this.rejectedBills_checkBoxes.length === 0) {
  288. tempTip.show('没有勾选记录');
  289. $(e.target).val("");
  290. return;
  291. }
  292. var val = $(e.target).val();
  293. var is_loaded = 0;
  294. var is_loadedLabel = '否';
  295. if (val === "1") {
  296. is_loaded = 1;
  297. is_loadedLabel = '是';
  298. } else if (val === "2") {
  299. is_loaded = 2;
  300. is_loadedLabel = '待推单';
  301. } else if (val === "null") {
  302. is_loaded = 'null';
  303. is_loadedLabel = '无需入库';
  304. }
  305. if (!confirm("确定要标记所有勾选入库情况为'" + is_loadedLabel + "'吗")) {
  306. return;
  307. }
  308. axios.post(ajaxCheckUrl, {
  309. ids: _this.rejectedBills_checkBoxes,
  310. is_loaded: is_loaded
  311. }).then(function (response) {
  312. if (response.data.success) {
  313. _this.rejectedBills_checkBoxes.forEach(function (id) {
  314. _this.rejectedBills.forEach(function (bill) {
  315. if (bill.id === id) {
  316. bill.is_loaded = is_loaded;
  317. }
  318. });
  319. });
  320. tempTip.setDuration(1000);
  321. tempTip.showSuccess('修改勾选记录的入库状态成功');
  322. } else {
  323. tempTip.setDuration(2500);
  324. tempTip.show('修改勾选记录的入库状态失败,错误:' + response.data.fail_info);
  325. }
  326. })["catch"](function (e) {
  327. alert('网络连接错误:' + e);
  328. tempTip.setDuration(2500);
  329. tempTip.show('审核勾选内容失败,网络连接错误:' + e);
  330. console.log(e);
  331. });
  332. $(e.target).val("");
  333. },
  334. checkBoxAllToggle: function checkBoxAllToggle(e) {
  335. var _this = this;
  336. if (_this.rejectedBills_checkBoxes.length >= this.rejectedBills.length) {
  337. _this.rejectedBills_checkBoxes = [];
  338. _this.checkBoxAll = [];
  339. } else {
  340. _this.rejectedBills_checkBoxes = [];
  341. this.rejectedBills.forEach(function (bill) {
  342. _this.rejectedBills_checkBoxes.push(bill.id);
  343. _this.checkBoxAll = [1];
  344. });
  345. }
  346. },
  347. checkAll: function checkAll() {
  348. var _this = this;
  349. if (_this.rejectedBills_checkBoxes.length === 0) {
  350. tempTip.show('没有勾选记录');
  351. return;
  352. }
  353. if (!confirm("确定要标记所有勾选内容为'已审核'吗")) {
  354. return;
  355. }
  356. axios.post(ajaxCheckAllURL, {
  357. ids: _this.rejectedBills_checkBoxes
  358. }).then(function (response) {
  359. if (response.data.success) {
  360. response.data.rejecteds.forEach(function (rejected) {
  361. _this.rejectedBills.forEach(function (rejectedBill) {
  362. if (parseInt(rejectedBill.id) === parseInt(rejected.id)) {
  363. rejectedBill.is_checked = 1;
  364. rejectedBill.checked_numbers = rejected.checked_numbers;
  365. }
  366. });
  367. });
  368. tempTip.setDuration(1000);
  369. tempTip.showSuccess('审核勾选内容成功');
  370. } else {
  371. tempTip.setDuration(2500);
  372. tempTip.show('审核勾选内容失败,错误:' + response.data.fail_info);
  373. }
  374. })["catch"](function (e) {
  375. alert('网络连接错误:' + e);
  376. tempTip.setDuration(2500);
  377. tempTip.show('审核勾选内容失败,网络连接错误:' + e);
  378. console.log(e);
  379. });
  380. },
  381. finishAll: function finishAll() {
  382. var _this = this;
  383. if (_this.rejectedBills_checkBoxes.length === 0) {
  384. tempTip.show('没有勾选记录');
  385. return;
  386. }
  387. if (!confirm("确定要标记所有勾选内容为'已完结'吗")) {
  388. return;
  389. }
  390. axios.post(ajaxFinishAllUrl, {
  391. ids: _this.rejectedBills_checkBoxes
  392. }).then(function (response) {
  393. if (response.data.success) {
  394. _this.rejectedBills.forEach(function (rejectedBill) {
  395. _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
  396. if (rejectedBill.id === checkedId) {
  397. rejectedBill.is_finished = 1;
  398. }
  399. });
  400. });
  401. tempTip.setDuration(1000);
  402. tempTip.showSuccess('标记勾选内容为完结成功');
  403. } else {
  404. tempTip.setDuration(2500);
  405. tempTip.show('标记勾选内容为完结失败,错误:' + response.data.fail_info);
  406. }
  407. })["catch"](function (e) {
  408. alert('网络连接错误:' + e);
  409. tempTip.setDuration(2500);
  410. tempTip.show('标记勾选内容完结失败,网络连接错误:' + e);
  411. console.log(e);
  412. });
  413. },
  414. exportExcel: function exportExcel(e) {
  415. var _this = this;
  416. var val = $(e.target).val();
  417. $(e.target).val("");
  418. var form;
  419. if (val === "1") {
  420. if (_this.rejectedBills_checkBoxes.length === 0) {
  421. tempTip.show('没有勾选记录');
  422. return;
  423. }
  424. form = $('<form action=\"' + exportExcelURL + '\" method="post" target="_blank"></form>');
  425. form.append('<input type="hidden" name="ids" value=\'' + JSON.stringify(_this.rejectedBills_checkBoxes) + '\'/>');
  426. }
  427. if (val === "2") {
  428. if (!confirm("确定要导出当前条件下全部页的结果吗?")) {
  429. return;
  430. }
  431. if (total > 100000) {
  432. tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录', '知道了');
  433. }
  434. form = $('<form action=\"' + exportExcelOnFilterParamsURL + '\" method="post" target="_blank"></form>');
  435. form.append('<input type="hidden" name="filterParams" value=\'' + JSON.stringify(_this.filterParams) + '\'/>');
  436. }
  437. form.append(csrfInput);
  438. $('#list').append(form);
  439. form.submit();
  440. tempTip.setDuration(5000);
  441. tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截");
  442. },
  443. setPaginate: function setPaginate(e) {
  444. var _this = this; // let val=$(e.target).val();
  445. this.filterParams.paginate = e.target.value;
  446. this.filterRun();
  447. }
  448. },
  449. computed: {
  450. isBeingFilterConditions: function isBeingFilterConditions() {
  451. for (var key in this.filterParams) {
  452. if (this.filterParams[key]) {
  453. if (key === 'paginate') continue;
  454. if (key === 'page') continue;
  455. return true;
  456. }
  457. }
  458. return false;
  459. }
  460. },
  461. filters: {
  462. yesNo: function yesNo(val) {
  463. if (!val || val === 0 || val === '0') {
  464. return '否';
  465. }
  466. return '是';
  467. },
  468. yesNoIsLoaded: function yesNoIsLoaded(val) {
  469. switch (val) {
  470. case 0:
  471. case '0':
  472. return '否';
  473. case 1:
  474. case '1':
  475. return '是';
  476. case 2:
  477. case '2':
  478. return '待推单';
  479. case null:
  480. case 'null':
  481. return '无需入库';
  482. }
  483. return '';
  484. }
  485. }
  486. });
  487. /***/ }),
  488. /***/ 2:
  489. /*!*****************************************************!*\
  490. !*** multi ./resources/js/singles/rejectedIndex.js ***!
  491. \*****************************************************/
  492. /*! no static exports found */
  493. /***/ (function(module, exports, __webpack_require__) {
  494. module.exports = __webpack_require__(/*! D:\Reald\desktop\BsWAS\src\resources\js\singles\rejectedIndex.js */"./resources/js/singles/rejectedIndex.js");
  495. /***/ })
  496. /******/ });