VUE 根据字段名获取list中的数据

2020-08-06  本文已影响0人  各种萌新

<el-table-column

                            prop="5"

                            :label="sixthDay">

                            <template slot-scope="scope">

                                <el-popover trigger="hover" placement="top" >

                                <el-button size="mini" @click="handleScheduling(scope.row, scope.column, scope.$index)">排班</el-button>

                                <el-button size="mini" @click="handleStopa(scope.row, scope.column, scope.$index)">停诊</el-button>

                                <el-button size="mini" @click="handleReplace(scope.row, scope.column, scope.$index)">替诊</el-button>

                                <div v-if="scope.row.sts6== '1'" slot="reference" class="name-wrapper" style="display:flex;flex-direction: row;color:red">

                                    已停诊

                                </div>

                                <div v-else slot="reference" class="name-wrapper" style="display:flex;flex-direction: row">

                                    {{ scope.row.remain6 }}<div>/</div>{{ scope.row.quantity6 }}

                                </div>

                                </el-popover>

                            </template>

                        </el-table-column>

handleScheduling(row, column, $index){

            //获取停诊状态

            let sts = 'sts'+(parseInt(column.property)+1)

            let scheduleStatus = 'quantity'+(parseInt(column.property)+1)

            if(row[sts]==='1'){

                this.$message.error('已停诊')

            }else{

                if(row[scheduleStatus]){

                    this.$message.error('已设置排班医生')

                }else{

                    this.form.doctorId = row.doctorId;

                    this.form.deptId = row.deptId;

                    this.form.doctorName = row.doctorName;

                    this.form.visitDate = moment(this.weekDate[column.property]).format('YYYY-MM-DD')

                    let visitDate = moment(this.weekDate[column.property]).format('YYYYMMDD')

                    this.form.timeType = row.timeType;

                    if(row.timeType =="1"){

                        this.timeSelectOptions= {

                            start: '08:00',

                            step: '00:30',

                            end: '12:00'

                        }

                    }

                    if(row.timeType =="2"){

                        this.timeSelectOptions= {

                            start: '13:00',

                            step: '00:30',

                            end: '18:00'

                        }

                    }

                    this.getDoctorDataByDate(row.deptId,row.doctorId,visitDate,row.timeType);

                    this.schedueDialogVisible = true;

                }

            }

        },

方式有点笨 已经用加粗标注 凑乎看吧 

上一篇 下一篇

猜你喜欢

热点阅读