Dynamic input parameter - data dictionary drop-down option

Author: KIMLIM

This article is about how to use a data dictionary to display different optional values ​​in different business scenarios , instead of building multiple data dictionaries, reducing the workload of management and maintenance.

 

[Case description] There is a process for applying for fixed assets. The subjects that can apply are cars and houses, so the application type refers to the data dictionary "application type", as shown in Figure 1 , and the effect is shown in Figure 2 .

 

Figure 1

 



 Figure
2

 

 

 

[Hopeful effect] The same fixed property application process is entered separately from the two menus "property application" and "vehicle application". It is hoped that after entering the menu of "property application", only "renting, buying a house" can be selected for the application type. After the corresponding "vehicle application" menu comes in, only "rent a car, buy a car" will appear. Figure 3 .

 

 Figure
3 : The drop-down "rent" and "buy" options appear in the property application

 

 



 Figure
4 : The drop-down “Rent a Car” and “Buy a Car” option appear in the vehicle application

 

  

[Implementation method] The contents of the above two menus in Figure 3 and Figure 4 are actually the contents of the same process view.

To achieve the desired effect, you need to make some dynamic input parameter settings for the "application type". The specific configuration steps are as follows:

 

1. The first is to build a data dictionary first, and make 'application type' a drop-down option. And identify ' vehicle ', ' house ' in the extension field .

 
 

2. Next, write in the dynamic input parameter of the menu.

 
 Figure
5 "Property Application" menu dynamic input parameters added {APPLY_TYPE: "house"}

 

In the same way, enter the parameter settings in the vehicle management menu.

 

 Figure 6 Dynamic input parameters of "Vehicle Application" menu are added {APPLY_TYPE: "vehicle"}

 

3. Finally, set the form in the start node, and set the dynamic input parameters for the "application type".

 
 Specific script:

def json = [type:'PPE_APPLY_APPLY_USE'];

if(vo!=null){

  json.condition = "and extra like '%${vo.APPLY_TYPE}%'".toString() ;

}else{

  json.condition = "and 1=2";

}

return fmt.formatJson(json);

 

OK , after saving, refresh the entire page and check the effect.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327033885&siteId=291194637