shipmentInstructions.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <!-- 装船指令页面 -->
  3. <div class="shipTransport">
  4. <div class="top">
  5. <el-input class="el-input" placeholder="请输入内容" v-model="input" clearable> </el-input> 
  6. <el-button type="primary" class="btn" @click="onclick">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button class="btn" type="primary" @click="btnclick(0)">
  10. <i class="el-icon-circle-plus-outline"></i>新增 </el-button>
  11. </div>
  12. <el-tabs v-model="activeName" @tab-click="handleClick">
  13. <!-- 未下发 -->
  14. <el-tab-pane label="未下发" name="first">
  15. <dilTable v-bind.sync="option" ref="table">
  16. <el-table-column fixed="right" label="操作" align="center" width="180">
  17. <template slot-scope="scope">
  18. <el-button @click="selectclick(scope.row)" type="text" size="small"
  19. >加船</el-button
  20. >
  21. <el-button
  22. @click="issueclick(scope.row.instructionsId)"
  23. type="text"
  24. size="small"
  25. >下发</el-button
  26. >
  27. <el-button
  28. @click="click(scope.row.instructionsId)"
  29. type="text"
  30. size="small"
  31. >编辑</el-button
  32. >
  33. <el-button
  34. type="text"
  35. size="small"
  36. @click="deleteclick(scope.row.instructionsId)"
  37. >删除</el-button
  38. >
  39. </template>
  40. </el-table-column>
  41. </dilTable>
  42. </el-tab-pane>
  43. <!-- 已下发 -->
  44. <el-tab-pane label="已下发" name="second">
  45. <dilTable v-bind.sync="option2"></dilTable>
  46. </el-tab-pane>
  47. </el-tabs>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. name: "homeworkPath",
  53. data() {
  54. return {
  55. restaurants: [],
  56. input: "",
  57. activeName:"first",
  58. option: {
  59. // 表格请求数据的地址
  60. requestUrl: "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=未下发",
  61. },
  62. option2: {
  63. // 表格请求数据的地址
  64. requestUrl: "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=已下发",
  65. },
  66. };
  67. },
  68. mounted() {},
  69. methods: {
  70. handleClick(tab, event) {
  71. console.log(tab, event);
  72. },
  73. onclick() {
  74. this.option.requestUrl =
  75. "/api/v1/tms/getShipMentInstructionsList?apiId=74&con=" + this.input;
  76. },
  77. btnclick() {
  78. this.$router.push("/addShipmentInstructions/");
  79. },
  80. selectclick(row) {
  81. this.$router.push("/instructionsCapacity/" + row.instructionsId);
  82. },
  83. click(instructionsId) {
  84. this.$router.push("/updateShipmentInstructions/" + instructionsId);
  85. },
  86. deleteclick(scope) {
  87. let instructionsId = scope;
  88. this.$confirm("是否删除", "提示", {
  89. confirmButtonText: "确定",
  90. cancelButtonText: "取消",
  91. type: "warning",
  92. center: true,
  93. })
  94. .then(() => {
  95. this.axios
  96. .post("/api/v1/tms/deleteByPrimaryKey/" + instructionsId)
  97. .then(() => {
  98. this.$message({
  99. type: "success",
  100. message: "删除成功!",
  101. });
  102. this.$router.go(0);
  103. });
  104. })
  105. .catch(() => {
  106. this.$message({
  107. type: "info",
  108. message: "取消删除!",
  109. });
  110. });
  111. },
  112. issueclick(scope) {
  113. let instructionsId = scope;
  114. this.$confirm("是否下发", "提示", {
  115. confirmButtonText: "确定",
  116. cancelButtonText: "取消",
  117. type: "warning",
  118. center: true,
  119. })
  120. .then(() => {
  121. this.$message({
  122. type: "success",
  123. message: "下发成功!",
  124. });
  125. this.axios
  126. .post("/api/v1/tms/sendShipmentInstructionsStatus/" + instructionsId)
  127. .then(() => {
  128. this.$router.go(0);
  129. });
  130. })
  131. .catch(() => {
  132. this.$message({
  133. type: "info",
  134. message: "取消下发!",
  135. });
  136. });
  137. },
  138. },
  139. };
  140. </script>
  141. <style lang='scss' scoped>
  142. .shipTransport {
  143. .top {
  144. padding: 1.25rem 0.375rem;
  145. .el-input{
  146. width: 20%;
  147. margin-right: 40rpx;
  148. }
  149. .btn{
  150. width: 5.5%;
  151. margin-left: 0.25rem;
  152. }
  153. }
  154. }
  155. </style>