MrShi
2024-01-23 eb7addc7dfbed8674e3623d1562471c6d5a97c47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
    <GlobalWindow
            :title="title"
            :visible.sync="visible"
            :confirm-working="isWorking"
            @confirm="confirm"
    >
        <el-form :model="form" ref="form" :rules="rules">
            <el-form-item label="保险公司" prop="name">
                <el-input v-model="form.name" placeholder="平安保险" v-trim/>
            </el-form-item>
            <el-button type="primary" style="margin-bottom: 10px;">添加</el-button>
            <el-table
                :data="tableData"
                border
                style="width: 100%; margin-bottom: 20px;">
                <el-table-column
                    label="序号"
                    align="center"
                    width="80">
                    <template slot-scope="scope">
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                    align="center"
                    label="工种名称">
                    <template slot-scope="{row}">
                        <el-input v-model="row.name" placeholder="请输入" v-trim/>
                    </template>
                </el-table-column>
                <el-table-column
                    label="操作"
                    align="center"
                    width="100">
                    <template slot-scope="scope">
                        <el-button type="text" size="small" style="color: red;">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-form>
    </GlobalWindow>
</template>
 
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    export default {
        name: 'OperaInsuranceWindow',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
                // 表单数据
                form: {
                    id: null,
                    name: ''
                },
                // 验证规则
                rules: {
                },
                tableData: []
            }
        },
        created () {
            this.config({
                api: '/business/insurance',
                'field.id': 'id'
            })
        }
    }
</script>