shipmentInstructions.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <!-- 装船指令页面 -->
  3. <div class="homeworkPath">
  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. </dilTable>
  49. </div>
  50. </template>
  51. <script>
  52. export default {
  53. name: "homeworkPath",
  54. data() {
  55. return {
  56. restaurants: [],
  57. input: "",
  58. activeName:"first",
  59. option: {
  60. // 表格请求数据的地址
  61. requestUrl: "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=未下发",
  62. },
  63. option2: {
  64. // 表格请求数据的地址
  65. requestUrl: "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=已下发",
  66. },
  67. };
  68. },
  69. mounted() {},
  70. methods: {
  71. handleClick(tab, event) {
  72. console.log(tab, event);
  73. },
  74. onclick() {
  75. this.option.requestUrl =
  76. "/api/v1/tms/getShipMentInstructionsList?apiId=74&con=" + this.input;
  77. },
  78. btnclick() {
  79. this.$router.push("/addShipmentInstructions/");
  80. },
  81. selectclick(row) {
  82. this.$router.push("/instructionsCapacity/" + row.instructionsId);
  83. },
  84. click(instructionsId) {
  85. this.$router.push("/updateShipmentInstructions/" + instructionsId);
  86. },
  87. deleteclick(scope) {
  88. let instructionsId = scope;
  89. this.$confirm("是否删除", "提示", {
  90. confirmButtonText: "确定",
  91. cancelButtonText: "取消",
  92. type: "warning",
  93. center: true,
  94. })
  95. .then(() => {
  96. this.axios
  97. .post("/api/v1/tms/deleteByPrimaryKey/" + instructionsId)
  98. .then(() => {
  99. this.$message({
  100. type: "success",
  101. message: "删除成功!",
  102. });
  103. this.$router.go(0);
  104. });
  105. })
  106. .catch(() => {
  107. this.$message({
  108. type: "info",
  109. message: "取消删除!",
  110. });
  111. });
  112. },
  113. issueclick(scope) {
  114. let instructionsId = scope;
  115. this.$confirm("是否下发", "提示", {
  116. confirmButtonText: "确定",
  117. cancelButtonText: "取消",
  118. type: "warning",
  119. center: true,
  120. })
  121. .then(() => {
  122. this.$message({
  123. type: "success",
  124. message: "下发成功!",
  125. });
  126. this.axios
  127. .post("/api/v1/tms/sendShipmentInstructionsStatus/" + instructionsId)
  128. .then(() => {
  129. this.$router.go(0);
  130. });
  131. })
  132. .catch(() => {
  133. this.$message({
  134. type: "info",
  135. message: "取消下发!",
  136. });
  137. });
  138. },
  139. },
  140. };
  141. </script>
  142. <style lang='scss' scoped>
  143. .homeworkPath {
  144. .top {
  145. padding: 1.25rem 0.375rem;
  146. .el-input{
  147. width: 20%;
  148. margin-right: 40rpx;
  149. }
  150. .btn{
  151. width: 5.5%;
  152. margin-left: 0.25rem;
  153. }
  154. }
  155. }
  156. </style>