quoted-accredit.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <<template>
  2. <div>
  3. <div class="my-title">授权</div>
  4. <el-form
  5. :model="dataForm"
  6. :rules="dataRule"
  7. ref="dataForm"
  8. label-width="160px"
  9. >
  10. <el-row>
  11. <el-col :span="8">
  12. <el-form-item label="状态" prop="state">
  13. <el-select
  14. v-model="dataForm.state"
  15. placeholder="请选择"
  16. style="width: 100%"
  17. >
  18. <el-option
  19. v-for="item in stateOption"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value"
  23. >
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. </el-col>
  28. </el-row>
  29. <el-row>
  30. <el-col>
  31. <el-form-item label="授权情况" prop="accredit">
  32. <el-input v-model="dataForm.accredit" placeholder="请输入" type="textarea"></el-input>
  33. </el-form-item>
  34. </el-col>
  35. </el-row>
  36. </el-form>
  37. <span slot="footer" class="dialog-footer">
  38. <el-button @click="onChose">取消</el-button>
  39. <el-button type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
  40. </span>
  41. </div>
  42. </template>
  43. <script>
  44. export default {
  45. name: '',
  46. components: {},
  47. props: {},
  48. data () {
  49. return {
  50. stateOption: [
  51. { label: '通过', value: 1 },
  52. { label: '不通过', value: 2 }
  53. ],
  54. dataForm: {
  55. priceId: '',
  56. state: '',
  57. accredit: ''
  58. },
  59. dataRule: {
  60. state: [{required: true, message: '请选择', trigger: 'change'}]
  61. }
  62. }
  63. },
  64. watch: {},
  65. computed: {},
  66. created () {},
  67. mounted () {},
  68. activated () {},
  69. methods: {
  70. onChose () {
  71. this.$emit('onChose')
  72. },
  73. async init (id) {
  74. this.dataForm.priceId = id
  75. },
  76. dataFormSubmit () {
  77. this.$refs['dataForm'].validate((valid) => {
  78. if (valid) {
  79. this.$http({
  80. url: this.$http.adornUrl(`/biz-service/quoted/updateAccredit`),
  81. method: 'post',
  82. data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
  83. }).then(({ data }) => {
  84. if (data && data.code === '200') {
  85. this.$message({
  86. message: '操作成功',
  87. type: 'success',
  88. duration: 1500,
  89. onClose: () => {
  90. this.onChose()
  91. this.$emit('refreshDataList')
  92. }
  93. })
  94. } else {
  95. this.$message.error(data.msg)
  96. }
  97. })
  98. }
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped>
  105. </style>