打印 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)
})