deal_set.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div class="container">
  3. <el-form :model="form">
  4. <h3>订单参数</h3>
  5. <el-form-item>
  6. <div class="dflex margin_t_20">
  7. <div class="front_txt">下单后,超过</div>
  8. <el-input class="input" size="mini" min="0" v-model.number="form.unpay_overdue_minute"
  9. type="number"></el-input>
  10. <div class="rear_txt">分钟未付款,自动取消订单</div>
  11. </div>
  12. </el-form-item>
  13. <el-form-item><el-button class="confirm_btn" @click="save">保 存</el-button></el-form-item>
  14. </el-form>
  15. </div>
  16. </template>
  17. <script>
  18. const __name = 'usemall-order-parameter';
  19. export default {
  20. data() {
  21. return {
  22. dataId: '',
  23. form: {
  24. unpay_overdue_minute: 0
  25. }
  26. };
  27. },
  28. methods: {
  29. async loadData() {
  30. await this.$db[__name].tofirst().then(res => {
  31. if (res.code == 200) {
  32. for (let item in this.form) {
  33. this.form[item] = res.datas[item];
  34. }
  35. this.dataId = res.datas._id;
  36. }
  37. });
  38. },
  39. save() {
  40. if (!this.dataId) {
  41. this.$db[__name].add(this.form).then(res => {
  42. if (res.code == 200) {
  43. this.$message({
  44. message: '保存成功',
  45. type: 'success'
  46. });
  47. }
  48. });
  49. } else {
  50. this.$db[__name].update(this.dataId, this.form).then(res => {
  51. if (res.code == 200) {
  52. this.$message({
  53. message: '保存成功',
  54. type: 'success'
  55. });
  56. }
  57. });
  58. }
  59. }
  60. },
  61. created() {
  62. this.loadData();
  63. }
  64. };
  65. </script>
  66. <style>
  67. >>>.input {
  68. width: 70px;
  69. margin: 0 10px;
  70. }
  71. >>>.input .el-input__inner {
  72. width: 100%;
  73. background-color: #f6f6f6;
  74. border-color: #f6f6f6;
  75. padding: 0 0 0 15px;
  76. }
  77. .front_txt {
  78. width: 200px;
  79. text-align: right;
  80. font-size: 13px;
  81. }
  82. .rear_txt {
  83. font-size: 13px;
  84. display: flex;
  85. align-items: center;
  86. }
  87. .confirm_btn {
  88. margin-left: 210px;
  89. }
  90. </style>