index.blade.php 11 KB

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