examine.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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="frock" :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 { examineLoginFrock } from '@/api/frock'
  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() {
  43. const params = {
  44. ...this.formData,
  45. joinData : function () {
  46. this.joinAddress = (this.province || '') + (this.city || '') + (this.area || '') + (this.street || '') + (this.address || '')
  47. }
  48. }
  49. params.joinData()
  50. if (this.formData.files.length) {
  51. params.files = this.formData.files.map(k => {
  52. return {
  53. ...k,
  54. fileName: k.name,
  55. fileUrl: k.url
  56. }
  57. })
  58. }
  59. if (params.loginStatus === 'FAIL' && !params.projectNo) {
  60. this.$errorMsg('请填写项目编号')
  61. return
  62. }
  63. if (params.loginStatus === 'REJECT' && !params.examineNote) {
  64. this.$errorMsg('请填写审核备注')
  65. return
  66. }
  67. if (params.loginStatus === 'FAIL' && params.projectNo === params.successLoginProject) {
  68. this.$errorMsg('项目编号不能审核项目编号')
  69. return
  70. }
  71. examineLoginFrock(params).then(res => {
  72. this.commonFn('审核成功')
  73. })
  74. },
  75. commonFn(name) {
  76. this.$successMsg(name)
  77. this.handleBack()
  78. },
  79. handleBack() {
  80. this.$emit('updateList')
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .my-width ::v-deep .el-radio-button__inner {
  87. width: 100px;
  88. }
  89. </style>