addBargeShip.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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" :disable="isLock">新增驳船作业</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. isLock:false,
  33. input:'',
  34. restaurants: [],
  35. state: "",
  36. form: {},
  37. option: {
  38. // 表格请求数据的地址
  39. requestUrl: "/api/v1/tms/getCapacityList?apiId=138",
  40. // 控制显示当选列
  41. selectionType: "radio",
  42. bagerShipMap:{},
  43. },
  44. };
  45. },
  46. mounted() {
  47. },
  48. methods: {
  49. currentRadioChange(row) {
  50. this.bagerShipMap=row
  51. console.log(row);
  52. },
  53. // 新增
  54. makeSure() {
  55. let mapVal = {
  56. orderId: this.$route.params.orderId,
  57. smallCapacityId: this.form.smallCapacityId,
  58. bargeSmallshipLoadWeight: this.form.bargeSmallshipLoadWeight,
  59. bargeRefuteDate: sjTime(
  60. this.form.bargeRefuteDate
  61. ),
  62. bargeRefuteLocation: this.form.bargeRefuteLocation,
  63. bargeBackDate: sjTime(
  64. this.form.bargeBackDate
  65. ),
  66. bargeBackLocation: this.form.bargeBackLocation,
  67. };
  68. if (
  69. mapVal.smallCapacityId==null||
  70. mapVal.bargeSmallshipLoadWeight==null||
  71. mapVal.bargeRefuteDate==null||
  72. mapVal.bargeRefuteLocation==null||
  73. mapVal.bargeBackDate==null||
  74. mapVal.bargeBackLocation==null
  75. ) this.$message.error("存在空值!");
  76. else
  77. this.axios
  78. .post(
  79. "/api/v1/tms/addBargeOperation",
  80. {
  81. mapVal:mapVal,
  82. bagerShipMap:this.bagerShipMap
  83. }
  84. )
  85. .then((res) => {
  86. if (res.data.code == 200) {
  87. this.$message({
  88. type: "success",
  89. message: "新增成功!",
  90. });
  91. // this.$refs.table.refreshData();
  92. this.$router.go(-1);
  93. } else {
  94. this.$message.error("新增失败!");
  95. }
  96. this.$refs['table'].resetField();
  97. });
  98. },
  99. loadAll() {
  100. return [
  101. ];
  102. },
  103. handleSelect(item) {
  104. console.log(item);
  105. },
  106. onclick() {
  107. this.option.requestUrl = "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input
  108. },
  109. },
  110. };
  111. </script>
  112. <style lang='scss'>
  113. .shipTransport{
  114. .form{
  115. display: flex;
  116. .form_box{
  117. width: 320px;
  118. margin-left: 35%;
  119. margin-top: 30px;
  120. margin-right: 20px;
  121. .el-form{
  122. .preview-group{
  123. .el-form-item{
  124. .el-form-item__label{
  125. display: inline-block;
  126. width: 70px !important;
  127. }
  128. .el-form-item__content{
  129. .el-select{
  130. width: 250px;
  131. }
  132. .el-input{
  133. width: 250px;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. }
  141. .top {
  142. padding: 1.25rem 0.375rem;
  143. .el-input {
  144. width: 20%;
  145. margin-right: 1.25rem;
  146. }
  147. }
  148. .button_box{
  149. margin-left: 45%;
  150. margin-right:1500px;
  151. width:150px;
  152. }
  153. }
  154. </style>