detail.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div id="detail">
  3. <el-form ref="form" label-width="150px">
  4. <el-row type="flex" justify="space-between" style="padding: 10px">
  5. <el-col :span="2">
  6. <el-button type="primary" size="mini" @click="toFlow">查看意见</el-button>
  7. </el-col>
  8. <el-col :span="2">
  9. <el-button type="primary" size="mini" @click="toBack">返回</el-button>
  10. </el-col>
  11. </el-row>
  12. <el-form-item label="企业名称">{{ data.name }}</el-form-item>
  13. <el-form-item label="资料">
  14. <template #label>
  15. <el-row>
  16. <el-col :span="24">资料</el-col>
  17. <el-col :span="24">(图片点击放大)</el-col>
  18. </el-row>
  19. </template>
  20. <el-row :gutter="10">
  21. <el-col :span="4" v-for="(i, index) in data.material" :key="`material-${index}`">
  22. <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
  23. <el-link v-else :key="`material-${index}`" type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
  24. </el-col>
  25. </el-row>
  26. </el-form-item>
  27. <template v-if="statusData !== '0' && statusData !== '1' && statusData !== '-1'">
  28. <el-form-item label="中介机构审核资料">
  29. <template #label>
  30. <el-row>
  31. <el-col :span="24">中介机构审核资料</el-col>
  32. <el-col :span="24">(图片点击放大)</el-col>
  33. </el-row>
  34. </template>
  35. <el-row :gutter="10">
  36. <el-col :span="4" v-for="(i, index) in data.medium_material" :key="`medium_material-${index}`">
  37. <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
  38. <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
  39. </el-col>
  40. </el-row>
  41. </el-form-item>
  42. <el-form-item label="合同" v-if="statusData !== '0' && statusData !== '1' && statusData !== '-1' && statusData !== '2' && statusData !== '-3'">
  43. <template #label>
  44. <el-row>
  45. <el-col :span="24">合同</el-col>
  46. <el-col :span="24">(图片点击放大)</el-col>
  47. </el-row>
  48. </template>
  49. <el-row :gutter="10">
  50. <el-col :span="4" v-for="(i, index) in data.contract" :key="`contract-${index}`">
  51. <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
  52. <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
  53. </el-col>
  54. </el-row>
  55. </el-form-item>
  56. </template>
  57. <el-form-item label="审核意见" v-if="statusData === '0' || statusData === '3'">
  58. <el-input v-model="form.desc" placeholder="请填写审核意见" type="textarea" :autosize="{ maxRows: 5, minRows: 3 }"></el-input>
  59. </el-form-item>
  60. <el-form-item label="审核" v-if="statusData === '0'">
  61. <el-radio-group v-model="form.status">
  62. <el-radio label="1">通过</el-radio>
  63. <el-radio label="-1">拒绝</el-radio>
  64. </el-radio-group>
  65. </el-form-item>
  66. <el-row type="flex" justify="space-around">
  67. <el-col :span="2">
  68. <el-button v-if="statusData === '0'" type="primary" @click="toStatus()" :disabled="!form.status">保存审核结果</el-button>
  69. <el-button v-if="statusData === '3'" type="primary" @click="toStatus('4')">确认</el-button>
  70. </el-col>
  71. </el-row>
  72. </el-form>
  73. <el-dialog title="意见" :visible.sync="dialog" :destroy-on-close="true">
  74. <flow :id="data._id"></flow>
  75. </el-dialog>
  76. </div>
  77. </template>
  78. <script>
  79. const _ = require('lodash');
  80. import flow from './flow.vue';
  81. import { mapState, createNamespacedHelpers } from 'vuex';
  82. const { mapActions: ticket } = createNamespacedHelpers('ticket');
  83. export default {
  84. name: 'detail',
  85. props: {},
  86. components: { flow },
  87. data: function () {
  88. return {
  89. data: {
  90. material: [],
  91. medium_material: [],
  92. contract: [],
  93. },
  94. imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
  95. form: {},
  96. dialog: false,
  97. };
  98. },
  99. created() {
  100. if (this.id) this.search();
  101. },
  102. methods: {
  103. ...ticket(['fetch', 'status']),
  104. async search() {
  105. const res = await this.fetch(this.id);
  106. if (this.$checkRes(res)) {
  107. this.$set(this, `data`, res.data);
  108. }
  109. },
  110. isImg(url) {
  111. const arr = url.split('.');
  112. const suffix = _.last(arr);
  113. return this.imgList.includes(suffix);
  114. },
  115. toOpen(url) {
  116. window.open(url);
  117. },
  118. async toStatus(status) {
  119. const dup = _.cloneDeep(this.form);
  120. dup.opera_id = this.user._id;
  121. dup.id = this.data._id;
  122. if (status) dup.status = status;
  123. const res = await this.status(dup);
  124. if (this.$checkRes(res, '审核成功', res.errmsg || '审核失败')) {
  125. this.toBack();
  126. }
  127. },
  128. toBack() {
  129. this.$router.push(`/adminCenter/ticket`);
  130. },
  131. toFlow() {
  132. this.dialog = true;
  133. },
  134. },
  135. computed: {
  136. ...mapState(['user', 'menuParams']),
  137. pageTitle() {
  138. return `${this.$route.meta.title}`;
  139. },
  140. statusData() {
  141. return this.$route.query.status;
  142. },
  143. id() {
  144. return this.$route.query.id;
  145. },
  146. },
  147. metaInfo() {
  148. return { title: this.$route.meta.title };
  149. },
  150. };
  151. </script>
  152. <style lang="less" scoped>
  153. /deep/.el-dialog__body {
  154. height: 500px;
  155. overflow-y: auto;
  156. }
  157. </style>