phoneBill.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. define({
  2. template: `
  3. <div>
  4. <el-form ref="form" label-width="15%">
  5. <div id="vue_head">
  6. <div class="base_set">
  7. <div class="vue-main-title">
  8. <div class="vue-main-title-left"></div>
  9. <div class="vue-main-title-content">话费慢充</div>
  10. </div>
  11. <div class="vue-main-form">
  12. <el-form-item label="92折话费慢充">
  13. <el-switch v-model="saveData.status" :active-value="1" :inactive-value="0"></el-switch>
  14. <div class="tip">首次发布商品,先点击发布商品,再重新编辑商品,设置话费慢充规格!</div>
  15. </el-form-item>
  16. <el-form-item>
  17. <el-row :gutter="10" class="gutter">
  18. <el-col :span="5">
  19. <div class="grid-content bg-purple">规格项</div>
  20. </el-col>
  21. <el-col :span="5" >
  22. <div class="grid-content bg-purple">关联第三方面值</div>
  23. </el-col>
  24. </el-row>
  25. <el-row :gutter="10" class="gutter" v-for="(option, index) in options" :key="index">
  26. <el-col :span="5">
  27. <div class="grid-content bg-purple">{{option.title}}</div>
  28. </el-col>
  29. <el-col :span="5">
  30. <el-select size="small" v-model="option.type" placeholder="请选择" style="width: 120px">
  31. <el-option v-for="(item,value_key) in type_value" :key="value_key" :label="item.name" :value="item.v">
  32. </el-option>
  33. </el-select>
  34. </el-col>
  35. </el-row>
  36. <div class="help-block">如果您修改了商品规格,需要手动设置关联!</div>
  37. </el-form-item>
  38. </div>
  39. </div>
  40. </div>
  41. </el-form>
  42. </div>
  43. `,
  44. style: ``,
  45. data(){
  46. return {
  47. saveData: {
  48. status:0,
  49. },
  50. options:[],
  51. type_value: [
  52. {'name': 50, "v":1},
  53. {'name': 100, "v":2},
  54. {'name': 200, "v":3},
  55. ],
  56. }
  57. },
  58. created() {
  59. if(this.form){
  60. if( JSON.stringify(this.form) !== '[]'){
  61. this.saveData.status = this.form.status;
  62. this.options = this.form.options;
  63. }
  64. }
  65. },
  66. methods:{
  67. validate(){
  68. return {
  69. status:this.saveData.status,
  70. options:this.options,
  71. }
  72. },
  73. extraDate(){
  74. },
  75. },
  76. props: {
  77. form: {
  78. // type: Object,
  79. default() {
  80. return {}
  81. }
  82. }
  83. }
  84. });