steel_close.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //结转
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <span class="demonstration">月</span>
  6. <el-date-picker
  7. v-model="value"
  8. type="month"
  9. placeholder="选择月">
  10. </el-date-picker>
  11. <el-button type="primary" class="btn" @click="onclick">
  12. <i class="el-icon-search"></i>查询
  13. </el-button>
  14. <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
  15. <span style="margin-left: 1rem;">合计本月总库存:</span>
  16. <el-input v-model="totalNumber" :disabled="true" style="width: 150px;"></el-input>
  17. </div>
  18. <div class="table">
  19. <dilTable ref="excelDom" v-bind.sync="option" @func="func">
  20. </dilTable>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import { sjTime } from '@/utils/sharedJsFile'
  26. export default {
  27. data(){
  28. return{
  29. value : null,
  30. totalNumber: 0,
  31. option:{
  32. // first请求数据的地址
  33. requestUrl: "/api/v1/wms/getInventoryClose?apiId=95&value="+ (sjTime(new Date() + "")),
  34. },
  35. }
  36. },
  37. methods:{
  38. func(res){
  39. console.log(res)
  40. var total = 0
  41. res.list.forEach(e => {
  42. total = total+e.close_thismonth_inventory
  43. });
  44. this.totalNumber = total
  45. },
  46. onclick(){
  47. console.log("value",this.value)
  48. var value = null;
  49. if(this.value){
  50. value = sjTime(this.value)
  51. }
  52. this.option.requestUrl = "/api/v1/wms/getInventoryClose?apiId=95&value="+value;
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scode>
  58. .steel_inbound {
  59. .sache {
  60. width: 100%;
  61. height: 100px;
  62. display: flex;
  63. align-items: center;
  64. padding-left: 50px;
  65. .el-date-editor{
  66. margin: 20px;
  67. }
  68. }
  69. }
  70. </style>