truckJiPiFuResult.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <!-- 辅料计皮实绩页面 -->
  3. <div class="homeworkPath">
  4. <div class="top">
  5. <el-input
  6. placeholder="请输入内容"
  7. class="input"
  8. v-model="input"
  9. clearable
  10. >
  11. </el-input>
  12. <span class="text">计皮时间:</span>
  13. <el-date-picker
  14. v-model="startTime"
  15. type="datetime"
  16. placeholder="选择日期"
  17. >
  18. </el-date-picker>
  19. <span class="text">至</span>
  20. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  21. </el-date-picker>
  22. <el-button type="primary" class="btn" @click="onclick">
  23. <i class="el-icon-search"></i>查询
  24. </el-button>
  25. </div>
  26. <dilTable v-bind.sync="option"> </dilTable>
  27. </div>
  28. </template>
  29. <script>
  30. import { sjTime } from "@/utils/sharedJsFile";
  31. export default {
  32. name: "homeworkPath",
  33. data() {
  34. return {
  35. startTime:null,
  36. endTime:null,
  37. restaurants: [],
  38. input: "",
  39. option: {
  40. // 表格请求数据的地址
  41. requestUrl: "/api/v1/tms/getAllJiPiResult?apiId=146&orderType=5",
  42. },
  43. };
  44. },
  45. methods: {
  46. onclick() {
  47. let startTime = null;
  48. let endTime = null;
  49. if (this.startTime) {
  50. startTime = sjTime(this.startTime);
  51. // console.log("startTime", startTime);
  52. }
  53. if (this.endTime) {
  54. endTime = sjTime(this.endTime);
  55. // console.log("endTime", endTime);
  56. }
  57. if (startTime && endTime) {
  58. if (startTime < endTime) {
  59. this.option.requestUrl =
  60. "/api/v1/tms/getAllJiPiResult?apiId=146&orderType=5&con=" +
  61. this.input +
  62. "&startTime=" +
  63. startTime +
  64. "&endTime=" +
  65. endTime +
  66. "&i=" +
  67. new Date();
  68. }
  69. } else {
  70. this.option.requestUrl =
  71. "/api/v1/tms/getAllJiPiResult?apiId=146&orderType=5&con=" +
  72. this.input +
  73. "&i=" +
  74. new Date();
  75. }
  76. },
  77. },
  78. };
  79. </script>
  80. <style lang='scss'>
  81. .homeworkPath {
  82. .top {
  83. padding: 40px;
  84. .input {
  85. width: 250px;
  86. margin-right: 10px;
  87. }
  88. }
  89. }
  90. </style>