recharge.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <el-card shadow="never" style="border: 0;">
  3. <yun-form v-if="rechargeData" :data="rechargeData" :columns="rechargeColumn">
  4. <template #default>
  5. {:token_field()}
  6. </template>
  7. <template #now="{rows}">
  8. {foreach $moduletype as $key=>$type}
  9. <el-form-item label="当前{$type}:" v-if="rows.module_type=='{$key}'">
  10. <el-input value="{$user[$key]}" :disabled="true"></el-input>
  11. </el-form-item>
  12. {/foreach}
  13. </template>
  14. <template #change="{rows}">
  15. <el-form-item :label="'变化'+getModuleTypeName(rows.module_type)+':'" prop="change">
  16. <el-input v-model="rows.change" type="number"></el-input>
  17. </el-form-item>
  18. </template>
  19. </yun-form>
  20. </el-card>
  21. </template>
  22. <script>
  23. import form from "@components/Form.js";
  24. export default{
  25. components:{'YunForm':form},
  26. data:{
  27. rechargeColumn:[
  28. {field: 'user_id',title: __('会员ID'),edit:'hidden'},
  29. {field: 'nickname',title: __('充值会员'),edit:'readonly'},
  30. {field: 'module_type',title: __('充值类型'),edit:'radio',searchList:Yunqi.data.moduletype},
  31. {field: 'now',title: __('当前'),edit:'slot'},
  32. {field: 'recharge_type',title: __('充值方式'),edit:'radio',searchList: {add:'增加',minus:'减少',last:'最终'}},
  33. {field: 'change',title: __('变化'),edit:'slot',rules:'required;range(0~)'},
  34. {field: 'remark',title: __('备注'),edit:'textarea'}
  35. ],
  36. rechargeData:''
  37. },
  38. onLoad:function (){
  39. this.rechargeData={
  40. user_id:Yunqi.data.user.id,
  41. nickname:Yunqi.data.user.nickname,
  42. module_type:Object.keys(Yunqi.data.moduletype)[0],
  43. recharge_type:'add'
  44. };
  45. },
  46. methods: {
  47. getModuleTypeName:function (type){
  48. return Yunqi.data.moduletype[type];
  49. }
  50. }
  51. }
  52. </script>
  53. <style>
  54. </style>