shipmentInstructions.vue 4.9 KB

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