vue笔记

打印 console.log(msg)      

弹出输入框 prompt(info)   //prompt(‘输入内容’)

弹出警示框 alert(msg)  

表单去框写法:

 效果:

 批量删除:

<el-dialog title="检查报告" :visible.sync="dialogTableVisible">
  <el-button  size="mini" type="primary" @click="getaddreport()">新增</el-button>
  <el-button  size="mini" type="primary" @click=" handleDeletereport(row)">删除</el-button>
  <el-table :data="gridData"  v-loading="reportLoading" @selection-change="handleSelectionChange">
    <el-table-column type="selection" width="55"></el-table-column>
    <el-table-column property="intro" label="诊断详情"  
                      type="textarea" ></el-table-column>
    <el-table-column property="remark" label="备注"  type="textarea" ></el-table-column>
    <el-table-column property="time" label="报告时间"></el-table-column>
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
          size="mini"
          @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
        <el-button
          size="mini"
          type="danger"
          @click=" getdelreport(scope.row)">删除</el-button>
      </template>
    </el-table-column>

  </el-table>


handleDeletereport() {
  //console.log('13',row)
  if (this.reportList.length === 0) {
    this.$message.warning("请选择至少一条数据");
    return;
  }
  this.$confirm("确定将选择数据删除?", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning"
  })
    .then(() => {
      return removereport(this.reportList.map(m=>m.id).join());
    })
    .then(() => {
      this.getreport();
      this.$message({
        type: "success",
        message: "操作成功!"
      });
      this.$refs.crud.toggleSelection();
    });
},

handleSelectionChange(list) {
  this.reportList = list;
},

新增框中的选择框,获取内容:

{
  label: "导引师",
  prop: "guiderName",
  //editDisplay: false,
  type: 'tree',
  dicData: [],
  props:{
    label:'realName',
    value:'id'
  },
  rules: [{
    required: true,
    message: "请输入导引师id",
    trigger: "blur"
  }],
  span: 12,
},
created() {
 this.getdoctorlist();
},

methods: {

  getdoctorlist(){
    // this.query.size=999;
    // this.query.current=1;
    //  this.querydoctor.roleId='1531161215705829378';
    //  console.log('15',this.querydoctor)
    getList(1,999).then(res=>{

        this.doctorlist=res.data.data.records;
        this.doctorlist = this.doctorlist.filter(m=>m.roleId == "1531161215705829378")
        var tempData={};
        tempData = this.option.column.find(m=>m.prop == 'guiderName')
        tempData.dicData  =  this.doctorlist
         console.log('222', this.doctorlist)
    })

  },

$doget获取其他页面指定数据

//获取文件详情
getFileDetail(){
  console.log('this.$route.query.id',this.$route.query.id)
  this.$doGet(`/psmp/taskFile/info/${this.$route.query.id}`).then((res) => {
    console.log('文件详情', res) 
    this.fileData = res.data[0]
  });
},

过滤得到指定项:

 this.data = res.data.list.filter(m=>m.status == "0")

将数组转化成字符串,显示表中文字

 this.data.forEach(m => {
            m.riskLevel = String(m.riskLevel)
            m.riskType = String(m.riskType)
          })

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值