index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="down">
  6. <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView" @edit="toEdit"></data-table>
  7. </el-col>
  8. </el-col>
  9. </el-row>
  10. <el-dialog title="评分总结" width="40%" :visible.sync="sumDialog" @closed="handleClose" :destroy-on-close="true">
  11. <data-form :data="sumForm" :fields="sumfields" :rules="{}" @save="sumSave">
  12. <template #radios="{item}">
  13. <template v-if="item.model === 'status'">
  14. <!-- 因为不需要申请人线上证明缴费,所以跳过缴费等待步骤,直接进入会审步骤 -->
  15. <el-radio label="3">通过</el-radio>
  16. <el-radio label="-2">不通过</el-radio>
  17. </template>
  18. </template>
  19. </data-form>
  20. </el-dialog>
  21. </div>
  22. </template>
  23. <script>
  24. const _ = require('lodash');
  25. import dataForm from '@common/src/components/frame/form.vue';
  26. import dataTable from '@common/src/components/frame/filter-page-table.vue';
  27. import { mapState, createNamespacedHelpers } from 'vuex';
  28. const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
  29. const { mapActions: verifyRecord } = createNamespacedHelpers('verifyRecord');
  30. export default {
  31. metaInfo() {
  32. return { title: this.$route.meta.title };
  33. },
  34. name: 'index',
  35. props: {},
  36. components: {
  37. dataTable,
  38. dataForm,
  39. },
  40. data: function() {
  41. return {
  42. opera: [
  43. {
  44. label: '专家指派&评分查看',
  45. method: 'view',
  46. },
  47. {
  48. label: '评分总结',
  49. method: 'edit',
  50. },
  51. ],
  52. fields: [
  53. { label: '成果编号', prop: 'basic.achieve_num', filter: 'input', showTip: true },
  54. { label: '成果名称', prop: 'basic.achieve_name', showTip: true },
  55. { label: '成果类别', prop: 'basic.achieve_type', showTip: true },
  56. ],
  57. list: [],
  58. total: 0,
  59. // 会审总结
  60. sumDialog: false,
  61. sumForm: {},
  62. sumfields: [
  63. { label: '总结状态', model: 'status', type: 'radio' },
  64. { label: '总结意见', model: 'desc', type: 'textarea' },
  65. ],
  66. };
  67. },
  68. async created() {
  69. await this.search();
  70. },
  71. methods: {
  72. ...achieveApply(['query']),
  73. ...verifyRecord(['create']),
  74. // 查询列表
  75. async search({ skip = 0, limit = 10, ...info } = {}) {
  76. const res = await this.query({ skip, limit, ...info, status: '1' });
  77. if (this.$checkRes(res)) {
  78. this.$set(this, 'list', res.data);
  79. this.$set(this, `total`, res.total);
  80. }
  81. },
  82. // 专家评分查看
  83. toView({ data }) {
  84. this.$router.push({ path: '/adminScore/detail', query: { id: data.id } });
  85. },
  86. // 会审总结
  87. toEdit({ data }) {
  88. this.$set(this, 'sumForm', _.cloneDeep(data));
  89. this.sumDialog = true;
  90. },
  91. // 会审总结提交
  92. async sumSave({ data }) {
  93. let dup = _.pick(data, ['desc', 'status']);
  94. dup.apply_id = _.get(data, '_id');
  95. dup.verify = _.get(this.user, 'name');
  96. dup.verify_phone = _.get(this.user, 'phone');
  97. dup.verify_id = _.get(this.user, '_id');
  98. dup.step = '评分';
  99. const res = await this.create(dup);
  100. if (this.$checkRes(res, '审核成功', res.errmsg || '审核失败')) {
  101. this.handleClose();
  102. }
  103. },
  104. // 取消选择
  105. handleClose() {
  106. this.sumForm = {};
  107. this.sumDialog = false;
  108. this.search();
  109. },
  110. },
  111. computed: {
  112. ...mapState(['user']),
  113. },
  114. watch: {},
  115. };
  116. </script>
  117. <style lang="less" scoped></style>