<template>
|
<el-dialog :visible.sync="dialogVisible" title="标准物质验收记录" width="70%">
|
<el-steps :active="currentStep" finish-status="success">
|
<el-step class="cursor-pointer" v-for="(item, index) in steps" :key="index" :title="item">
|
</el-step>
|
</el-steps>
|
<el-form :model="model" label-width="140px" size="small">
|
<Step1 :model.sync="model"></Step1>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button type="primary" @click="submit">保 存</el-button>
|
</span>
|
</el-dialog>
|
</template>
|
|
<script>
|
import Step1 from './Step1.vue'
|
export default {
|
components: {
|
Step1
|
},
|
data() {
|
return {
|
dialogVisible: false,
|
currentStep: 0, // 步骤条显示第几步
|
steps: ['提交', '开箱验收复核', '安装验收检查', '安装验收复核', '验收核查', '验收核查审核'],
|
model: {
|
acceptance: {
|
id: undefined,
|
producer: undefined, // 厂家代表
|
file: undefined, // 相关附件
|
recipient: undefined, // 接收人
|
signature: undefined, // 接受签字
|
situation: undefined, // 验收情况
|
installation: undefined, // 安装调试情况
|
substanceId: undefined, // 清单
|
arriveDate: undefined, // 到货日期
|
maintenanceUnit: undefined, // 维修单位
|
},
|
list: []
|
}
|
}
|
},
|
watch: {
|
model(newVal) {
|
this.model = newVal
|
}
|
},
|
methods: {
|
clearForm() {
|
this.model.acceptance.id = undefined
|
this.model.acceptance.producer = undefined
|
this.model.acceptance.file = undefined
|
this.model.acceptance.recipient = undefined
|
this.model.acceptance.signature = undefined
|
this.model.acceptance.situation = undefined
|
this.model.acceptance.installation = undefined
|
this.model.acceptance.substanceId = undefined
|
this.model.acceptance.arriveDate = undefined
|
this.model.acceptance.maintenanceUnit = undefined
|
this.model.list = []
|
},
|
openDialog(form) {
|
console.log(form)
|
if(form) {
|
this.model.acceptance.id = form.acceptance.id
|
this.model.acceptance.producer = form.acceptance.producer
|
this.model.acceptance.file = form.acceptance.file
|
this.model.acceptance.recipient = form.acceptance.recipient
|
this.model.acceptance.signature = form.acceptance.signature
|
this.model.acceptance.situation = form.acceptance.situation
|
this.model.acceptance.installation = form.acceptance.installation
|
this.model.acceptance.substanceId = form.acceptance.substanceId
|
this.model.acceptance.arriveDate = form.acceptance.arriveDate
|
this.model.acceptance.maintenanceUnit = form.acceptance.maintenanceUnit
|
this.model.list = form.list
|
} else {
|
this.clearForm()
|
}
|
this.dialogVisible = true
|
},
|
closeDialog() {
|
this.dialogVisible = false
|
},
|
submit() {
|
if (!this.model.acceptance.substanceId) {
|
this.$message.warning('请选择清单')
|
return
|
}
|
this.$emit('submit', this.model)
|
this.closeDialog()
|
}
|
}
|
}
|
|
</script>
|
|
<style scoped>
|
.cursor-pointer {
|
cursor: pointer;
|
}
|
</style>
|