details.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div>
  3. <el-dialog
  4. :title="exData.id ? '编辑': ''"
  5. :visible.sync="dialog"
  6. width="800px"
  7. :close-on-click-modal="false"
  8. top="50px">
  9. <el-form
  10. ref="form"
  11. :rules="formRules"
  12. :model="form"
  13. label-width="120px">
  14. <el-form-item
  15. label="审核:"
  16. prop="shop_status"
  17. :rules="formRules.select">
  18. <el-radio-group
  19. v-model="form.shop_status">
  20. <el-radio
  21. :label="item.value"
  22. v-for="item in reviewStatus"
  23. :key="item.value">{{ item.name }}
  24. </el-radio>
  25. </el-radio-group>
  26. </el-form-item>
  27. <el-form-item
  28. label="备注:"
  29. prop="shop_check_remark">
  30. <el-input
  31. type="textarea"
  32. :rows="6"
  33. placeholder="请输入备注"
  34. v-model="form.shop_check_remark"
  35. maxlength="1000"
  36. show-word-limit>
  37. </el-input>
  38. </el-form-item>
  39. </el-form>
  40. <div slot="footer" style="text-align: center">
  41. <el-button
  42. @click="dialog = false">取 消
  43. </el-button>
  44. <el-button
  45. type="primary"
  46. @click="handleSubmit"
  47. :disabled="booLock">保存
  48. </el-button>
  49. </div>
  50. </el-dialog>
  51. </div>
  52. </template>
  53. <script>
  54. export default {
  55. props: {
  56. value: {
  57. type: Boolean,
  58. default: true
  59. },
  60. exData: {
  61. type: Object,
  62. default: function () {
  63. return {}
  64. }
  65. }
  66. },
  67. data() {
  68. return {
  69. dialog: !!this.value,
  70. form: {
  71. // 'shop_id': 1, // 店铺ID
  72. 'shop_check_remark': '', // 审核备注
  73. 'shop_status': '1' // 状态(1通过2未通过)
  74. },
  75. booLock: false
  76. }
  77. },
  78. computed: {
  79. reviewStatus() {
  80. return [
  81. {
  82. name: '通过',
  83. value: '1'
  84. },
  85. {
  86. name: '拒绝',
  87. value: '2'
  88. }
  89. ]
  90. }
  91. },
  92. methods: {
  93. async handleSubmit() {
  94. this.$refs.form.validate(async valid => {
  95. if (valid) {
  96. this.booLock = true
  97. const data = await this.$fetch('/api/admin/shop/check', this.form)
  98. if (data.code === 200) {
  99. this.dialog = false
  100. this.$message('已审核')
  101. this.$emit('success')
  102. }
  103. this.booLock = false
  104. }
  105. })
  106. }
  107. },
  108. mounted() {
  109. if (this.exData.id) {
  110. this.$set(this.form, 'shop_id', this.exData.id)
  111. }
  112. },
  113. watch: {
  114. dialog(val) {
  115. if (!val) this.$emit('input', val)
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .hide-el-upload {
  122. ::v-deep .el-upload--picture-card {
  123. visibility: hidden;
  124. }
  125. }
  126. </style>