threeSectionFeeDetails.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <!-- 装船作业页面 -->
  3. <div class="shipTransport">
  4. <div class="top">
  5. <el-input
  6. class="el-input"
  7. placeholder="请输入内容"
  8. v-model="input"
  9. clearable
  10. >
  11. </el-input>
  12. <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期"></el-date-picker>
  13. <span>至</span>
  14. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期"></el-date-picker>
  15. <el-button type="primary" class="btn" @click="onclick">
  16. <i class="el-icon-search"></i>查询
  17. </el-button>
  18. <el-button type="primary" @click="refresh()">
  19. <i class="el-icon-refresh"></i>刷新
  20. </el-button>
  21. </div>
  22. <dilTable v-bind.sync="option">
  23. <el-table-column fixed="right" label="操作" align="center" width="100">
  24. <template slot-scope="scope">
  25. <el-button @click="click(scope.row.resultId)" type="text" size="small"
  26. >编辑</el-button
  27. >
  28. <!-- <el-button
  29. type="text"
  30. size="small"
  31. @click="deleteclick(scope.row.resultId)"
  32. >删除</el-button> -->
  33. </template>
  34. </el-table-column>
  35. </dilTable>
  36. </div>
  37. </template>
  38. <script>
  39. import { sjTime } from "@/utils/sharedJsFile";
  40. import { getCookie } from "@/utils/util.js";
  41. export default {
  42. name: "homeworkPath",
  43. data() {
  44. return {
  45. startTime: null,
  46. endTime: null,
  47. input: "",
  48. option: {
  49. // 表格请求数据的地址
  50. requestUrl: "/api/v1/tms/getLoadShipList?apiId=512",
  51. },
  52. };
  53. },
  54. mounted() {
  55. this.initDate();
  56. this.onclick();
  57. },
  58. methods: {
  59. initDate(){
  60. this.startTime=new Date();
  61. this.endTime=new Date();
  62. this.startTime.setDate(1);
  63. this.startTime.setHours(0);
  64. this.startTime.setMinutes(0);
  65. this.startTime.setSeconds(0);
  66. },
  67. onclick() {
  68. let startTime = null;
  69. let endTime = null;
  70. if (this.startTime) {
  71. startTime = sjTime(this.startTime);
  72. }
  73. if (this.endTime) {
  74. endTime = sjTime(this.endTime);
  75. }
  76. if(startTime && endTime && startTime < endTime){
  77. this.option.requestUrl = "/api/v1/tms/getLoadShipList?apiId=512&con=" + this.input+
  78. "&startTime=" +
  79. startTime +
  80. "&endTime=" +
  81. endTime;
  82. }else{
  83. this.option.requestUrl = "/api/v1/tms/getLoadShipList?apiId=512&con=" + this.input;
  84. }
  85. },
  86. click(resultId) {
  87. console.log("aaa" + resultId);
  88. this.$router.push("/updateThreeSectionFeeDetails/" + resultId);
  89. },
  90. addclick() {
  91. this.$router.push("/addLoadShip/");
  92. },
  93. deleteclick(scope) {
  94. let resultId = scope;
  95. this.$confirm("是否删除", "提示", {
  96. confirmButtonText: "确定",
  97. cancelButtonText: "取消",
  98. type: "warning",
  99. center: true,
  100. })
  101. .then(() => {
  102. this.axios.post("/api/v1/tms/deleteLoadShip/" + resultId).then(() => {
  103. this.$message({
  104. type: "success",
  105. message: "删除成功!",
  106. });
  107. this.option.requestUrl =
  108. "/api/v1/tms/getLoadShipList?apiId=512&i=" + new Date();
  109. });
  110. })
  111. .catch(() => {
  112. this.$message({
  113. type: "info",
  114. message: "取消删除!",
  115. });
  116. });
  117. },
  118. refresh() {
  119. this.$router.go(0);
  120. },
  121. },
  122. };
  123. </script>
  124. <style lang="scss" scoped>
  125. .shipTransport {
  126. .top {
  127. padding: 1.25rem 0.375rem;
  128. .el-input {
  129. width: 20%;
  130. margin-right: 40rpx;
  131. }
  132. .btn {
  133. width: 5.5%;
  134. margin-left: 0.25rem;
  135. }
  136. }
  137. }
  138. </style>