examine.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div>
  3. <el-radio-group v-model="current" size="mini">
  4. <el-radio-button class="my-width" label="detail">审核</el-radio-button>
  5. <el-radio-button class="my-width" label="record">操作记录</el-radio-button>
  6. </el-radio-group>
  7. <div v-show="current === 'detail'">
  8. <el-form disabled>
  9. <Base :form-data="formData" page-type="frock" :module="module" :common-data="commonData" />
  10. <Model :form-data="formData" page-type="frock" :module="module" :common-data="commonData" />
  11. </el-form>
  12. <Examine :form-data="formData" page-type="home" :module="module" :common-data="commonData" />
  13. <div style="margin: 20px 0">
  14. <el-button type="primary" size="small" @click="onSbumit">提交</el-button>
  15. <el-button size="small" @click="handleBack">返回</el-button>
  16. </div>
  17. </div>
  18. <OperationRecords v-show="current === 'record'" :detail-id="detailId" />
  19. </div>
  20. </template>
  21. <script>
  22. import Base from '../components/base.vue'
  23. import Model from '../components/model.vue'
  24. import Examine from '../components/examine.vue'
  25. import Mixin from '../mixin'
  26. import { examineLoginHomeDecoration } from '@/api/homeDecoration'
  27. import OperationRecords from '../components/operationRecords.vue'
  28. export default {
  29. components: {
  30. Base,
  31. Model,
  32. Examine,
  33. OperationRecords
  34. },
  35. mixins: [Mixin],
  36. data() {
  37. return {
  38. current: 'detail'
  39. }
  40. },
  41. methods: {
  42. onSbumit(type) {
  43. const params = {
  44. ...this.formData
  45. }
  46. if (this.formData.files.length) {
  47. params.files = this.formData.files.map(k => {
  48. return {
  49. ...k,
  50. fileName: k.name,
  51. fileUrl: k.url
  52. }
  53. })
  54. }
  55. if (params.loginStatus === 'FAIL' && !params.projectNo) {
  56. this.$errorMsg('请填写项目编号')
  57. return
  58. }
  59. if (params.loginStatus === 'REJECT' && !params.examineNote) {
  60. this.$errorMsg('请填写审核备注')
  61. return
  62. }
  63. if (params.loginStatus === 'FAIL' && params.projectNo === params.successLoginProject) {
  64. this.$errorMsg('项目编号不能审核项目编号')
  65. return
  66. }
  67. if (params.orderType === 'HOME' && params.homeProjectNameRadio) {
  68. params.projectName = {
  69. AREA:
  70. params.homeProjectNameArea +
  71. '小区' +
  72. params.homeProjectNameSeat +
  73. '座' +
  74. params.homeProjectNameNumber +
  75. '号',
  76. SELF: params.homeProjectNameArea2 + '(业主名称)自建房',
  77. VILLA: params.homeProjectNameArea3 + '小区' + params.homeProjectNameNumber3 + '号'
  78. }[params.homeProjectNameRadio]
  79. }
  80. if (params.homeProjectNameRadio === 'SELF') {
  81. params.homeProjectNameArea = params.homeProjectNameArea2
  82. }
  83. if (params.homeProjectNameRadio === 'VILLA') {
  84. params.homeProjectNameNumber = params.homeProjectNameNumber3
  85. params.homeProjectNameArea = params.homeProjectNameArea3
  86. }
  87. if (params.fileList.length) {
  88. params.drawUpload = params.fileList[0].url
  89. }
  90. examineLoginHomeDecoration(params).then(res => {
  91. this.commonFn('审核成功')
  92. })
  93. },
  94. commonFn(name) {
  95. this.$successMsg(name)
  96. this.$emit('updateList')
  97. },
  98. handleBack() {
  99. this.$emit('updateList')
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .my-width ::v-deep .el-radio-button__inner {
  106. width: 100px;
  107. }</style>