RailPlan.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. <el-button type="primary" class="btn" @click="Issue" v-if="activeName == 'second'">
  11. <i class="el-icon-download"></i>下发
  12. </el-button>
  13. </div>
  14. <template>
  15. <div>
  16. <el-tabs v-model="activeName" @tab-click="handleClick">
  17. <el-tab-pane label="未下发" name="second">
  18. <dilTable v-bind.sync="second" @selection-change="selectionChange">
  19. </dilTable>
  20. </el-tab-pane>
  21. <el-tab-pane label="已下发" name="third">
  22. <dilTable v-bind.sync="third">
  23. </dilTable>
  24. </el-tab-pane>
  25. </el-tabs>
  26. </div>
  27. </template>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. inputText: "",
  35. second: {
  36. // second请求数据的地址
  37. requestUrl: "/api/v1/ams/getRailOffsetDayplan?apiId=183&dayplanReceiveStatus=0",
  38. selectionType: "select",
  39. mapList: [],
  40. },
  41. third: {
  42. // second请求数据的地址
  43. requestUrl: "/api/v1/ams/getRailOffsetDayplan?apiId=183&dayplanReceiveStatus=1",
  44. },
  45. activeName: "second",
  46. }
  47. },
  48. methods: {
  49. receiver(scope){
  50. this.$confirm("是否接收", "提示", {
  51. confirmButtonText: "确定",
  52. cancelButtonText: "取消",
  53. type: "warning",
  54. center: true,
  55. })
  56. .then(() => {
  57. this.$axios
  58. .post("/api/v1/ams/receiveRequirement/" + scope.row.requirementId)
  59. .then((res) => {
  60. this.$router.go(0);
  61. if (res.data.code == 200) {
  62. this.$message({
  63. type: "success",
  64. message: "接收成功!",
  65. });
  66. } else {
  67. this.$message({
  68. message: "接收失败",
  69. type: "warning",
  70. });
  71. }
  72. });
  73. })
  74. .catch(() => {
  75. this.$message({
  76. type: "info",
  77. message: "接收操作已取消!",
  78. });
  79. });
  80. },
  81. selectionChange(selection) {
  82. this.second.mapList = selection
  83. },
  84. toInsert() {
  85. this.$router.push("/addPlan");
  86. },
  87. updatePlan(scope) {
  88. this.$router.push("/updatePlan/" + scope.row.planId)
  89. },
  90. deletePlan(scope) {
  91. this.$confirm("是否删除", "提示", {
  92. confirmButtonText: "确定",
  93. cancelButtonText: "取消",
  94. type: "warning",
  95. center: true,
  96. })
  97. .then(() => {
  98. this.$axios
  99. .post("/api/v1/ams//deleteTruckPlan/" + scope.row.planId)
  100. .then((res) => {
  101. if (res.data.code == 200) {
  102. this.$message({
  103. type: "success",
  104. message: "删除成功!",
  105. });
  106. this.$router.go(0);
  107. } else {
  108. this.$message({
  109. message: "删除失败",
  110. type: "warning",
  111. });
  112. }
  113. });
  114. })
  115. .catch(() => {
  116. this.$message({
  117. type: "info",
  118. message: "删除操作已取消!",
  119. });
  120. });
  121. },
  122. Issue() {
  123. console.log(this.second.mapList)
  124. this.$confirm("是否下发", "提示", {
  125. confirmButtonText: "确定",
  126. cancelButtonText: "取消",
  127. type: "warning",
  128. center: true,
  129. })
  130. .then(() => {
  131. this.$axios
  132. .post("/api/v1/ams/issueRailOffsetDayplan", this.second.mapList)
  133. .then((res) => {
  134. if (res.data.code == 200) {
  135. this.$message({
  136. type: "success",
  137. message: "下发成功!",
  138. });
  139. this.$router.go(0);
  140. } else {
  141. this.$message({
  142. message: "下发失败",
  143. type: "warning",
  144. });
  145. }
  146. });
  147. })
  148. .catch(() => {
  149. this.$message({
  150. type: "info",
  151. message: "取消下发!",
  152. });
  153. });
  154. },
  155. // },
  156. receiver(scope) {
  157. this.$confirm("是否接收", "提示", {
  158. confirmButtonText: "确定",
  159. cancelButtonText: "取消",
  160. type: "warning",
  161. center: true,
  162. })
  163. .then(() => {
  164. this.$axios
  165. .post("/api/v1/ams/receiveRequirement/" + scope.row.requirementId)
  166. .then((res) => {
  167. this.$router.go(0);
  168. if (res.data.code == 200) {
  169. this.$message({
  170. type: "success",
  171. message: "接收成功!",
  172. });
  173. } else {
  174. this.$message({
  175. message: "接收失败",
  176. type: "warning",
  177. });
  178. }
  179. });
  180. })
  181. .catch(() => {
  182. this.$message({
  183. type: "info",
  184. message: "接收操作已取消!",
  185. });
  186. });
  187. },
  188. selectionChange(selection) {
  189. this.second.mapList = selection;
  190. },
  191. deletePlan(scope) {
  192. this.$confirm("是否删除", "提示", {
  193. confirmButtonText: "确定",
  194. cancelButtonText: "取消",
  195. type: "warning",
  196. center: true,
  197. })
  198. .then(() => {
  199. this.$axios
  200. .post("/api/v1/ams//deleteTruckPlan/" + scope.row.planId)
  201. .then((res) => {
  202. if (res.data.code == 200) {
  203. this.$message({
  204. type: "success",
  205. message: "删除成功!",
  206. });
  207. this.$router.go(0);
  208. } else {
  209. this.$message({
  210. message: "删除失败",
  211. type: "warning",
  212. });
  213. }
  214. });
  215. })
  216. .catch(() => {
  217. this.$message({
  218. type: "info",
  219. message: "删除操作已取消!",
  220. });
  221. });
  222. },
  223. Issue() {
  224. console.log(this.second.mapList);
  225. this.$confirm("是否下发", "提示", {
  226. confirmButtonText: "确定",
  227. cancelButtonText: "取消",
  228. type: "warning",
  229. center: true,
  230. })
  231. .then(() => {
  232. this.$axios
  233. .post("/api/v1/ams/issueRailOffsetDayplan", this.second.mapList)
  234. .then((res) => {
  235. if (res.data.code == 200) {
  236. this.$message({
  237. type: "success",
  238. message: "下发成功!",
  239. });
  240. this.$router.go(0);
  241. } else {
  242. this.$message({
  243. message: "下发失败",
  244. type: "warning",
  245. });
  246. }
  247. });
  248. })
  249. .catch(() => {
  250. this.$message({
  251. type: "info",
  252. message: "取消下发!",
  253. });
  254. });
  255. },
  256. },
  257. };
  258. </script>
  259. <style lang="scss">
  260. .steel_inbound {
  261. .sache {
  262. height: 5rem;
  263. display: flex;
  264. align-items: center;
  265. padding-left: 1.875rem;
  266. }
  267. }
  268. </style>