123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <template>
- <el-dialog
- :modal="true"
- title="登录成功项目"
- :visible.sync="showDialog"
- width="70%"
- :show-close="false"
- :close-on-click-modal="false"
- :modal-append-to-body="false"
- :append-to-body="true"
- >
- <div v-if="showDialog" style="height: 60vh">
- <template-page
- ref="pageRefTable"
- :pofx="true"
- :get-list="getList"
- :column-parsing="columnParsing"
- :operation-column-width="200"
- :table-attributes="tableAttributes"
- :table-events="tableEvents"
- :replace-or-not-map="false"
- />
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button size="mini" @click="cancel">取 消</el-button>
- <el-button size="mini" type="primary" @click="confirm">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import TemplatePage from '@/components/template/template-page-1.vue'
- import { getLoginHomeDecorationList } from '@/api/homeDecoration'
- import { getLoginCrossDistrictList } from '@/api/crossDistrict'
- import { getLoginFrockList } from '@/api/frock'
- import { getLoginList } from '@/api/summaryTable'
- export default {
- components: { TemplatePage },
- mixins: [],
- props: {
- pageType: {
- type: String,
- required: true
- },
- showDialog: {
- type: Boolean,
- required: true
- },
- formData: {
- type: Object,
- default: () => ({})
- }
- },
- data() {
- return {
- // 表格属性
- tableAttributes: {
- // 启用勾选列
- selectColumn: true,
- selectable: this.selectable
- },
- // 表格事件
- tableEvents: {
- 'selection-change': this.selectionChange,
- select: (selection, row) => {
- this.$refs.pageRefTable.$refs.zjpage.$refs.tableEl.$refs.tableView.clearSelection()
- this.$refs.pageRefTable.$refs.zjpage.$refs.tableEl.$refs.tableView.toggleRowSelection(row)
- }
- },
- recordSelected: []
- }
- },
- computed: {},
- watch: {
- showDialog: {
- handler(nl, ol) {
- // console.log(this.pageType, this.formData, 9999)
- }
- }
- },
- created() {
- },
- methods: {
- selectable(row, index) {
- if (this.formData.id == row.id) {
- return false
- } else {
- return true
- }
- },
- // 表格列解析渲染数据更改
- columnParsing(item, defaultData) {
- return defaultData
- },
- // 监听勾选变化
- selectionChange(data) {
- this.recordSelected = data
- },
- getList(...p) {
- this.recordSelected = []
- if (['home', 'frock'].includes(this.pageType)) {
- p[0].params = [...p[0].params, { param: 'a.order_status', compare: '=', value: 'OK' }, {
- param: 'a.is_span',
- compare: '=',
- value: 0
- }]
- }
- if (this.pageType === 'cross') {
- return getLoginCrossDistrictList(...p)
- }
- return getLoginList(...p)
- },
- cancel() {
- this.$emit('cancel')
- },
- confirm() {
- this.$emit('success', this.recordSelected)
- this.cancel()
- }
- }
- }
- </script>
- <style scoped></style>
|