addTruckCalculate.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <!-- 添加汽车衡信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <div class="form-box" style="margin-right: 10rem">
  6. <dil-form :formId="317" v-model="form1" ref="from1"> </dil-form>
  7. </div>
  8. <div class="form-box f1">
  9. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  10. </el-form>
  11. </div>
  12. <div class="inputBox">
  13. <el-input
  14. :inline="true"
  15. placeholder="请输入内容"
  16. v-model="inputText"
  17. clearable
  18. >
  19. </el-input>
  20. <el-button type="primary" class="btn" @click="onclick" :inline="true">
  21. <i class="el-icon-search"></i>物资列表查询
  22. </el-button>
  23. </div>
  24. <div>
  25. <dilTable
  26. v-bind.sync="options"
  27. @selection-change="selectionChange"
  28. ></dilTable>
  29. </div>
  30. <div class="button-box">
  31. <el-button @click="cancel">取消</el-button>
  32. <el-button type="primary" @click="makeSure">确定</el-button>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import PageTitle from "@/components/Page/Title";
  38. export default {
  39. components: { PageTitle },
  40. data() {
  41. return {
  42. materialName: "",
  43. form1: {},
  44. checkList: [],
  45. inputText: "",
  46. options: {
  47. // first请求数据的地址
  48. requestUrl: "/api/v1/rms/getMaterialList?apiId=351",
  49. selectionType: "select",
  50. mapList: [],
  51. },
  52. };
  53. },
  54. mounted() {},
  55. methods: {
  56. selectionChange(selection) {
  57. (this.mapList = selection), console.log(this.mapList);
  58. this.materialName = this.mapList.materialName;
  59. },
  60. onclick() {
  61. this.options.requestUrl =
  62. "/api/v1/rms/getMaterialList?apiId=351&con=" + this.inputText;
  63. },
  64. makeSure() {
  65. console.log(this.form1);
  66. let rmsTruckCalculate = {
  67. truckCalculateNumber: this.form1.truckCalculateNumber,
  68. truckCalculateId: this.form1.truckCalculateId,
  69. truckCalculateLongitude: this.form1.truckCalculateLongitude,
  70. truckCalculateLatitude: this.form1.truckCalculateLatitude,
  71. calculateType: this.form1.calculateType,
  72. };
  73. let map = {
  74. mapList: this.mapList,
  75. rmsTruckCalculate: rmsTruckCalculate,
  76. };
  77. if (
  78. rmsTruckCalculate.truckCalculateNumber == null ||
  79. rmsTruckCalculate.truckCalculateLongitude == null ||
  80. rmsTruckCalculate.truckCalculateLatitude == null ||
  81. rmsTruckCalculate.calculateType == null
  82. )
  83. this.$message.error("存在空值!");
  84. else
  85. this.axios.post("/api/v1/rms/insertTruckCalculate", map).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. // 取消
  100. cancel() {
  101. this.$router.go(-1);
  102. },
  103. },
  104. };
  105. </script>
  106. <style lang='scss' >
  107. .button-box {
  108. display: flex;
  109. justify-content: center;
  110. .el-button {
  111. width: 80px;
  112. margin-right: 10px;
  113. }
  114. }
  115. .inputBox {
  116. display: flex;
  117. text-align: center;
  118. align-items: center;
  119. margin-top: 2rem;
  120. width: 800px;
  121. .el-input__inner {
  122. display: flex;
  123. text-align: center;
  124. align-items: center;
  125. }
  126. }
  127. .btn-left {
  128. margin-left: 470px;
  129. }
  130. .input {
  131. margin-left: 90px;
  132. }
  133. .label {
  134. margin-left: 445px;
  135. margin-bottom: -30px;
  136. font: bold;
  137. font-size: 1rem;
  138. padding-left: -30px;
  139. font-family: Arial, Helvetica, sans-serif;
  140. margin-bottom: 20px;
  141. }
  142. .label2 {
  143. margin-left: 425px;
  144. margin-bottom: -30px;
  145. font: bold;
  146. font-size: 1rem;
  147. font-family: Arial, Helvetica, sans-serif;
  148. }
  149. .label1 {
  150. margin-left: 345px;
  151. margin-bottom: -30px;
  152. font: bold;
  153. }
  154. .common {
  155. font-weight: 700;
  156. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
  157. Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  158. font-size: 1rem;
  159. cursor: default;
  160. color: #2c3e50;
  161. }
  162. .f1 {
  163. margin-top: -2.5rem;
  164. margin-left: 25rem;
  165. }
  166. .f11 {
  167. margin-top: -3rem;
  168. // margin-left: 29rem;
  169. }
  170. .f2 {
  171. margin-top: -2.5rem;
  172. margin-left: 20.7rem;
  173. }
  174. .f3 {
  175. margin-top: -2.5rem;
  176. margin-left: 25rem;
  177. }
  178. .form-box {
  179. display: flex;
  180. justify-content: center;
  181. .el-form-item {
  182. display: flex;
  183. justify-content: center;
  184. .el-form-item__label {
  185. display: flex;
  186. align-items: center;
  187. }
  188. .el-form-item__content {
  189. .el-input {
  190. .el-input__inner {
  191. width: 250px;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. </style>