<template>
   <el-dialog title="添加量申报" append-to-body :modelValue="addQuantity" width="90%" @close="closeDialog" @open="open">
    <div style="display: flex;align-items: center;">
        <div style="display: flex;align-items: center; width: 80%;">
            <div style="width: 100%;">
                <span style="width: 33%;display: inline-block;">作业中心:{{ addForm.workCenter }}</span>
                <span style="width: 33%;display: inline-block;">需求订单:{{ addForm.requiredCode }}</span>
            </div>
        </div>
        <div><el-button type="primary">槽液检验提醒</el-button></div>
    </div>
    <div>
        <div style="display: flex;align-items: center; width: 80%;margin-top: 20px;">
            <div style="width: 100%;">
                <span style="width: 33%;display: inline-block;">金钾需求量(克):{{ addForm.goldRequired }}</span>
                <span style="width: 33%;display: inline-block;">金钾使用量(克):{{ addForm.goldUsageAmount }}</span>
                <span style="width: 33%;display: inline-block;">金钾剩余量(克):{{ addForm.goldDemandResidue }}</span>
            </div>
        </div>
    </div>
    <el-table :data="tableData" style="margin-top: 20px;">
        <el-table-column type="index" width="50"></el-table-column>
        <el-table-column label="作业槽" prop="slot" align="center"></el-table-column>
        <el-table-column label="检测项目" prop="testProject" align="center"></el-table-column>
        <el-table-column label="测量值" prop="testVal" align="center"></el-table-column>
        <el-table-column label="检验人" prop="testUser" align="center"></el-table-column>
        <el-table-column label="检测时间" prop="testTime" align="center"></el-table-column>
        <el-table-column label="申报金钾/银钾(克)" prop="addValue" align="center">
            <template #default="scope">
                <el-input-number v-model="scope.row.addValue" :min="1"></el-input-number>
            </template>
        </el-table-column>
        <el-table-column label="申报银板(克)" prop="value" align="center"></el-table-column>
        <el-table-column label="理论值" prop="actualVal" align="center"></el-table-column>
    </el-table>
    <template #footer>
        <span class="dialog-footer">
          <el-button @click="closeDialog">取 消</el-button>
          <el-button type="primary" @click="submit">确 定</el-button>
        </span>
      </template>
   </el-dialog>
</template>

<script>

export default {
    props:{
        addQuantity:{
            type: Boolean,
            default: false
        }
    },
    data(){
        return{
            addForm:{},
            tableData:[]
        }
    },
    mounted(){
        
    },
    methods:{
        open(){
            this.addForm = {
                workCenter:'镀金小批量作业中心',
                requiredCode:"XQ-220245431,XQ-22245431",
                goldRequired:'109.6',
                goldUsageAmount:'39.6',
                goldDemandResidue:'39.6'
            }
            this.tableData = [
                {slot:'#46 镀金',testVal:'3.1',actualVal:'XX',testProject:'氧化亚金钾',testUser:'张珊', value:'XX',testTime:'2023-12-22 07:15:22',addValue:''},
                {slot:'#47 镀金',testVal:'3.1',actualVal:'XX',testProject:'氧化亚金钾',testUser:'张珊', value:'XX',testTime:'2023-12-22 07:15:22',addValue:''},
                {slot:'#48 镀金',testVal:'3.1',actualVal:'XX',testProject:'氧化亚金钾',testUser:'张珊', value:'XX',testTime:'2023-12-22 07:15:22',addValue:''},
                {slot:'#49 镀金',testVal:'3.1',actualVal:'XX',testProject:'氧化亚金钾',testUser:'张珊', value:'XX',testTime:'2023-12-22 07:15:22',addValue:''},
            ]
        },
        closeDialog(){
            this.$emit('closeDialog');
        },
        submit(){
            this.closeDialog()
        }
    }
}
</script>

<style>

</style>