Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

对表格中的数据编辑表达式

脚本如下:

if(cell === null){ return "-"; }

if(rowData[0] === "品单价") {

        var rowsData = rows.data();

         if(rowsData[7][1]===null || rowsData[7][1]===0){

                return "-";

          }

return (rowsData[0][1]/rowsData[7][1]).toFixed(0);

}

if(rowData[0] === "折扣") {

          var rowsData = rows.data();

          if(rowsData[8][2]===null || rowsData[8][2]===0|| rowsData[8][1]===null || rowsData[8][1]===0){

                 return "-";

           }

        return (((rowsData[0][1]/rowsData[8][1])-(rowsData[0][2]/rowsData[8][2]))*100).toFixed(0)+"%";

}

return cell;

 

 

 

 

 

 

 

 

 

 

 

  • No labels