breakdownPlanCheck.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <!-- 分派计划查看详情 -->
  3. <div class="homeworkPath">
  4. <div class="top">
  5. <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 type="primary" @click="Issue">
  10. <i class="el-icon-plus"></i>下发
  11. </el-button>
  12. </div>
  13. <el-tabs v-model="activeName">
  14. <!-- 未分派 -->
  15. <el-tab-pane label="未分派" name="first">
  16. <dilTable v-bind.sync="option1" @selection-change="selectionChange">
  17. <el-table-column fixed="right" label="操作" width="100">
  18. <template slot-scope="scope">
  19. <el-button
  20. @click="
  21. updateClick(scope.row.orderId, scope.row.orderMaterialWeight)
  22. "
  23. type="text"
  24. size="small"
  25. >
  26. 修改
  27. </el-button>
  28. <el-button
  29. @click="
  30. deleteClick(
  31. scope.row.orderId,
  32. scope.row.orderMaterialWeight,
  33. scope.row.capacityNumber
  34. )
  35. "
  36. type="text"
  37. size="small"
  38. >
  39. 删除
  40. </el-button>
  41. </template>
  42. </el-table-column>
  43. </dilTable>
  44. </el-tab-pane>
  45. <!-- 已分派-->
  46. <el-tab-pane label="已分派" name="second">
  47. <dilTable v-bind.sync="option2"> </dilTable>
  48. </el-tab-pane>
  49. </el-tabs>
  50. </div>
  51. </template>
  52. <script>
  53. export default {
  54. name: "wagonPlease",
  55. data() {
  56. return {
  57. activeName: "first",
  58. status: "",
  59. input: "",
  60. option1: {
  61. // 表格请求数据的地址
  62. requestUrl:
  63. "/api/v1/oms/getAllTruckOrder?apiId=89&orderStatus=3&orderType=8" ,
  64. mapList: [],
  65. },
  66. option2: {
  67. // 表格请求数据的地址
  68. requestUrl:
  69. "/api/v1/oms/getAllTruckOrder?apiId=86&orderStatus=8&orderType=8",
  70. },
  71. form1: [],
  72. orderId: 0,
  73. };
  74. },
  75. methods: {
  76. currentRadioChange(row) {
  77. this.orderId = row.orderId;
  78. console.log(this.orderId);
  79. },
  80. selectionChange(selection) {
  81. console.log("-----");
  82. this.option1.mapList = selection;
  83. console.log(this.option1.mapList);
  84. console.log("------");
  85. },
  86. // 查询
  87. onclick() {
  88. if (this.activeName == "first") {
  89. this.option1.requestUrl =
  90. "/api/v1/oms/selectAllOrderForSale?apiId=168/1&orderStatus=3&orderType=1&con=" +this.input;
  91. } else {
  92. this.option2.requestUrl =
  93. "/api/v1/oms/selectAllOrderForSale?apiId=168/1&orderStatus=8&orderType=1&con=" +this.input;
  94. }
  95. },
  96. // 返回
  97. onClickCancel(type) {
  98. let map = {
  99. mapList:this.option1.mapList
  100. }
  101. if (type == 1) {
  102. this.$router.go(-1);
  103. } else if (type == 2) {
  104. if (
  105. this.orderId==null||
  106. this.form1.unloadPointId==null
  107. ){
  108. this.$message.error("存在空值!");
  109. }else{
  110. this.axios
  111. .post("/api/v1/oms/dispatchOrder",map)
  112. .then((res) => {
  113. if (res.data.code == "200") {
  114. this.$message({
  115. type: "success",
  116. message: "下发成功!",
  117. });
  118. this.$router.go(0);
  119. }
  120. });
  121. }
  122. }
  123. },
  124. //修改
  125. updateClick(orderId, weight) {
  126. this.$router.push(
  127. "/importedTruckOrder/breakdownPlanEdit/" +
  128. this.$route.params.planId +
  129. "?orderId=" +
  130. orderId +
  131. "&weight=" +
  132. weight
  133. );
  134. },
  135. deleteClick(orderId, weight, capacityNumber) {
  136. this.$confirm("是否删除", "提示", {
  137. confirmButtonText: "确定",
  138. cancelButtonText: "取消",
  139. type: "warning",
  140. center: true,
  141. })
  142. .then(() => {
  143. this.$message({
  144. type: "success",
  145. message: "删除成功!",
  146. });
  147. this.axios
  148. .post(
  149. "/api/v1/oms/deleteOrder?planId=" + this.$route.params.planId,
  150. {
  151. orderId: orderId,
  152. orderMaterialWeight: weight,
  153. capacityNumber: capacityNumber,
  154. }
  155. )
  156. .then(() => {
  157. this.$router.go(0);
  158. });
  159. })
  160. .catch(() => {
  161. this.$message({
  162. type: "info",
  163. message: "取消删除!",
  164. });
  165. });
  166. },
  167. btnClick() {
  168. this.$router.push(
  169. "/breakdownPlanAdd/" + this.$route.params.planId
  170. );
  171. },
  172. },
  173. };
  174. </script>
  175. <style lang='scss' scoped>
  176. .homeworkPath {
  177. .top {
  178. padding: 1.25rem 1.875rem;
  179. }
  180. .xhd {
  181. display: flex;
  182. justify-content: center;
  183. align-items: center;
  184. height: 3.75rem;
  185. }
  186. .btnn {
  187. width: 100%;
  188. height: 6.25rem;
  189. position: absolute;
  190. bottom: 0rem;
  191. display: flex;
  192. align-items: center;
  193. justify-content: center;
  194. .btn1 {
  195. width: 6.25rem;
  196. height: 2.5rem;
  197. }
  198. }
  199. }
  200. </style>