addBargeShip.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <!-- 新增驳船作业 -->
  3. <div class="shipTransport">
  4. <page-title>返回</page-title>
  5. <!-- 第一部分 -->
  6. <div class="top">
  7. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  8. <el-button type="primary" class="btn" @click="onclick()">
  9. <i class="el-icon-search"></i>查询
  10. </el-button>
  11. </div>
  12. <dilTable v-bind.sync="option" @radio-change="currentRadioChange">
  13. </dilTable>
  14. <div class="form">
  15. <!-- 第二部分 -->
  16. <div class="form_box">
  17. <dil-form :formId="125" v-model="form"></dil-form>
  18. </div>
  19. </div>
  20. <div class="button_box">
  21. <el-button type="primary" @click="makeSure">新增驳船作业</el-button>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import PageTitle from "@/components/Page/Title";
  27. import { sjTime } from "@/utils/sharedJsFile";
  28. export default {
  29. components: { PageTitle },
  30. data() {
  31. return {
  32. input:'',
  33. restaurants: [],
  34. state: "",
  35. form: {},
  36. option: {
  37. // 表格请求数据的地址
  38. requestUrl: "/api/v1/tms/getCapacityList?apiId=138",
  39. // 控制显示当选列
  40. selectionType: "radio",
  41. bagerShipMap:{},
  42. },
  43. };
  44. },
  45. mounted() {
  46. },
  47. methods: {
  48. currentRadioChange(row) {
  49. this.bagerShipMap=row
  50. console.log(row);
  51. },
  52. // 新增
  53. makeSure() {
  54. let mapVal = {
  55. orderId: this.$route.params.orderId,
  56. smallCapacityId: this.form.smallCapacityId,
  57. bargeSmallshipLoadWeight: this.form.bargeSmallshipLoadWeight,
  58. bargeRefuteDate: sjTime(
  59. this.form.bargeRefuteDate
  60. ),
  61. bargeRefuteLocation: this.form.bargeRefuteLocation,
  62. bargeBackDate: sjTime(
  63. this.form.bargeBackDate
  64. ),
  65. bargeBackLocation: this.form.bargeBackLocation,
  66. };
  67. if (
  68. mapVal.smallCapacityId==null||
  69. mapVal.bargeSmallshipLoadWeight==null||
  70. mapVal.bargeRefuteDate==null||
  71. mapVal.bargeRefuteLocation==null||
  72. mapVal.bargeBackDate==null||
  73. mapVal.bargeBackLocation==null
  74. ) this.$message.error("存在空值!");
  75. else
  76. this.axios
  77. .post(
  78. "/api/v1/tms/addBargeOperation",
  79. {
  80. mapVal:mapVal,
  81. bagerShipMap:this.bagerShipMap
  82. }
  83. )
  84. .then((res) => {
  85. if (res.data.code == 200) {
  86. this.$message({
  87. type: "success",
  88. message: "新增成功!",
  89. });
  90. // this.$refs.table.refreshData();
  91. this.$router.go(-1);
  92. } else {
  93. this.$message.error("新增失败!");
  94. }
  95. this.$refs['table'].resetField();
  96. });
  97. },
  98. loadAll() {
  99. return [
  100. ];
  101. },
  102. handleSelect(item) {
  103. console.log(item);
  104. },
  105. onclick() {
  106. this.option.requestUrl = "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input
  107. },
  108. },
  109. };
  110. </script>
  111. <style lang='scss'>
  112. .shipTransport{
  113. .form{
  114. display: flex;
  115. .form_box{
  116. width: 320px;
  117. margin-left: 35%;
  118. margin-top: 30px;
  119. margin-right: 20px;
  120. .el-form{
  121. .preview-group{
  122. .el-form-item{
  123. .el-form-item__label{
  124. display: inline-block;
  125. width: 70px !important;
  126. }
  127. .el-form-item__content{
  128. .el-select{
  129. width: 250px;
  130. }
  131. .el-input{
  132. width: 250px;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. .top {
  141. padding: 1.25rem 0.375rem;
  142. .el-input {
  143. width: 20%;
  144. margin-right: 1.25rem;
  145. }
  146. }
  147. .button_box{
  148. margin-left: 45%;
  149. }
  150. }
  151. </style>