apply-edit.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template id="apply-edit">
  2. <el-dialog :visible.sync="edit.visible" width="20%" title="区域代理审核" center>
  3. <div>
  4. <el-form @submit.native.prevent size="small" label-width="80px">
  5. <el-form-item label="审核状态" prop="check_status">
  6. <el-radio-group v-model="check_status">
  7. <el-radio :label="1">通过</el-radio>
  8. <el-radio :label="2">不通过</el-radio>
  9. </el-radio-group>
  10. </el-form-item>
  11. </el-form>
  12. <el-form @submit.native.prevent size="small" label-width="80px">
  13. <el-form-item label="备注" prop="marks">
  14. <el-input type="textarea"
  15. :rows="4"
  16. placeholder="备注"
  17. v-model="marks">
  18. </el-input>
  19. </el-form-item>
  20. </el-form>
  21. </div>
  22. <span slot="footer" class="dialog-footer">
  23. <el-button @click="edit.visible = false" type="default" size="small">取消</el-button>
  24. <el-button type="primary" :loading="edit.btnLoading" style="margin-bottom: 10px;" size="small"
  25. @click="editSave">保存</el-button>
  26. </span>
  27. </el-dialog>
  28. </template>
  29. <script>
  30. Vue.component('apply-edit', {
  31. template: '#apply-edit',
  32. props: {
  33. value: {
  34. type: Boolean,
  35. default: false,
  36. },
  37. row: {
  38. type: Object,
  39. default: null,
  40. },
  41. },
  42. data() {
  43. return {
  44. edit: {
  45. visible: false,
  46. keyword: '',
  47. nickname: '',
  48. id: '',
  49. btnLoading: false,
  50. },
  51. check_status:'',
  52. marks:'',
  53. user_id: 0,
  54. apply_id:0,
  55. district: [],
  56. address: null,
  57. town_list: [],
  58. province_id: 0,
  59. city_id: 0,
  60. district_id: 0,
  61. town_id: '',
  62. props: {
  63. value: 'id',
  64. label: 'name',
  65. children: 'list'
  66. },
  67. level: ''
  68. }
  69. },
  70. watch: {
  71. value() {
  72. if (this.value) {
  73. this.apply_id = this.row.id;
  74. console.log('this.row.id=='+this.row.id)
  75. this.edit.visible = true;
  76. }
  77. },
  78. 'edit.visible'() {
  79. if (!this.edit.visible) {
  80. this.editCancel();
  81. }
  82. }
  83. },
  84. created() {
  85. },
  86. methods: {
  87. editCancel() {
  88. console.log('触发了')
  89. this.$emit('input', false);
  90. },
  91. editSave() {
  92. if(!this.check_status){
  93. return this.$message.error('请选择是否通过审核!');
  94. }
  95. let url;
  96. request({
  97. params: {
  98. r: 'area/default/apply',
  99. },
  100. method: 'post',
  101. data:{
  102. id:this.apply_id,
  103. check_status:this.check_status,
  104. marks:this.marks
  105. }
  106. }).then(response => {
  107. this.edit.btnLoading = false;
  108. if (response.data.code == 0) {
  109. this.$message.success(response.data.msg);
  110. this.$emit('success')
  111. this.edit.visible = false;
  112. this.editCancel();
  113. } else {
  114. this.$message.error(response.data.msg);
  115. }
  116. }).catch(response => {
  117. this.edit.btnLoading = false;
  118. });
  119. },
  120. keyUp() {
  121. console.log('key up')
  122. }
  123. }
  124. });
  125. </script>