procurementBill.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. @extends('layouts.app')
  2. @section('title')采购管理-财务-采购账单@endsection
  3. @section('content')
  4. @component('procurement.finance.menu')@endcomponent
  5. <div class="container-fluid" id="list">
  6. <div id="form_div" class="mt-1"></div>
  7. <div class="row mt-2">
  8. <span class="dropdown ml-3">
  9. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
  10. :class="[checkData.length>0?'btn-dark text-light':'']"
  11. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
  12. 导出Excel
  13. </button>
  14. <div class="dropdown-menu">
  15. <a class="dropdown-item" @click="{{--procurementExport(false)--}}" href="javascript:">导出勾选内容</a>
  16. <a class="dropdown-item" @click="{{--procurementExport(true)--}}" href="javascript:">导出所有页</a>
  17. </div>
  18. </span>
  19. </div>
  20. <label for="all" id="cloneCheckAll" class="d-none">
  21. <input id="all" type="checkbox" @click="checkAll($event)">全选
  22. </label>
  23. <table class="table table-sm table-bordered text-nowrap d-none" id="headerRoll"></table>
  24. <table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2"
  25. id="headerParent">
  26. <tr id="header"></tr>
  27. <tr v-for="(procurement,i) in procurements">
  28. <td>
  29. <input class="checkItem" type="checkbox" :value="procurement" v-model="checkData">
  30. </td>
  31. <td class="">@{{ procurement.code }}</td>
  32. <td class="">@{{ procurement.created_at }}</td>
  33. <td class=""></td>
  34. <td class=""></td>
  35. <td class="">@{{ procurement.owner_name }}</td>
  36. <td class="">@{{ procurement.company_name }}</td>
  37. <td class="">@{{ procurement.supplier_name }}</td>
  38. <td class="tooltipTarget" style="max-width: 200px;overflow:hidden">@{{ procurement.material_code }}</td>
  39. <td class="text-muted">@{{ procurement.material_name }}</td>
  40. <td class="text-muted">@{{ procurement.size }}</td>
  41. <td class="text-muted">@{{ procurement.special }}</td>
  42. <td class="text-muted">@{{ procurement.specification }}</td>
  43. <td>@{{ procurement.quantity }}</td>
  44. <td>@{{ procurement.amount }}</td>
  45. <td></td>
  46. <td>@{{ procurement.cost_price }}</td>
  47. <td>@{{ procurement.unit_price }}</td>
  48. <td></td>
  49. <td></td>
  50. <td><span>@{{ procurement.status }}</span></td>
  51. <td>
  52. <span class="btn btn-sm btn-outline-danger">锁定</span>
  53. <span class="btn btn-sm btn-outline-success">修改采购单价</span>
  54. </td>
  55. </tr>
  56. </table>
  57. <div class="text-info h5 btn btn">{{$procurements->count()}}/@{{ sum }}</div>
  58. <div>{{$procurements->appends($paginateParams)->links()}}</div>
  59. </div>
  60. @endsection
  61. @section('lastScript')
  62. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  63. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  64. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
  65. <script>
  66. let vue = new Vue({
  67. el: '#list',
  68. data: {
  69. procurements: [
  70. @foreach($procurements as $procurement)
  71. {
  72. id:'{{$procurement->id}}',code:'{{$procurement->code}}',type:'{{$procurement->type}}',created_at:'{{$procurement->created_at}}',
  73. quantity:'{{$procurement->quantity}}',unit_price:'{{$procurement->unit_price}}',status:'{{$procurement->status}}',cost_price:'{{$procurement->cost_price}}',
  74. @if($procurement->ownerMaterial)
  75. owner_id:'{{$procurement->ownerMaterial->owner_id}}',size:'{{$procurement->ownerMaterial->size}}',
  76. special:'{{$procurement->ownerMaterial->special}}',specification:'{{$procurement->ownerMaterial->specification}}',@endif
  77. @if($procurement->ownerMaterial->material)
  78. material_id:'{{$procurement->ownerMaterial->material->id}}',material_code:'{{$procurement->ownerMaterial->material->code}}',
  79. material_name:'{{$procurement->ownerMaterial->material->name}}',@endif
  80. @if($procurement->ownerMaterial->owner)owner_name:'{{$procurement->ownerMaterial->owner->name}}',@endif
  81. @if($procurement->supplier)supplier_name:'{{$procurement->supplier->name}}',@endif
  82. @if($procurement->ownerMaterial->owner->customer)
  83. company_name:'{{$procurement->ownerMaterial->owner->customer->company_name}}',customer_id:'{{$procurement->ownerMaterial->owner->customer->id}}',
  84. phone:'{{$procurement->ownerMaterial->owner->customer->phone}}',@endif
  85. },
  86. @endforeach
  87. ],
  88. owners:[
  89. @foreach($owners as $owner)
  90. {name:'{{$owner->id}}',value:'{{$owner->name}}'},
  91. @endforeach
  92. ],
  93. materials: [
  94. @foreach($materials as $material)
  95. {name:'{{$material->id}}',value:'{{$material->name}}'},
  96. @endforeach
  97. ],
  98. suppliers:[
  99. @foreach($suppliers as $supplier)
  100. {name:'{{$supplier->id}}',value:'{{$supplier->name}}'},
  101. @endforeach
  102. ],
  103. checkData: [],
  104. sum:{!! $procurements->total() !!},
  105. },
  106. mounted: function () {
  107. $(".tooltipTarget").tooltip({'trigger': 'hover'});
  108. $('#list').removeClass('d-none');
  109. let data = [
  110. [
  111. {name: 'created_at_start', type: 'dateTime', tip: '选择显示指定日期的起始时间'},
  112. {name: 'created_at_end', type: 'dateTime', tip: '选择显示指定日期的结束时间'},
  113. {
  114. name: 'owner_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的项目'],
  115. placeholder: ['项目', '定位或多选项目'], data: this.owners
  116. },
  117. {
  118. name: 'material_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的耗材'],
  119. placeholder: ['耗材', '定位或多选耗材'], data: this.materials
  120. },
  121. {
  122. name: 'supplier_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的耗材'],
  123. placeholder: ['供应商', '定位或多选供应商'], data: this.suppliers
  124. },
  125. {name: 'company_name', type: 'input', tip: '采购公司:可在两侧增加百分号(%)进行模糊搜索', placeholder: '采购公司'},
  126. ],
  127. ];
  128. this.form = new query({
  129. el: "#form_div",
  130. condition: data,
  131. });
  132. this.form.init();
  133. let column = [
  134. {
  135. name: 'cloneCheckAll', customization: true, type: 'checkAll',
  136. dom: $('#cloneCheckAll').removeClass('d-none'), neglect: true
  137. },
  138. {name: 'code', value: '采购编号', neglect: true},
  139. {name: 'code', value: '采购日期', neglect: true},
  140. {name: 'code', value: '接单日期', neglect: true},
  141. {name: 'code', value: '签收日期', neglect: true},
  142. {name: 'owner_id', value: '项目名称', class: ''},
  143. {name: 'company_name', value: '采购公司', class: ''},
  144. {name: 'supplier_name', value: '供应商',},
  145. {name: 'material_code', value: '耗材编号', class: 'text-muted'},
  146. {name: 'material_name', value: '耗材'},
  147. {name: 'size', value: '尺寸大小', class: 'text-muted'},
  148. {name: 'special', value: '特殊要求', class: 'text-muted'},
  149. {name: 'specification', value: '材质规格', class: 'text-muted'},
  150. {name: 'quantity', value: '采购数量', neglect: true},
  151. {name: '', value: '销售数量', neglect: true},
  152. {name: '', value: '收货数量', neglect: true},
  153. {name: '', value: '采购单价(元)', neglect: true},
  154. {name: 'unit_price', value: '销售单价(元)', neglect: true},
  155. {name: '', value: '应收金额(元)', neglect: true},
  156. {name: '', value: '应付金额(元)', neglect: true},
  157. {name: '', value: '状态', neglect: true},
  158. {name: '', value: '操作', neglect: true},
  159. ];
  160. let _this = this;
  161. setTimeout(function () {
  162. let header = new Header({
  163. el: "#header",
  164. column: column,
  165. data: _this.procurements,
  166. restorationColumn: 'id',
  167. fixedTop: ($('#form_div').height()) + 2,
  168. offset: 0.5,
  169. vue: vue
  170. });
  171. header.init();
  172. }, 0);
  173. },
  174. methods: {
  175. //全选事件
  176. checkAll(e) {
  177. if (e.target.checked) {
  178. this.procurements.forEach((el, i) => {
  179. if (this.checkData.indexOf(el) == '-1') {
  180. this.checkData.push(el);
  181. }
  182. });
  183. } else {
  184. this.checkData = [];
  185. }
  186. },
  187. }
  188. });
  189. </script>
  190. @endsection