addTruckPrice.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <!-- 添加水运价格 -->
  3. <div class="addShipPrice">
  4. <page-title>新增</page-title>
  5. <el-divider content-position="left">添加汽运价格</el-divider>
  6. <div class="form-box" style="margin-right: 10rem">
  7. <dil-form :formId="217" v-model="form1" ref="from1"></dil-form>
  8. </div>
  9. <div class="button-box">
  10. <el-button @click="cancel">取消</el-button>
  11. <el-button type="primary" @click="makeSure">确定</el-button>
  12. </div>
  13. <!-- <div class="primarybtn">
  14. <el-button class="btn" @click="goback">取消</el-button>
  15. <el-button type="primary" class="btn" @click="submitclick"
  16. >确定</el-button
  17. >
  18. </div> -->
  19. </div>
  20. </template>
  21. <script>
  22. import PageTitle from "@/components/Page/Title";
  23. export default {
  24. components: { PageTitle },
  25. data() {
  26. return {
  27. form1: {},
  28. value: undefined,
  29. };
  30. },
  31. mounted() {},
  32. methods: {
  33. // 确定
  34. makeSure() {
  35. let amsContractTransportPrice = {
  36. priceValue: this.form1.priceValue,
  37. priceDate: sjTime(this.form1.priceDate)
  38. };
  39. console.log(amsContractTransportPrice);
  40. if (
  41. amsContractTransportPrice.priceValue==null||
  42. amsContractTransportPrice.priceDate==null
  43. ) this.$message.error("必填项存在空值!");
  44. else
  45. this.axios
  46. .post(
  47. "/api/v1/ams/addAmsContractTransportPrice",
  48. amsContractTransportPrice
  49. )
  50. .then((res) => {
  51. if (res.data.code == 200) {
  52. this.$message({
  53. type: "success",
  54. message: "新增成功!",
  55. });
  56. // this.$refs.table.refreshData();
  57. this.$router.go(-1);
  58. } else {
  59. this.$message.error("新增失败!");
  60. }
  61. this.$refs['table'].resetField();
  62. });
  63. },
  64. // 取消
  65. cancel() {
  66. this.$router.go(-1);
  67. },
  68. },
  69. };
  70. </script>
  71. <style lang='scss' scoped>
  72. </style>