index.blade.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. @extends('layouts.app')
  2. @section('title')推单任务助手-新建任务@endsection
  3. @section('content')
  4. <div class="d-none" id="list">
  5. <!--查询 -->
  6. <div class="row m-3" style="background-color: #fff;">
  7. <div class="form-group ml-4 mt-3" data-toggle="tooltip" data-placement="top" title="选择全部">
  8. <input @change="checkAllBtn()" v-model="checkAll" type="checkbox" class="form-check-input"
  9. id="checkAll">
  10. <label class="form-check-label" for="checkAll">选择全部</label>
  11. </div>
  12. <div class="form-group m-2">
  13. <select class="form-control selectpicker" title="分页大小" v-model="size">
  14. <option value="50">50</option>
  15. <option value="100">100</option>
  16. <option value="200">200</option>
  17. <option value="500">500</option>
  18. <option value="1000">1000</option>
  19. </select>
  20. </div>
  21. <div class="form-group m-2">
  22. <select class="form-control selectpicker" title="货主" v-model="search.ownerId">
  23. <option v-for="item of selectData.owners" :value="item.id">@{{ item.name }}</option>
  24. </select>
  25. </div>
  26. <div class="form-group m-2">
  27. <select class="form-control selectpicker" title="类型" v-model="search.type">
  28. <option value="正品">正品</option>
  29. <option value="次品">次品</option>
  30. </select>
  31. </div>
  32. <div class="form-group m-2">
  33. <select class="form-control selectpicker" title="类型" v-model="search.status">
  34. <option selected value="创建">创建</option>
  35. <option value="等待下载">等待下载</option>
  36. <option value="已下载">已下载</option>
  37. <option value="部分推单">部分推单</option>
  38. <option value="已推单">已推单</option>
  39. <option value="部分入库">部分入库</option>
  40. <option value="已入库">已入库</option>
  41. </select>
  42. </div>
  43. <div class="form-group m-2">
  44. <button class="form-control btn btn-sm btn-info" @click="searchData()">查询</button>
  45. </div>
  46. <div class="form-group m-2">
  47. <button class="form-control btn btn-sm btn-info" @click="stopStoreUp()">批量停止攒单</button>
  48. </div>
  49. </div>
  50. <!-- 表格-->
  51. <table class="table table-striped table-bordered table-hover card-body td-min-width-80" id="table">
  52. <tr v-for="(item,i) in details.data" @click="selectTr===i+1?selectTr=0:selectTr=i+1"
  53. :class="selectTr===i+1?'focusing' : ''">
  54. <td>
  55. <input class="checkItem" type="checkbox" v-model="item.checked">
  56. <span>@{{ i+1 }}</span>
  57. </td>
  58. <td class="td-warm text-muted"><span>@{{ item.id }}</span></td>
  59. <td class="td-warm text-muted"><span>@{{ item.type }}</span></td>
  60. <td class="td-warm text-muted"><span>@{{ item.status }}</span></td>
  61. <td class="td-warm text-muted"><span>@{{ item.asnNos }}</span></td>
  62. <td class="td-warm text-muted"><span>@{{ item.ownerName }}</span></td>
  63. <td class="td-warm text-muted"><span>@{{ item.storeUpHour }}</span></td>
  64. <td class="td-warm text-muted">
  65. <span>
  66. @{{ item.orderAmount }}
  67. <button @click="showPackageDetail(item.id)" type="button"
  68. class="btn btn-sm btn-primary" data-toggle="modal"
  69. data-target="#staticBackdropShowPackageDetail">查看明细</button>
  70. </span>
  71. </td>
  72. <td class="td-warm text-muted">
  73. <span>
  74. @{{ item.commodityAmount }}
  75. <button @click="showCommodityDetail(item.id)" type="button"
  76. class="btn btn-sm btn-primary" data-toggle="modal"
  77. data-target="#staticBackdropShowCommodityDetail">查看明细</button>
  78. </span>
  79. </td>
  80. <td class="td-warm text-muted"><span>
  81. <button v-if="item.status == '创建'&&item.orderAmount>0&&item.commodityAmount>0"
  82. @click="stopStoreUp(item.id)" type="button"
  83. class="btn btn-success">停止攒单
  84. </button>
  85. </span></td>
  86. </tr>
  87. </table>
  88. <nav aria-label="...">
  89. <ul class="pagination">
  90. <li class="page-item" :class="current===1?'disabled':''">
  91. <button class="page-link" @click="pagination('pre')">上一页</button>
  92. </li>
  93. <li class="page-item" :class="current===details.pages?'disabled':''">
  94. <button class="page-link" @click="pagination('next')">下一页</button>
  95. </li>
  96. </ul>
  97. </nav>
  98. <!-- Modal -->
  99. <div class="modal fade" id="staticBackdropShowPackageDetail" tabindex="-1" aria-labelledby="staticBackdropLabel"
  100. aria-hidden="true">
  101. <div class="modal-dialog " style="max-width: 100% !important;">
  102. <div class="modal-content ">
  103. <div class="modal-header ">
  104. <h5 class="modal-title" id="staticBackdropLabel">明细</h5>
  105. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  106. <span aria-hidden="true">&times;</span>
  107. </button>
  108. </div>
  109. <div class="modal-body ">
  110. <!-- Scrollable modal -->
  111. <div class="modal-dialog modal-dialog-scrollable" style="max-width: 100% !important;">
  112. <table class="table table-sm"
  113. style="background: #fff;" id="tablePackage">
  114. <tr v-for="(item,i) in resData.packageDetail.data" :key="i">
  115. <td class="td-warm text-muted"><span>@{{ i+1 }}</span></td>
  116. <td class="td-warm text-muted"><span>@{{ item.rejectedPushTaskHeaderId }}</span>
  117. </td>
  118. <td class="td-warm text-muted"><span>@{{ item.createdAt }}</span></td>
  119. <td class="td-warm text-muted"><span>@{{ item.checkedNumbers }}</span></td>
  120. <td class="td-warm text-muted"><span>@{{ item.ownerName }}</span></td>
  121. <td class="td-warm text-muted"><span>@{{ item.orderNumber }}</span></td>
  122. <td class="td-warm text-muted"><span>@{{ item.sender }}</span></td>
  123. <td class="td-warm text-muted"><span>@{{ item.mobileSender }}</span></td>
  124. <td class="td-warm text-muted"><span>@{{ item.logisticNumber }}</span></td>
  125. <td class="td-warm text-muted"><span>@{{ item.logisticNumberReturn }}</span></td>
  126. <td class="td-warm text-muted"><span>@{{ item.logisticName }}</span></td>
  127. <td class="td-warm text-muted"><span>@{{ item.feeCollected }}</span></td>
  128. <td class="td-warm text-muted"><span>@{{ item.loadedStatus }}</span></td>
  129. <td class="td-warm text-muted"><span>@{{ item.barcodeGoods }}</span></td>
  130. <td class="td-warm text-muted"><span>@{{ item.nameGoods }}</span></td>
  131. <td class="td-warm text-muted"><span>@{{ item.amount }}</span></td>
  132. <td class="td-warm text-muted"><span>@{{ item.idQualityLabel }}</span></td>
  133. <td class="td-warm text-muted"><span>@{{ item.remark }}</span></td>
  134. <td class="td-warm text-muted"><span>@{{ item.orderRemark }}</span></td>
  135. </tr>
  136. </table>
  137. </div>
  138. <nav aria-label="...">
  139. <ul class="pagination">
  140. <li class="page-item" :class="resData.packageDetail.current===1?'disabled':''">
  141. <button class="page-link" @click="packagePagination('pre')">上一页</button>
  142. </li>
  143. <li class="page-item"
  144. :class="resData.packageDetail.current===resData.packageDetail.pages?'disabled':''">
  145. <button class="page-link" @click="packagePagination('next')">下一页</button>
  146. </li>
  147. </ul>
  148. </nav>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="modal fade" id="staticBackdropShowCommodityDetail" tabindex="-1"
  154. aria-labelledby="staticBackdropLabel"
  155. aria-hidden="true">
  156. <div class="modal-dialog " style="max-width: 70% !important;">
  157. <div class="modal-content ">
  158. <div class="modal-header ">
  159. <h5 class="modal-title" id="staticBackdropLabel">明细</h5>
  160. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  161. <span aria-hidden="true">&times;</span>
  162. </button>
  163. </div>
  164. <div class="modal-body ">
  165. <!-- Scrollable modal -->
  166. <div class="modal-dialog modal-dialog-scrollable">
  167. <table class="table table-sm"
  168. style="background: #fff;" id="tableCommodity">
  169. <tr v-for="(item,i) in resData.commodityDetail.data" :key="i">
  170. <td class="td-warm text-muted"><span>@{{ i+1 }}</span></td>
  171. <td class="td-warm text-muted"><span>@{{ item.rejectedPushTaskHeaderId }}</span>
  172. </td>
  173. <td class="td-warm text-muted"><span>@{{ item.sku }}</span></td>
  174. <td class="td-warm text-muted"><span>@{{ item.barcodeGoods }}</span></td>
  175. <td class="td-warm text-muted"><span>@{{ item.nameGoods }}</span></td>
  176. <td class="td-warm text-muted"><span>@{{ item.amount }}</span></td>
  177. <td class="td-warm text-muted"><span>@{{ item.idQualityLabel }}</span></td>
  178. </tr>
  179. </table>
  180. </div>
  181. <nav aria-label="...">
  182. <ul class="pagination">
  183. <li class="page-item" :class="resData.commodityDetail.current===1?'disabled':''">
  184. <button class="page-link" @click="commodityPagination('pre')">上一页</button>
  185. </li>
  186. <li class="page-item"
  187. :class="resData.commodityDetail.current===resData.commodityDetail.pages?'disabled':''">
  188. <button class="page-link" @click="commodityPagination('next')">下一页</button>
  189. </li>
  190. </ul>
  191. </nav>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. @endsection
  198. @section('lastScript')
  199. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
  200. <script>
  201. let vue = new Vue({
  202. el: "#list",
  203. data: {
  204. resData: {
  205. packageDetail: {
  206. data: [],
  207. total: null,
  208. current: 1,
  209. pages: null,
  210. size: 50,
  211. },
  212. commodityDetail: {
  213. data: [],
  214. total: null,
  215. current: 1,
  216. pages: null,
  217. size: 50,
  218. }
  219. },
  220. submitData: {
  221. type: null,
  222. warehouseId: null,
  223. allowMixed: null,
  224. volume: null,
  225. loadWeight: null,
  226. createAmount: null,
  227. },
  228. selectData: {
  229. owners: {!! $owners !!}
  230. },
  231. checkAll: false,
  232. selectTr: 0,
  233. details: {
  234. data: [],
  235. total: null,
  236. current: 1,
  237. pages: null,
  238. size: 50,
  239. },
  240. search: {
  241. ownerId: null,
  242. type: null,
  243. status: '创建',
  244. ownerIdList: {!! $ownerIds !!}
  245. },
  246. size: 50,
  247. current: 1,
  248. },
  249. created() {
  250. let url = this.getBaseUrl() + `/api/wms/rejectedPushTask/list?size=${this.size}&current=${this.current}`;
  251. this.getPageResult(url);
  252. },
  253. mounted: function () {
  254. $('#list').removeClass('d-none');
  255. $(".up").slideUp();
  256. let column = [
  257. {name: 'row_num', value: '序号'},
  258. {name: 'id', value: '推单任务编号'},
  259. {name: 'type', value: '任务类型'},
  260. {name: 'status', value: '状态'},
  261. {name: 'asnNos', value: 'ASN单号'},
  262. {name: 'ownerName', value: '货主'},
  263. {name: 'storeUpHour', value: '积攒时间'},
  264. {name: 'orderAmount', value: '订单数'},
  265. {name: 'commodityAmount', value: '商品数'},
  266. {name: 'action', value: '操作'},
  267. ];
  268. new Header({
  269. el: "table",
  270. name: "details",
  271. column: column,
  272. data: this.details.data,
  273. restorationColumn: 'addtime',
  274. isCheckAllBox: false,
  275. fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
  276. }).init();
  277. let columnPackage = [
  278. {name: 'rejectedPushTaskHeaderId', value: '推单任务号'},
  279. {name: 'createdAt', value: '日期'},
  280. {name: 'checkedNumbers', value: '审核号'},
  281. {name: 'ownerName', value: '客户名称'},
  282. {name: 'orderNumber', value: '订单号'},
  283. {name: 'sender', value: '姓名'},
  284. {name: 'mobileSender', value: '手机'},
  285. {name: 'logisticNumber', value: '原单单号'},
  286. {name: 'logisticNumberReturn', value: '退回单号'},
  287. {name: 'logisticName', value: '退回公司'},
  288. {name: 'feeCollected', value: '到付费用'},
  289. {name: 'loadedStatus', value: '是否入库'},
  290. {name: 'barcodeGoods', value: '商品条码'},
  291. {name: 'nameGoods', value: '商品名称'},
  292. {name: 'amount', value: '商品数量'},
  293. {name: 'idQualityLabel', value: '质量状态'},
  294. {name: 'remark', value: '备注'},
  295. {name: 'orderRemark', value: '退单备注'},
  296. ];
  297. new Header({
  298. el: "tablePackage",
  299. name: "details",
  300. column: columnPackage,
  301. data: this.resData.packageDetail.data,
  302. restorationColumn: 'addtime',
  303. isCheckAllBox: false,
  304. fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
  305. }).init();
  306. let columnCommodity = [
  307. {name: 'rejectedPushTaskHeaderId', value: '推单任务号'},
  308. {name: 'sku', value: 'SKU'},
  309. {name: 'barcodeGoods', value: '商品条码'},
  310. {name: 'nameGoods', value: '商品名称'},
  311. {name: 'amount', value: '商品数量'},
  312. {name: 'idQualityLabel', value: '质量状态'},
  313. ];
  314. new Header({
  315. el: "tableCommodity",
  316. name: "details",
  317. column: columnCommodity,
  318. data: this.resData.commodityDetail.data,
  319. restorationColumn: 'addtime',
  320. isCheckAllBox: false,
  321. fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
  322. }).init();
  323. },
  324. methods: {
  325. packagePagination(flag) {
  326. console.log(flag);
  327. if (flag === 'pre' && this.resData.packageDetail.current > 1) {
  328. this.resData.packageDetail.current--;
  329. } else if (flag === 'next' && this.resData.packageDetail.current < this.resData.packageDetail.pages) {
  330. this.resData.packageDetail.current++;
  331. }
  332. console.log(flag);
  333. this.showPackageDetail(this.resData.packageDetail.data[0].rejectedPushTaskHeaderId);
  334. },
  335. commodityPagination(flag) {
  336. console.log(flag);
  337. if (flag === 'pre' && this.resData.commodityDetail.current > 1) {
  338. this.resData.commodityDetail.current--;
  339. } else if (flag === 'next' && this.resData.commodityDetail.current < this.resData.commodityDetail.pages) {
  340. this.resData.commodityDetail.current++;
  341. }
  342. console.log(flag);
  343. this.showCommodityDetail(this.resData.commodityDetail.data[0].rejectedPushTaskHeaderId);
  344. },
  345. showCommodityDetail(id) {
  346. let url = this.getBaseUrl() + `/api/wms/rejectedPushTask/commodity/list?size=${this.resData.commodityDetail.size}&current=${this.resData.commodityDetail.current}&rejectedPushTaskId=${id}`
  347. tempTip.showSuccess('开始查询,请稍后!');
  348. axios.get(url).then(res => {
  349. tempTip.showSuccess('查询成功!');
  350. if (res.data.code !== 200) {
  351. tempTip.show('接口异常!');
  352. this.resData.commodityDetail.data = [];
  353. this.resData.commodityDetail.total = 0
  354. this.resData.commodityDetail.current = 1
  355. this.resData.commodityDetail.pages = 0
  356. this.resData.commodityDetail.size = 50;
  357. } else {
  358. this.resData.commodityDetail.data = res.data.data.list;
  359. this.resData.commodityDetail.total = res.data.data.page.total;
  360. this.resData.commodityDetail.current = res.data.data.page.pageNum;
  361. this.resData.commodityDetail.pages = res.data.data.page.pages
  362. this.resData.commodityDetail.size = res.data.data.page.pageSize;
  363. }
  364. });
  365. },
  366. showPackageDetail(id) {
  367. let url = this.getBaseUrl() + `/api/wms/rejectedPushTask/package/list?size=${this.resData.packageDetail.size}&current=${this.resData.packageDetail.current}&rejectedPushTaskId=${id}`
  368. tempTip.showSuccess('开始查询,请稍后!');
  369. axios.get(url).then(res => {
  370. tempTip.showSuccess('查询成功!');
  371. if (res.data.code !== 200) {
  372. tempTip.show('接口异常!');
  373. this.resData.packageDetail.data = [];
  374. this.resData.packageDetail.total = 0
  375. this.resData.packageDetail.current = 1
  376. this.resData.packageDetail.pages = 0
  377. this.resData.packageDetail.size = 50;
  378. } else {
  379. this.resData.packageDetail.data = res.data.data.list;
  380. this.resData.packageDetail.total = res.data.data.page.total;
  381. this.resData.packageDetail.current = res.data.data.page.pageNum;
  382. this.resData.packageDetail.pages = res.data.data.page.pages
  383. this.resData.packageDetail.size = res.data.data.page.pageSize;
  384. }
  385. });
  386. },
  387. checkAllBtn() {
  388. for (let item of this.details.data) {
  389. item.checked = this.checkAll;
  390. }
  391. },
  392. stopStoreUp(id = null) {
  393. let idList = null
  394. let url = this.getBaseUrl() + `/api/wms/rejectedPushTask/stopStoreUp/`;
  395. if (id == null) {
  396. let filter = this.details.data.filter(i => i.checked === true);
  397. if (filter.length === 0) {
  398. tempTip.show("选中的元素为空");
  399. return;
  400. }
  401. idList = filter.map(i => i.id);
  402. } else {
  403. idList = [id];
  404. }
  405. axios.post(url, {idList}).then(res => {
  406. if (res.data.code !== 200) {
  407. tempTip.show(res.data.message);
  408. } else {
  409. tempTip.showSuccess('批量修改状态成功!');
  410. this.searchData();
  411. }
  412. });
  413. },
  414. getPageResult(url) {
  415. tempTip.showSuccess('开始查询,请稍后!');
  416. axios.post(url, this.getSearch()).then(res => {
  417. tempTip.showSuccess('查询成功!');
  418. if (res.data.code !== 200) {
  419. tempTip.show('接口异常!');
  420. this.details.data = [];
  421. this.details.total = 0
  422. this.details.current = 1
  423. this.details.pages = 0
  424. this.details.size = 50;
  425. } else {
  426. this.details.data = res.data.data.list;
  427. this.details.total = res.data.data.page.total;
  428. this.details.current = res.data.data.page.pageNum;
  429. this.details.pages = res.data.data.page.pages
  430. this.details.size = res.data.data.page.pageSize;
  431. }
  432. });
  433. },
  434. getSearch() {
  435. return Object.assign({}, this.search);
  436. },
  437. searchData() {
  438. this.current = 1;
  439. this.pagination();
  440. },
  441. //根据环境获取不同的url
  442. getBaseUrl() {
  443. let url = null;
  444. let env = "{{ config('app.env') }}";
  445. if (env === 'local') {
  446. url = 'http://127.0.0.1:8118'
  447. } else if (env === 'production') {
  448. url = 'https://swms.baoshi56.com'
  449. }
  450. return url;
  451. },
  452. pagination(flag) {
  453. if (flag === 'pre' && this.current > 1) {
  454. this.current--;
  455. } else if (flag === 'next' && this.current < this.details.pages) {
  456. this.current++;
  457. }
  458. let url = this.getBaseUrl() + `/api/wms/rejectedPushTask/list?size=${this.size}&current=${this.current}`;
  459. this.getPageResult(url);
  460. },
  461. },
  462. });
  463. </script>
  464. @endsection