trade.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. define({
  2. name: "trade",
  3. template: `
  4. <div>
  5. <el-form ref="form" label-width="15%">
  6. <div id="vue_head">
  7. <div class="base_set">
  8. <div class="vue-main-title">
  9. <div class="vue-main-title-left"></div>
  10. <div class="vue-main-title-content">交易设置</div>
  11. </div>
  12. <div class="vue-main-form">
  13. <el-form-item label="隐藏售后按钮时间段">
  14. <el-switch v-model="form.hide_status" :active-value="1" :inactive-value="0"></el-switch>
  15. </el-form-item>
  16. <el-form-item>
  17. <el-input v-model="form.begin_hide_day" style="width:18%;margin-right: 15px">
  18. <template slot="prepend">第</template>
  19. <template slot="append">天</template>
  20. </el-input>
  21. <el-time-select
  22. v-model="form.begin_hide_time"
  23. value-format="timestamp"
  24. :picker-options="{
  25. start: '00:00',
  26. step: '00:05',
  27. end: '24:00'
  28. }"
  29. placeholder="选择开始隐藏时间">
  30. </el-time-select>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-select v-model="form.end_hide_day" placeholder="请选择" style="width:18%;margin-right: 15px">
  34. <el-option
  35. v-for="item in hide_day_arr"
  36. :key="item.value"
  37. :label="item.label"
  38. :value="item.value">
  39. </el-option>
  40. </el-select>
  41. <el-time-select
  42. v-model="form.end_hide_time"
  43. value-format="timestamp"
  44. :picker-options="{
  45. start: '00:00',
  46. step: '00:05',
  47. end: '24:00'
  48. }"
  49. placeholder="选择结束隐藏时间">
  50. </el-time-select>
  51. </el-form-item>
  52. <el-form-item label="自动发货">
  53. <el-switch v-model="form.auto_send" :active-value="1" :inactive-value="0"></el-switch>
  54. </el-form-item>
  55. <el-form-item>
  56. <el-input v-model="form.auto_send_day" style="width:18%;margin-right: 15px">
  57. <template slot="prepend">第</template>
  58. <template slot="append">天</template>
  59. </el-input>
  60. <el-time-select
  61. v-model="form.auto_send_time"
  62. value-format="timestamp"
  63. :picker-options="{
  64. start: '00:00',
  65. step: '00:05',
  66. end: '24:00'
  67. }"
  68. placeholder="选择时间">
  69. </el-time-select>
  70. </el-form-item>
  71. <el-form-item label="送达时间">
  72. <el-input v-model="form.arrived_day" style="width:18%;margin-right: 15px">
  73. <template slot="prepend">第</template>
  74. <template slot="append">天</template>
  75. </el-input>
  76. <el-time-select
  77. v-model="form.arrived_time"
  78. value-format="timestamp"
  79. :picker-options="{
  80. start: '00:00',
  81. step: '00:05',
  82. end: '24:00'
  83. }"
  84. placeholder="选择时间">
  85. </el-time-select>
  86. </el-form-item>
  87. <el-form-item label="自定义文字">
  88. <el-input v-model="form.arrived_word" style="width:35%;margin-right: 15px"></el-input>
  89. <div style="color: #0ad76d;cursor: pointer;width: 68px" @click="add('送达时间')">[送达时间]</div>
  90. </el-form-item>
  91. </div>
  92. </div>
  93. </div>
  94. </el-form>
  95. </div>
  96. `,
  97. data(){
  98. return {
  99. hide_day_arr: [
  100. {
  101. label:'当日',
  102. value:0,
  103. },
  104. {
  105. label:'次日',
  106. value:1,
  107. },
  108. ],
  109. }
  110. },
  111. style: ``,
  112. mounted() {
  113. },
  114. methods:{
  115. extraDate(){
  116. },
  117. validate(){
  118. if (this.form.hide_status==1 && this.form.begin_hide_day < 1) {
  119. this.$message.error('隐藏售后天数不能小于1');return false;
  120. }
  121. if (this.form.auto_send==1 && this.form.auto_send_day < 1) {
  122. this.$message.error('自动发货天数不能小于1');return false;
  123. }
  124. if (this.form.arrived_day < 1) {
  125. this.$message.error('送达时间天数不能小于1');return false;
  126. }
  127. return {
  128. hide_status:this.form.hide_status,
  129. begin_hide_day:this.form.begin_hide_day,
  130. begin_hide_time:this.form.begin_hide_time,
  131. end_hide_day:this.form.end_hide_day,
  132. end_hide_time:this.form.end_hide_time,
  133. auto_send:this.form.auto_send,
  134. auto_send_day:this.form.auto_send_day,
  135. auto_send_time:this.form.auto_send_time,
  136. arrived_day:this.form.arrived_day,
  137. arrived_time:this.form.arrived_time,
  138. arrived_word:this.form.arrived_word,
  139. }
  140. },
  141. add(item){
  142. this.form.arrived_word = this.form.arrived_word+`[${item}]`
  143. },
  144. },
  145. props: {
  146. form: {
  147. type: Object,
  148. default() {
  149. return {}
  150. }
  151. }
  152. }
  153. })