saleOrderArrange.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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()">
  11. <i class="el-icon-download"></i>下发
  12. </el-button>
  13. </div>
  14. <template>
  15. <div>
  16. <dilTable v-bind.sync="first" @selection-change="selectionChange">
  17. <el-table-column fixed="right" label="操作" width="150">
  18. <template slot-scope="scope">
  19. <el-button
  20. @click="lookclick(scope.row.saleOrderId)"
  21. type="text"
  22. size="small"
  23. >查看修改地址</el-button
  24. >
  25. <el-button
  26. @click="passclick(scope.row.saleOrderId)"
  27. type="text"
  28. size="small"
  29. >修改日志</el-button
  30. >
  31. </template>
  32. </el-table-column>
  33. </dilTable>
  34. </div>
  35. </template>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. inputText: "",
  43. first: {
  44. // first请求数据的地址
  45. requestUrl: "/api/v1/ams/getTruckNoList?apiId=411&issueStatus=0",
  46. selectionType: "select",
  47. mapList: [],
  48. },
  49. activeName: "first",
  50. };
  51. },
  52. methods: {
  53. Issue(){
  54. if(this.first.mapList.length==0){
  55. this.$message({
  56. type: "warning",
  57. message: "请先选择订单!",
  58. });
  59. }else{
  60. this.$confirm("是否下发", "提示", {
  61. confirmButtonText: "确定",
  62. cancelButtonText: "取消",
  63. type: "warning",
  64. center: true,
  65. })
  66. .then(() => {
  67. //初始化maplist
  68. var mapList = [];
  69. this.first.mapList.forEach((item,i) => {
  70. //初始化mapItem
  71. var mapItem={
  72. //销售订单物资中间表id
  73. saleOrderMaterialId : 0,
  74. };
  75. mapItem.saleOrderMaterialId=item.saleOrderMaterialId;
  76. mapList.push(mapItem);
  77. });
  78. this.$message({
  79. type: "success",
  80. message: "下发成功!",
  81. });
  82. this.axios.post("/api/v1/ams/issueTruckNo", mapList).then((res) => {
  83. if (res.data.code == "200") {
  84. this.$router.go(0);
  85. }
  86. });
  87. })
  88. .catch(() => {
  89. this.$message({
  90. type: "info",
  91. message: "取消上传!",
  92. });
  93. });
  94. }
  95. },
  96. lookclick(saleOrderId) {
  97. this.$router.push("/saleOrderDetailApproved/" + saleOrderId);
  98. },
  99. passclick(saleOrderId) {
  100. this.$router.push("/saleOrderUpdateLog/" + saleOrderId);
  101. },
  102. selectionChange(selection) {
  103. this.first.mapList = selection;
  104. },
  105. },
  106. };
  107. </script>
  108. <style lang="scss" scode>
  109. .steel_inbound {
  110. .sache {
  111. padding: 1.25rem 0.375rem;
  112. .el-input {
  113. width: 20%;
  114. margin-right: 1.25rem;
  115. }
  116. }
  117. }
  118. </style>