addReceivingCompany.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <!-- 添加运力信息 -->
  3. <div class="addCapacity">
  4. <PageTitle>返回</PageTitle>
  5. <div class="form_box">
  6. <el-form>
  7. <el-form-item label="收款客户编码:">
  8. <el-input v-model="form.companyCode"></el-input>
  9. </el-form-item>
  10. <el-form-item label="收款客户名称:">
  11. <el-input v-model="form.companyName"></el-input>
  12. </el-form-item>
  13. </el-form>
  14. </div>
  15. <div class="button_box">
  16. <el-button @click="cancel">取消</el-button>
  17. <el-button type="primary" @click="makeSure" :loading="addLoading"
  18. >确定</el-button
  19. >
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import PageTitle from "@/components/Page/Title";
  25. import { getCookie } from "@/utils/util.js";
  26. export default {
  27. components: { PageTitle },
  28. data() {
  29. return {
  30. form:{
  31. materialCokeName:null
  32. },
  33. addLoading:false
  34. };
  35. },
  36. created() {
  37. },
  38. mounted() {
  39. },
  40. methods: {
  41. makeSure() {
  42. this.addLoading=true;
  43. if(!this.form || !this.form.companyCode || !this.form.companyName){
  44. this.$message.warning("请输入!");
  45. this.addLoading=false;
  46. }else{
  47. this.axios.post("/api/v1/rms/insertReceiveCompany",this.form).then(res => {
  48. if (res.data.code == "200") {
  49. this.$message.success("新增成功!");
  50. this.cancel();
  51. }else{
  52. this.$message.warning("新增失败!");
  53. }
  54. this.addLoading=false;
  55. }).catch(()=>{
  56. this.addLoading=false;
  57. });
  58. }
  59. },
  60. // 取消
  61. cancel() {
  62. this.$router.go(-1);
  63. }
  64. }
  65. };
  66. </script>
  67. <style lang="scss">
  68. .shippingCertificate {
  69. width: 200px;
  70. }
  71. .el-form--inline .el-form-item__content {
  72. display: inline-block;
  73. vertical-align: top;
  74. position: relative;
  75. left: 37px;
  76. }
  77. .addCapacity {
  78. .elForm {
  79. margin-left: 40%;
  80. }
  81. .form_box {
  82. width: 100%;
  83. margin-top: 30px;
  84. margin-left: 50px;
  85. display: flex;
  86. justify-content: center;
  87. .el-form-item {
  88. display: flex;
  89. justify-content: center;
  90. .el-form-item__label {
  91. display: flex;
  92. align-items: center;
  93. }
  94. .el-form-item__content {
  95. .el-select {
  96. width: 250px;
  97. }
  98. .el-input {
  99. width: 250px;
  100. }
  101. }
  102. }
  103. }
  104. .inputBox {
  105. display: flex;
  106. justify-content: center;
  107. margin-bottom: 30px;
  108. .text {
  109. text-align: right;
  110. display: flex;
  111. align-items: center;
  112. margin-right: 5px;
  113. }
  114. .input {
  115. width: 250px;
  116. }
  117. }
  118. .button_box {
  119. display: flex;
  120. justify-content: center;
  121. .el-button {
  122. width: 80px;
  123. margin-right: 10px;
  124. }
  125. }
  126. }
  127. </style>