<template>
|
<el-dialog :title="title" :visible.sync="dialogVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="650px">
|
<el-form :model="dataForm" label-position="right" label-width="100px" style="margin-left:50px;width:600px;">
|
<el-row >
|
<el-col :span="20">
|
<el-form-item label="预约时间:" >
|
<el-date-picker
|
v-model="dataForm.appointment"
|
value-format="yyyy-MM-dd"
|
align="right"
|
type="date"
|
placeholder="选择日期"
|
:disabled="isView"
|
:picker-options="pickerOptions">
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
|
</el-row>
|
<el-row >
|
<el-col :span="10">
|
<el-form-item label="动火作业:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.fire" style="width: 100px" ></el-input-number>
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="受限空间:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.space" style="width: 100px"></el-input-number>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row >
|
<el-col :span="10">
|
<el-form-item label="吊装作业:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.hoisting" style="width: 100px"></el-input-number>
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="动土作业:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.soild" style="width: 100px"></el-input-number>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row >
|
<el-col :span="10">
|
<el-form-item label="断路作业:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.breaks" style="width: 100px"></el-input-number>
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="高处作业:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.high" style="width: 100px"></el-input-number>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row >
|
<el-col :span="10">
|
<el-form-item label="临时用电:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.electricity" style="width: 100px"></el-input-number>
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="盲板作业:" >
|
<el-input-number :controls="false" :disabled="isView" :min="0" v-model="dataForm.blindboard" style="width: 100px"></el-input-number>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
</el-form>
|
<div align="right" style="padding-right: 30px;margin-top: 10px;" v-if="!isView">
|
<el-button @click="dialogVisible=false">取消</el-button>
|
<el-button type="primary" @click="submit(title)" :disabled="isSending">确认</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
|
<script>
|
import {reserveAdd,reserveMod} from '../../../../api/workPlan'
|
|
export default {
|
name: 'index',
|
data() {
|
return {
|
appointment: '',
|
dialogVisible: false,
|
isSending: false,
|
title: '',
|
isView: '',
|
dataForm: {
|
id: '',
|
fire: '',
|
space: '',
|
hoisting: '',
|
soild: '',
|
breaks: '',
|
high: '',
|
electricity: '',
|
blindboard: '',
|
appointment: ''
|
|
},
|
pickerOptions: {
|
shortcuts: [
|
{
|
text: '明天',
|
onClick(picker) {
|
const date = new Date()
|
date.setTime(date.getTime() + 3600 * 1000 * 24)
|
picker.$emit('pick', date)
|
}
|
},
|
{
|
text: '后天',
|
onClick(picker) {
|
const date = new Date()
|
date.setTime(date.getTime() + 2 * 3600 * 1000 * 24)
|
picker.$emit('pick', date)
|
}
|
},
|
{
|
text: '大后天',
|
onClick(picker) {
|
const date = new Date()
|
date.setTime(date.getTime() + 3 * 3600 * 1000 * 24)
|
picker.$emit('pick', date)
|
}
|
}
|
|
]
|
}
|
|
}
|
},
|
methods: {
|
showAddDialog(title) {
|
this.title = title
|
this.isView = false
|
this.dialogVisible = true
|
},
|
showViewDialog(row, title) {
|
this.title = title
|
this.isView = true
|
this.dataForm.fire = row.fire
|
this.dataForm.space = row.space
|
this.dataForm.hoisting = row.hoisting
|
this.dataForm.soild = row.soild
|
this.dataForm.breaks = row.breaks
|
this.dataForm.high = row.high
|
this.dataForm.electricity = row.electricity
|
this.dataForm.blindboard = row.blindboard
|
this.dataForm.appointment = row.appointment
|
this.dialogVisible = true
|
|
},
|
showUpdateDialog(row, title) {
|
this.title = title
|
this.isView = false
|
this.dataForm.id = row.id
|
this.dataForm.fire = row.fire
|
this.dataForm.space = row.space
|
this.dataForm.hoisting = row.hoisting
|
this.dataForm.soild = row.soild
|
this.dataForm.breaks = row.breaks
|
this.dataForm.high = row.high
|
this.dataForm.electricity = row.electricity
|
this.dataForm.blindboard = row.blindboard
|
this.dataForm.appointment = row.appointment
|
this.dialogVisible = true
|
|
},
|
submit(title) {
|
if ('新增' === title)
|
this.post(reserveAdd)
|
if ('编辑' === title)
|
this.post(reserveMod)
|
},
|
|
post(func) {
|
this.isSending = true
|
func(this.dataForm)
|
.then(res => {
|
if (res.data.code === '200') {
|
this.dialogVisible = false
|
this.$emit('refresh')
|
this.$message({
|
message: '操作成功',
|
type: 'success'
|
})
|
} else {
|
this.$message({
|
message: res.data.message,
|
type: 'warning'
|
})
|
}
|
})
|
.finally(res => {
|
this.isSending = false
|
}
|
)
|
},
|
reset() {
|
this.dataForm = {
|
id: '',
|
fire: '',
|
space: '',
|
hoisting: '',
|
soild: '',
|
breaks: '',
|
high: '',
|
electricity: '',
|
blindboard: '',
|
appointment: ''
|
|
}
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
.basic_search{
|
display:inline-block;
|
padding-bottom: 10px;
|
}
|
</style>
|