loginSuccess.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <el-dialog
  3. :modal="true"
  4. title="登录成功项目"
  5. :visible.sync="showDialog"
  6. width="70%"
  7. :show-close="false"
  8. :close-on-click-modal="false"
  9. :modal-append-to-body="false"
  10. :append-to-body="true"
  11. >
  12. <div v-if="showDialog" style="height: 60vh">
  13. <template-page
  14. ref="pageRefTable"
  15. :pofx="true"
  16. :get-list="getList"
  17. :column-parsing="columnParsing"
  18. :operation-column-width="200"
  19. :table-attributes="tableAttributes"
  20. :table-events="tableEvents"
  21. :replace-or-not-map="false"
  22. />
  23. </div>
  24. <div slot="footer" class="dialog-footer">
  25. <el-button size="mini" @click="cancel">取 消</el-button>
  26. <el-button size="mini" type="primary" @click="confirm">确 定</el-button>
  27. </div>
  28. </el-dialog>
  29. </template>
  30. <script>
  31. import TemplatePage from '@/components/template/template-page-1.vue'
  32. import { getLoginHomeDecorationList } from '@/api/homeDecoration'
  33. import { getLoginCrossDistrictList } from '@/api/crossDistrict'
  34. import { getLoginFrockList } from '@/api/frock'
  35. import { getLoginList } from '@/api/summaryTable'
  36. export default {
  37. components: { TemplatePage },
  38. mixins: [],
  39. props: {
  40. pageType: {
  41. type: String,
  42. required: true
  43. },
  44. showDialog: {
  45. type: Boolean,
  46. required: true
  47. },
  48. formData: {
  49. type: Object,
  50. default: () => ({})
  51. }
  52. },
  53. data() {
  54. return {
  55. // 表格属性
  56. tableAttributes: {
  57. // 启用勾选列
  58. selectColumn: true,
  59. selectable: this.selectable
  60. },
  61. // 表格事件
  62. tableEvents: {
  63. 'selection-change': this.selectionChange,
  64. select: (selection, row) => {
  65. this.$refs.pageRefTable.$refs.zjpage.$refs.tableEl.$refs.tableView.clearSelection()
  66. this.$refs.pageRefTable.$refs.zjpage.$refs.tableEl.$refs.tableView.toggleRowSelection(row)
  67. }
  68. },
  69. recordSelected: []
  70. }
  71. },
  72. computed: {},
  73. watch: {
  74. showDialog: {
  75. handler(nl, ol) {
  76. // console.log(this.pageType, this.formData, 9999)
  77. }
  78. }
  79. },
  80. created() {
  81. },
  82. methods: {
  83. selectable(row, index) {
  84. if (this.formData.id == row.id) {
  85. return false
  86. } else {
  87. return true
  88. }
  89. },
  90. // 表格列解析渲染数据更改
  91. columnParsing(item, defaultData) {
  92. return defaultData
  93. },
  94. // 监听勾选变化
  95. selectionChange(data) {
  96. this.recordSelected = data
  97. },
  98. getList(...p) {
  99. this.recordSelected = []
  100. if (['home', 'frock'].includes(this.pageType)) {
  101. p[0].params = [...p[0].params, { param: 'a.order_status', compare: '=', value: 'OK' }, {
  102. param: 'a.is_span',
  103. compare: '=',
  104. value: 0
  105. }]
  106. }
  107. if (this.pageType === 'cross') {
  108. return getLoginCrossDistrictList(...p)
  109. }
  110. return getLoginList(...p)
  111. },
  112. cancel() {
  113. this.$emit('cancel')
  114. },
  115. confirm() {
  116. this.$emit('success', this.recordSelected)
  117. this.cancel()
  118. }
  119. }
  120. }
  121. </script>
  122. <style scoped></style>