steel_outboundStatistics.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //出库统计炉号生产数量
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <span>出库时间:</span>
  6. <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
  7. </el-date-picker>
  8. <span>至</span>
  9. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  10. </el-date-picker>
  11. <el-input
  12. placeholder="请输入炉号"
  13. v-model="textInput"
  14. clearable>
  15. </el-input>
  16. <el-button type="primary" class="btn" @click="onclick">
  17. <i class="el-icon-search"></i>查询
  18. </el-button>
  19. <!-- <el-button type="primary" @click="refresh">
  20. <i class="el-icon-refresh"></i>刷新
  21. </el-button> -->
  22. <span style="margin-left: 1rem;">总件数:</span>
  23. <el-input v-model="totalNumber" :disabled="true" style="width: 150px;"></el-input>
  24. <span style="margin-left: 1rem;">总重量:</span>
  25. <el-input v-model="totalWeight" :disabled="true" style="width: 150px;"></el-input>
  26. </div>
  27. <div class="table">
  28. <dilTable v-bind.sync="option" @func="func">
  29. </dilTable>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import { sjTime } from "@/utils/sharedJsFile";
  35. export default {
  36. data(){
  37. return{
  38. textInput:"",
  39. startTime: null,
  40. endTime: null,
  41. totalNumber:0,
  42. totalWeight:0,
  43. option:{
  44. // first请求数据的地址
  45. requestUrl: "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+3+"&startTime=null&endTime=null&i=" +new Date()+"&con="+this.textInput,
  46. },
  47. }
  48. },
  49. methods:{
  50. refresh(){
  51. this.$router.go(0);
  52. },
  53. func(res){
  54. console.log(res)
  55. var total1 = 0
  56. var total2 = 0
  57. res.list.forEach(e => {
  58. total1 = total1+e.coun
  59. total2 = total2+e.theoreticalWeight
  60. });
  61. this.totalNumber = total1
  62. this.totalWeight = total2
  63. },
  64. onclick() {
  65. console.log("textInput",this.textInput);
  66. let startTime = null;
  67. let endTime = null;
  68. if(this.startTime){
  69. startTime = sjTime(this.startTime);
  70. }
  71. if(this.endTime){
  72. endTime = sjTime(this.endTime);
  73. }
  74. if(startTime && endTime){
  75. if(startTime < endTime){
  76. this.option.requestUrl = "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.textInput;
  77. }else{
  78. this.startTime = null;
  79. this.endTime = null;
  80. this.$message.warning('开始时间要比结束时间早')
  81. }
  82. }else{
  83. this.option.requestUrl = "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.textInput;
  84. }
  85. },
  86. selectionChange(selection) {
  87. this.options.mapList = selection;
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scode>
  93. .steel_inbound{
  94. .sache{
  95. height: 5rem;
  96. display: flex;
  97. align-items: center;
  98. padding-left: 1.875rem;
  99. .el-input {
  100. width: 20%;
  101. margin-right: 1.25rem;
  102. }
  103. }
  104. }
  105. </style>