index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :exportList="exportList"
  6. :columnParsing="columnParsing"
  7. :optionsEvensGroup="optionsEvensGroup"
  8. :tableAttributes="tableAttributes"
  9. :tableEvents="tableEvents"
  10. :operation="operation()"
  11. >
  12. <div class="cartographer_big">
  13. <el-dialog title="配置" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
  14. <zj-page-container v-if="formBool">
  15. <zj-page-fill>
  16. <zj-form-container
  17. ref="formRef"
  18. :form-data="formData"
  19. :form-rules="formRules"
  20. :form-attributes="{ size: 'mini' }"
  21. >
  22. <zj-form-module title="评价信息" :form-data="formData" :form-items="items" />
  23. <zj-form-module title="申诉信息" :form-data="formData" :form-items="items2" />
  24. <zj-form-module title="中心审核信息" :form-data="formData" :form-items="items3" />
  25. </zj-form-container>
  26. </zj-page-fill>
  27. <!-- 操作按钮 -->
  28. <div style="box-sizing: border-box; padding: 10px; text-align: right">
  29. <el-button size="mini" @click="handleClose">取 消</el-button>
  30. <el-button v-if="~[0, 1].indexOf(formType)" size="mini" @click="formConfirm" type="primary"
  31. >确 定</el-button
  32. >
  33. </div>
  34. </zj-page-container>
  35. </el-dialog>
  36. </div>
  37. </template-page>
  38. </template>
  39. <script>
  40. import TemplatePage from '@/components/template/template-page-1.vue'
  41. import import_mixin from '@/components/template/import_mixin.js'
  42. import {
  43. appraiseApplyApplyList,
  44. appraiseApplyApplyListExport,
  45. appraiseApplyApplyDetail,
  46. appraiseApplyApplySubmit,
  47. appraiseApplyApplyConfirm,
  48. appraiseApplyBatchUpdateEnd,
  49. appraiseApplyBatchUpdateReset
  50. } from '@/api/appraisalStatement'
  51. import operation_mixin from '@/components/template/operation_mixin.js'
  52. import { required, requiredValueMin } from '@/components/template/rules_verify.js'
  53. export default {
  54. components: { TemplatePage },
  55. mixins: [import_mixin, operation_mixin],
  56. data() {
  57. return {
  58. // 表格属性
  59. tableAttributes: {
  60. selectColumn: false
  61. },
  62. // 表格事件
  63. tableEvents: {
  64. 'selection-change': this.selectionChange
  65. },
  66. recordSelected: [],
  67. formBool: false,
  68. formType: 0,
  69. formData: {},
  70. formRules: {}
  71. }
  72. },
  73. computed: {
  74. optionsEvensGroup() {
  75. return [
  76. [
  77. [
  78. this.optionsEvensAuth('add', {
  79. click: () => {
  80. this.formType = 0
  81. this.formBool = true
  82. }
  83. })
  84. ]
  85. ]
  86. ]
  87. },
  88. items() {
  89. return []
  90. },
  91. items2() {
  92. return []
  93. },
  94. items3() {
  95. return []
  96. }
  97. },
  98. methods: {
  99. // 列表请求函数
  100. getList: appraiseApplyApplyList,
  101. // 导出
  102. exportList: appraiseApplyApplyListExport,
  103. // 表格列解析渲染数据更改
  104. columnParsing(item, defaultData) {
  105. return defaultData
  106. },
  107. // 获取勾选框数据
  108. selectionChange(data) {
  109. this.recordSelected = data
  110. },
  111. handleClose() {
  112. this.$refs?.pageRef?.refreshList()
  113. this.$data.formData = this.$options.data().formData
  114. this.formType = 0
  115. this.formBool = false
  116. },
  117. formConfirm() {
  118. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  119. if (valid) {
  120. appraiseApplyApplySubmit(this.formData).then(res => {
  121. this.$message({ type: 'success', message: '成功!' })
  122. this.$refs.pageRef.refreshList()
  123. this.handleClose()
  124. })
  125. }
  126. })
  127. },
  128. operation() {
  129. return this.operationBtn({
  130. edit: {
  131. click: ({ row, index, column }) => {
  132. appraiseApplyApplyDetail({
  133. id: row.id
  134. }).then(res => {
  135. this.formData = { ...res.data }
  136. this.$nextTick(() => {
  137. this.formType = 1
  138. this.formBool = true
  139. })
  140. })
  141. }
  142. }
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped></style>