实现功能:点击查询按钮,显示相应数据,部分数据只读,部分数据可修改。
实现思路:首先通过点击按钮事件从接口获取内容,然后通过{
{}}显示在界面上。
查询按钮触发事件代码
searchQuery(){
var that=this
getAction(this.url.list,this.queryParam).then(res=>{
if(res.success){
if(res.result==null){
this.$confirm({
title:"新增资产",
content:"是否新增资产",
onOk: function(){
getAction("/business/checktaskitem/list2",that.queryParam).then(res1=>{
//从接口获取内容
that.form.setFieldsValue({
'code':res1.result.code})
that.form.setFieldsValue({
'name':res1.result.name})
that.form.setFieldsValue({
'subCategory':res1.result.subCategory})
that.form.setFieldsValue({
'unit':res1.result.unit})
that.form.setFieldsValue({
'unitPrice':res1.result.unitPrice})
that.form.