index.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. @extends('layouts.app')
  2. @section('title')入库管理@endsection
  3. @section('content')
  4. <div class="d-none container-fluid" id="list">
  5. <div id="form_div"></div>
  6. <div class="ml-2">
  7. <button class="btn btn-sm btn-primary" @click="syncStorage()">同步FLUX部分库存</button>
  8. <button class="btn btn-sm btn-outline-info" @click="settingAsnRule()">设定ASN收货规则</button>
  9. </div>
  10. <table class="table table-striped table-sm text-nowrap table-hover td-min-width-80" id="table">
  11. <tr v-for="(store,i) in stores" :id="'data-'+store.id" @click="selectTableRow(i,$event)">
  12. <td>
  13. <input class="checkItem" type="checkbox" :value="store.id">
  14. </td>
  15. <td>
  16. <button class="btn btn-sm btn-outline-info" v-if="!store.isOpenStoreItem" @click="openStoreItems(store,i,$event);store.isOpenStoreItem=true">查看明细</button>
  17. <button v-if="store.isOpenStoreItem" @click="closeStoreItems();store.isOpenStoreItem=false" class="btn btn-sm btn-dark">收起明细</button>
  18. </td>
  19. <td><span>@{{ i+1 }}</span></td>
  20. <td><span>@{{store.asn_code}}</span></td>
  21. <td class="text-muted"><span>@{{store.warehouse.name}}</span></td>
  22. <td><span>@{{store.owner.name}}</span></td>
  23. <td><span>@{{store.stored_method}}</span></td>
  24. <td><span>@{{store.status}}</span></td>
  25. <td><span>@{{store.remark}}</span></td>
  26. <td class="text-muted"><span>@{{store.created_at}}</span></td>
  27. </tr>
  28. <tr id="showStoreItem" v-show="store.store_items">
  29. <td colspan="2"></td>
  30. <td colspan="16">
  31. <table class="table-sm table-bordered table-condensed">
  32. <tr>
  33. <th>行号</th>
  34. <th>商品名称</th>
  35. <th>商品编码</th>
  36. <th>商品条码</th>
  37. <th>数量</th>
  38. <th>质量</th>
  39. <th>状态</th>
  40. <th>创建时间</th>
  41. </tr>
  42. <tr v-for="storeItem in store.store_items">
  43. <td>@{{ storeItem.asn_line_code }}</td>
  44. <td>@{{ storeItem.name }}</td>
  45. <td>@{{ storeItem.sku }}</td>
  46. <td>@{{ storeItem.barcode }}</td>
  47. <td>@{{ storeItem.amount }}</td>
  48. <td>@{{ storeItem.quality }}</td>
  49. <td>@{{ storeItem.status }}</td>
  50. <td class="text-muted">@{{ storeItem.created_at }}</td>
  51. </tr>
  52. </table>
  53. </td>
  54. </tr>
  55. </table>
  56. @include("store.inStorage._settingAsnRule")
  57. <div class="text-info h5 btn btn">{{$stores->count()}}/{{$stores->total()}}</div>
  58. <div>{{$stores->appends($paginateParams)->links()}}</div>
  59. </div>
  60. @endsection
  61. @section('lastScript')
  62. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  63. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
  64. <script>
  65. let vue = new Vue({
  66. el:'#list',
  67. data:{
  68. stores:[
  69. @foreach($stores as $store)
  70. {!! $store !!},
  71. @endforeach
  72. ],
  73. owners:[
  74. @foreach($owners as $owner)
  75. {name:'{{$owner->id}}',value:'{{$owner->name}}',is_show:Boolean({!! $owner->is_check_asn !!})},
  76. @endforeach
  77. ],
  78. warehouses:[
  79. @foreach($warehouses as $warehouse)
  80. {name:'{{$warehouse->id}}',value:'{{$warehouse->name}}'},
  81. @endforeach
  82. ],
  83. store:{},
  84. selectTr:''
  85. },
  86. mounted:function(){
  87. $(".tooltipTarget").tooltip({'trigger':'hover'});
  88. $('#list').removeClass('d-none');
  89. let _this = this;
  90. let data=[
  91. [
  92. {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
  93. {name:'owner',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的货主'],
  94. placeholder:['货主','定位或多选货主'],data:this.owners},
  95. {name:'warehouse',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的仓库'],
  96. placeholder:['仓库','定位或多选仓库'],data:this.warehouses},
  97. {name:'remark',type:'input',tip:'备注:可在两侧增加百分号(%)进行模糊搜索',placeholder: '备注'},
  98. ],
  99. [
  100. {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
  101. {name:'asn_code',type:'input',tip:'可支持多asn编号:支持15天内模糊搜索,15天外精确搜索,模糊搜索可在两侧增加百分号(%)进行',placeholder: 'ASN单号'},
  102. {name:'status',type:'select',placeholder: '订单状态',data:[{name:'完全收货',value:'完全收货'},{name:'部分收货',value:'部分收货'},
  103. {name:'已码盘',value:'已码盘'},{name:'订单创建',value:'订单创建'},{name:'ASN关闭',value:'ASN关闭'},{name:'等待释放',value:'等待释放'},{name:'收货取消',value:'收货取消'}]},
  104. {name:'stored_method',type:'select',placeholder: '入库类型',data:[{name:'采购入库',value:'采购入库'},{name:'笕尚退货入库单',value:'笕尚退货入库单'},
  105. {name:'笕尚进仓入库单',value:'笕尚进仓入库单'},{name:'笕尚移仓入库单',value:'笕尚移仓入库单'},{name:'笕尚调整入库单',value:'笕尚调整入库单'},
  106. {name:'B2B入库',value:'B2B入库'},{name:'换货入库',value:'换货入库'}, {name:'初始化库存',value:'初始化库存'},{name:'调拨入库',value:'调拨入库'},
  107. {name:'虚拟入库',value:'虚拟入库'}, {name:'退货入库',value:'退货入库'}, {name:'其他入库',value:'其他入库'},
  108. ]},
  109. ],
  110. ];
  111. this.form = new query({
  112. el:"#form_div",
  113. condition:data,
  114. });
  115. this.form.init();
  116. let column = [
  117. {name:'',value: '操作', neglect: true},
  118. {name:'index',value: '序号', neglect: true},
  119. {name:'asn_code',value: 'ASN编号'},
  120. {name:'warehouse_name',value: '仓库'},
  121. {name:'owner_name',value: '货主'},
  122. {name:'stored_method',value: '入库类型'},
  123. {name:'status',value: '状态'},
  124. {name:'remark',value: '备注'},
  125. {name:'created_at',value: '生成时间'},
  126. ];
  127. new Header({
  128. el: "table",
  129. name: "storeInStorage",
  130. column: column,
  131. data: this.stores,
  132. }).init();
  133. },
  134. methods:{
  135. selectTableRow(id,e){
  136. $('#headerParent tr[class=focusing]').removeClass('focusing')
  137. if (id === this.selectTr) {
  138. this.selectTr = '';
  139. return;
  140. }
  141. this.selectTr = id;
  142. $(e.target).parent('tr').addClass('focusing')
  143. },
  144. openStoreItems(store,i,e){
  145. let _this=this;
  146. let id=store.id;
  147. _this.store=store;
  148. let showStoreItem=$('#showStoreItem');
  149. $("#data-" + id).after(showStoreItem);
  150. },
  151. closeStoreItems(){
  152. let _this=this;
  153. _this.store={};
  154. },
  155. syncStorage(){
  156. window.tempTip.confirm("确定要刷新WAS全部库存吗?",()=>{
  157. window.tempTip.setDuration(999999);
  158. window.tempTip.waitingTip("同步量过大,请稍等(勿关闭此页面)");
  159. window.tempTip.postBasicRequest("{{url('store/inStorage/syncStorage')}}",{},()=>{
  160. window.tempTip.cancelWaitingTip();
  161. window.tempTip.setDuration(2000);
  162. return "同步完毕";
  163. })
  164. })
  165. },
  166. settingAsnRule(){
  167. $("#modal").modal("show");
  168. },
  169. selectAll(show){
  170. let val = event.target.checked;
  171. this.owners.forEach((owner,index)=>{
  172. if (owner.is_show===show)this.$set(this.owners[index],"is_check_asn",val);
  173. })
  174. },
  175. changeAsnRule(show){
  176. let pool = [];
  177. this.owners.forEach((owner,index)=>{
  178. if (owner.is_show===show && owner.is_check_asn){
  179. owner.is_show = !owner.is_show;
  180. owner.is_check_asn = !owner.is_check_asn;
  181. this.$set(this.owners,index,owner);
  182. pool.push(owner.name);
  183. }
  184. });
  185. window.tempTip.postBasicRequest("{{url('store/inStorage/changeAsnRule')}}",{ids:pool,val:show},()=>{});
  186. }
  187. }
  188. });
  189. </script>
  190. @endsection