plan.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. // 分解计划
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <el-input placeholder="请输入内容" v-model="inputText" clearable>
  6. </el-input>
  7. <el-button type="primary" class="btn">
  8. <i class="el-icon-search"></i>查询
  9. </el-button>
  10. </div>
  11. <template>
  12. <div>
  13. <el-tabs v-model="activeName" @tab-click="handleClick">
  14. <el-tab-pane label="未接收" name="first">
  15. <dilTable v-bind.sync="first">
  16. <el-table-column fixed="right" label="操作" width="50">
  17. <template slot-scope="scope">
  18. <el-button type="text" size="mini" @click="receiver(scope)">
  19. 接收
  20. </el-button>
  21. </template>
  22. </el-table-column>
  23. </dilTable>
  24. </el-tab-pane>
  25. <el-tab-pane label="已接收" name="second">
  26. <dilTable v-bind.sync="second">
  27. <el-table-column fixed="right" label="操作" width="50">
  28. <template slot-scope="scope">
  29. <el-button
  30. type="text"
  31. size="mini"
  32. @click="desponsePlan(scope)"
  33. >
  34. 分解
  35. </el-button>
  36. </template>
  37. </el-table-column>
  38. </dilTable>
  39. </el-tab-pane>
  40. <el-tab-pane label="已分解" name="third">
  41. <dilTable v-bind.sync="third">
  42. <el-button
  43. type="text"
  44. size="mini"
  45. @click="getdesponsePlan(scope)"
  46. >
  47. 查看
  48. </el-button>
  49. </dilTable>
  50. </el-tab-pane>
  51. </el-tabs>
  52. </div>
  53. </template>
  54. </div>
  55. </template>
  56. <script>
  57. import { getCookie } from "@/utils/util.js";
  58. export default {
  59. data() {
  60. return {
  61. inputText: "",
  62. carrierId:40,
  63. first: {
  64. // first请求数据的地址
  65. requestUrl:
  66. "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&carrierId=" + ''
  67. },
  68. second: {
  69. // second请求数据的地址
  70. requestUrl:
  71. "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" + ''
  72. },
  73. third: {
  74. // second请求数据的地址
  75. requestUrl:
  76. "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" + ''
  77. },
  78. activeName: "first",
  79. };
  80. },
  81. created(){
  82. this.carrierId = getCookie('userId')
  83. this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1"
  84. this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2"
  85. this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3"
  86. console.log(this.carrierId)
  87. },
  88. methods: {
  89. getRequestUrl(){
  90. this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&i=" + new Date()
  91. this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&i=" + new Date()
  92. this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&i=" + new Date()
  93. },
  94. receiver(scope) {
  95. this.$confirm("是否接收", "提示", {
  96. confirmButtonText: "确定",
  97. cancelButtonText: "取消",
  98. type: "warning",
  99. center: true,
  100. })
  101. .then(() => {
  102. this.axios
  103. .post("/api/v1/ams/receiveInwardPlan/" + scope.row.planId)
  104. .then((res) => {
  105. if (res.data.code == 200) {
  106. this.$message({
  107. type: "success",
  108. message: "接收成功!",
  109. });
  110. this.getRequestUrl()
  111. } else {
  112. this.$message({
  113. message: "接收失败",
  114. type: "warning",
  115. });
  116. }
  117. });
  118. })
  119. .catch(() => {
  120. this.$message({
  121. type: "info",
  122. message: "接收操作已取消!",
  123. });
  124. });
  125. },
  126. selectionChange(selection) {
  127. this.second.mapList = selection;
  128. },
  129. desponsePlan(scope) {
  130. this.$router.push("/decomposePlan/" + scope.row.planId);
  131. },
  132. deletePlan(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/bms/deleteTrainSettlement/" + scope.row.requirementId
  143. )
  144. .then((res) => {
  145. if (res.data.code == 200) {
  146. this.$message({
  147. type: "success",
  148. message: "删除成功!",
  149. });
  150. this.getRequestUrl()
  151. } else {
  152. this.$message({
  153. message: "删除失败",
  154. type: "warning",
  155. });
  156. }
  157. });
  158. })
  159. .catch(() => {
  160. this.$message({
  161. type: "info",
  162. message: "删除操作已取消!",
  163. });
  164. });
  165. },
  166. Issue() {
  167. console.log(this.first.mapList);
  168. this.$confirm("是否下发", "提示", {
  169. confirmButtonText: "确定",
  170. cancelButtonText: "取消",
  171. type: "warning",
  172. center: true,
  173. })
  174. .then(() => {
  175. this.axios
  176. .post(
  177. "/api/v1/ams/addFixedAmsDispatchSaleOrder",
  178. this.first.mapList
  179. )
  180. .then((res) => {
  181. if (res.data.code == 200) {
  182. this.$message({
  183. type: "success",
  184. message: "下发成功!",
  185. });
  186. this.getRequestUrl()
  187. } else {
  188. this.$message({
  189. message: "下发失败",
  190. type: "warning",
  191. });
  192. }
  193. });
  194. })
  195. .catch(() => {
  196. this.$message({
  197. type: "info",
  198. message: "取消下发!",
  199. });
  200. });
  201. },
  202. },
  203. };
  204. </script>
  205. <style lang="scss">
  206. .steel_inbound{
  207. .sache{
  208. padding: 1.25rem 0.375rem;
  209. .el-input {
  210. width: 20%;
  211. margin-right: 1.25rem;
  212. }
  213. }
  214. }
  215. </style>