chenrui
2025-02-26 7480271afcd5bbee7cc9829aa845d5679e4e239f
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
92
93
94
95
96
97
98
99
100
101
102
103
<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>