Your Name
2022-05-10 30e36368e54581fcc0c581a004f1f68873c1e819
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<template>
    <div>
        <div style="padding-bottom: 10px">
            <el-button type="primary" @click="addEquipment">添加设备</el-button>
        </div>
        <el-table :data="equipmentData" border fit highlight-current-row style="width: 100%;" :header-cell-style="{'text-align':'center'}">
            <el-table-column type="index" label="序号" align="center" width="60"/>
            <el-table-column prop="taskcode" label="作业编号" align="left">
            </el-table-column>
            <el-table-column prop="name" label="设备名称" align="left">
                <template slot-scope="scope">
                    <el-input v-model="scope.row.name"></el-input>
                </template>
            </el-table-column>
            <el-table-column prop="type" label="设备类型" align="left">
                <template slot-scope="scope">
                    <el-select v-model="scope.row.type">
                        <el-option
                        v-for="item in typeList"
                        :key="item.id"
                        :label="item.name"
                        :value="item.name"
                        >
                        </el-option>
                    </el-select>
                </template>
            </el-table-column>
            <el-table-column prop="num" label="设备数量" align="left">
                <template slot-scope="scope">
                    <el-input v-model="scope.row.num"></el-input>
                </template>
            </el-table-column>
            <el-table-column label="操作" align="center">
                <template slot-scope="scope">
                    <el-button type="text" @click="deleteEquipment(scope.$index)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div align="center" style="padding-top: 20px" v-if="title === '新增' || title === '编辑' || title=== '施工单位确认' || title === '施工单位信息填写' || title === '复制'">
            <el-button type="primary" @click="goNext">下一步</el-button>
        </div>
    </div>
</template>
 
<script>
import { getSafetyActionList } from '@/api/task'
 
export default {
    props:['basicInformation','title'],
    name: 'index',
    data(){
        return{
            typeList:[{id:1,name:'安全防护设备及工具'},{id:2,name:'安全施工防护用具'},{id:3,name:'有毒有害防护设备'},{id:4,name:'个人防护设备'},{id:5,name:'安全措施设备及工器具'}],
            equipmentData:[],
        }
    },
    created(){
    },
    methods:{
        addEquipment(){
            this.equipmentData.push({
                createdat: "",
                createdby: "",
                flag: 0,
                id: 0,
                modifiedat: "",
                modifiedby: "",
                name: "",
                num: "",
                taskcode: this.basicInformation.code,
            })
        },
        deleteEquipment(val){
            this.equipmentData.splice(val,1)
        },
        goNext(){
            if(this.title === '施工单位确认'){
                this.$emit('changeToConstructionConfirm')
            }else if(this.title === '施工单位信息填写'){
                this.$emit('confirmConstruction')
            }else {
                this.$emit('changeToCardFile')
            }
        },
    }
}
</script>
 
<style scoped>
 
</style>