<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>
|