addTransportPrice.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <!-- 添加汽运单价 -->
  3. <div class="addSalePlan">
  4. <page-title>新增</page-title>
  5. <div class="form-box" style="margin-right: 10rem">
  6. <dil-form :formId="287" v-model="form1" ref="from1"></dil-form>
  7. </div>
  8. <div class="button-box">
  9. <el-button @click="cancel">取消</el-button>
  10. <el-button type="primary" @click="makeSure">确定</el-button>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import PageTitle from "@/components/Page/Title";
  16. export default {
  17. components: { PageTitle },
  18. data() {
  19. return {
  20. form1: {},
  21. value: undefined,
  22. };
  23. },
  24. created(){
  25. this.form1.priceDate=new Date()
  26. },
  27. methods: {
  28. // 确定
  29. makeSure() {
  30. let amsContractTransportPrice = {
  31. shipperId: this.form1.shipperId,
  32. carrierId: this.form1.carrierId,
  33. lineId: this.form1.lineId,
  34. addressId: this.form1.addressId,
  35. priceValue: this.form1.priceValue,
  36. priceDate: sjTime(this.form1.priceDate),
  37. };
  38. if (
  39. amsContractTransportPrice.shipperId &&
  40. amsContractTransportPrice.carrierId &&
  41. amsContractTransportPrice.lineId &&
  42. amsContractTransportPrice.addressId &&
  43. amsContractTransportPrice.priceValue &&
  44. amsContractTransportPrice.priceDate
  45. ){
  46. this.axios
  47. .post(
  48. "/api/v1/ams/addAmsContractTransportUnitPrice1",
  49. amsContractTransportPrice
  50. )
  51. .then((res) => {
  52. console.log(res.data.data);
  53. if (res.data.code == "200") {
  54. this.$router.go(-1);
  55. }
  56. });
  57. }else {
  58. this.$message.error("必填项存在空值!");
  59. }
  60. },
  61. // 取消
  62. cancel() {
  63. this.$router.go(-1);
  64. },
  65. },
  66. };
  67. </script>
  68. <style lang='scss' scoped>
  69. .form-box{
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. margin-top: 5px;
  74. margin-bottom: 20px;
  75. }
  76. .button-box{
  77. display: flex;
  78. text-align: center;
  79. align-items: center;
  80. justify-content: center;
  81. margin-top: 0.3125rem;
  82. margin-bottom: 1.25rem;
  83. }
  84. </style>