addTruckPrice.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div class="addShipPrice">
  3. <page-title>新增</page-title>
  4. <el-divider content-position="left">添加汽运价格</el-divider>
  5. <div class="form-box" style="margin-right: 10rem">
  6. <dil-form :formId="217" 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 = {
  26. priceDate:new Date()
  27. }
  28. },
  29. methods: {
  30. // 确定
  31. makeSure() {
  32. let amsContractTransportPrice = {
  33. priceValue: this.form1.priceValue,
  34. priceDate: sjTime(this.form1.priceDate)
  35. };
  36. console.log(amsContractTransportPrice);
  37. if (
  38. amsContractTransportPrice.priceValue==null||
  39. amsContractTransportPrice.priceDate==null
  40. ) this.$message.error("必填项存在空值!");
  41. else
  42. this.axios
  43. .post(
  44. "/api/v1/ams/addAmsContractTransportPrice",
  45. amsContractTransportPrice
  46. )
  47. .then((res) => {
  48. if (res.data.code == 200) {
  49. this.$message({
  50. type: "success",
  51. message: "新增成功!",
  52. });
  53. // this.$refs.table.refreshData();
  54. this.$router.go(-1);
  55. } else {
  56. this.$message.error("新增失败!");
  57. }
  58. this.$refs['table'].resetField();
  59. });
  60. },
  61. // 取消
  62. cancel() {
  63. this.$router.go(-1);
  64. },
  65. },
  66. };
  67. </script>
  68. <style lang='scss' scoped>
  69. </style>