unloadShip.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. -->
  16. <el-button type="primary" class="btn" @click="onclick">
  17. <i class="el-icon-search"></i>查询
  18. </el-button>
  19. <el-button type="primary" class="btn" @click="addclick">
  20. <i class="el-icon-circle-plus-outline"></i>新增
  21. </el-button>
  22. <el-button type="primary" @click="refresh()">
  23. <i class="el-icon-refresh"></i>刷新
  24. </el-button>
  25. </div>
  26. <dilTable v-bind.sync="option">
  27. <el-table-column fixed="right" label="操作" align="center" width="100">
  28. <template slot-scope="scope">
  29. <el-button @click="click(scope.row.resultId)" type="text" size="small"
  30. >编辑</el-button
  31. >
  32. <!-- <el-button
  33. type="text"
  34. size="small"
  35. @click="deleteclick(scope.row.resultId)"
  36. >删除</el-button
  37. > -->
  38. </template>
  39. </el-table-column>
  40. </dilTable>
  41. </div>
  42. </template>
  43. <script>
  44. import { sjTime } from "@/utils/sharedJsFile";
  45. import { getCookie } from "@/utils/util.js";
  46. export default {
  47. name: "homeworkPath",
  48. data() {
  49. return {
  50. restaurants: [],
  51. input: "",
  52. startTime: null,
  53. endTime: null,
  54. option: {
  55. // 表格请求数据的地址
  56. requestUrl: "/api/v1/tms/getUnLoadShipList?apiId=68"
  57. }
  58. };
  59. },
  60. mounted() {},
  61. methods: {
  62. onclick() {
  63. let startTime = null;
  64. let endTime = null;
  65. if (this.startTime) {
  66. startTime = sjTime(this.startTime);
  67. }
  68. if (this.endTime) {
  69. endTime = sjTime(this.endTime);
  70. }
  71. if(startTime && endTime && startTime < endTime){
  72. this.option.requestUrl =
  73. "/api/v1/tms/getUnLoadShipList?apiId=68&con=" + this.input+
  74. "&startTime=" +
  75. startTime +
  76. "&endTime=" +
  77. endTime;
  78. }else{
  79. this.option.requestUrl =
  80. "/api/v1/tms/getUnLoadShipList?apiId=68&con=" + this.input;
  81. }
  82. },
  83. click(resultId) {
  84. this.$router.push("/updateUnloadShip/" + resultId);
  85. },
  86. addclick() {
  87. this.$router.push("/addUnloadShip/");
  88. },
  89. deleteclick(scope) {
  90. let resultId = scope;
  91. this.$confirm("是否删除", "提示", {
  92. confirmButtonText: "确定",
  93. cancelButtonText: "取消",
  94. type: "warning",
  95. center: true
  96. })
  97. .then(() => {
  98. this.axios
  99. .post(
  100. "/api/v1/shipTms/tmsshipunloadshipresults/deleteUnLoadShip/" +
  101. resultId
  102. )
  103. .then(() => {
  104. this.$message({
  105. type: "success",
  106. message: "删除成功!"
  107. });
  108. this.$router.go(0);
  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>