天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2305|回复: 10

[其他] sp8 计算脚本刷新有问题

[复制链接]
西北有色 发表于 2014-4-2 17:37:54 | 显示全部楼层 |阅读模式
本帖最后由 nice 于 2014-6-11 11:33 编辑

QQ截图20140402173327.png

视图列表里面有三个计算脚本(A.B.C),点击刷新,
A的值为C,点击保存A的值为A.

这是为什么呢?
punk 发表于 2014-4-2 18:36:57 | 显示全部楼层
您好~贴上值脚本看一下。
 楼主| 西北有色 发表于 2014-4-3 09:05:28 | 显示全部楼层
原价 脚本【
var total=0;// getItemValue("totalPrices");
var itype = getItemValue("PFRC_Type");
var h  = getItemValue("PC_jiagongfei");
println("total===="+itype);
if(itype.equals("001")){
var sql = "select top 1 * from tlk_GlodPriceClass order by item_CreateDate desc";
var d = findBySQL(sql);
var p = d.getItemValueAsString("GlodPrice");
var pcode  = getItemValue("pcode");

var sql2 = "select * from tlk_ProductClass where ITEM_PC_CODE='"+pcode+"'";
if(!pcode.equals("") && pcode!=null){
        var d1 = findBySQL(sql2);
var g = d1.getItemValueAsString("PC_weight");
       if(p!=0 &&  g!=0 && h!=0){

                total=g*h+g*p;//g*(h+p);
         }
}

}else if(itype.equals("002")){
        total=h;
}
println("total ="+total);
total;


中收款【
//原价中收;现价中收

var t = getItemValue("mtype");
var pttype = getItemValue("PFRC_PTRate");
var money1=0;
if(t.equals("原价中收")){

/**********************************/
var total= getItemValue("totalPrices");
var itype = getItemValue("PFRC_Type");
var h  = getItemValue("PC_jiagongfei");
if(itype.equals("001")){
var sql = "select top 1 * from tlk_GlodPriceClass order by item_CreateDate desc";
var d = findBySQL(sql);
var p = d.getItemValueAsString("GlodPrice");
var pcode  = getItemValue("pcode");

var sql2 = "select * from tlk_ProductClass where ITEM_PC_CODE='"+pcode+"'";
if(!pcode.equals("") && pcode!=null){
        var d1 = findBySQL(sql2);
var g = d1.getItemValueAsString("PC_weight");
       if(p!=0 &&  g!=0 && h!=0){
                total=g*h;//g*(h+p);
         }
}

}else if(itype.equals("002")){
        total=h;
}
money1 = total*pttype;
money1=money1/100;   

/**********************************/

}else if(t.equals("现价中收")){
          
        /******************************************/
        var total=0;
var itype = getItemValue("PFRC_Type");
var h  = getItemValue("PC_jiagongfei");
var downprice = getItemValue("downprice");
var zhekou  = getItemValue("zhekou");
var zktype  = getItemValue("zktype");
var tp= getItemValue("totalPrices");
if(itype.equals("001")){
var sql = "select top 1 * from tlk_GlodPriceClass order by item_CreateDate desc";
var d = findBySQL(sql);
var p = d.getItemValueAsString("GlodPrice");
var pcode  = getItemValue("pcode");
var sql2 = "select * from tlk_ProductClass where ITEM_PC_CODE='"+pcode+"'";

if(!pcode.equals("") && pcode!=null){
        var d1 = findBySQL(sql2);
var g = d1.getItemValueAsString("PC_weight");

total=g*h;
                    
}

}else if(itype.equals("002")){
         total=((h-downprice)*zhekou)/100;
}
//total.toFixed(2);

money1 = total*pttype;
money1=money1/100;

        /***********************************************/
       
}       

money1.toFixed(2);


现价【
var total=0;
var itype = getItemValue("PFRC_Type");
var h  = getItemValue("PC_jiagongfei");
var downprice = getItemValue("downprice");
var zhekou  = getItemValue("zhekou");
var zktype  = getItemValue("zktype");
var tp= getItemValue("totalPrices");
if(itype.equals("001")){
var sql = "select top 1 * from tlk_GlodPriceClass order by item_CreateDate desc";
var d = findBySQL(sql);
var p = d.getItemValueAsString("GlodPrice");
var pcode  = getItemValue("pcode");
var sql2 = "select * from tlk_ProductClass where ITEM_PC_CODE='"+pcode+"'";

if(!pcode.equals("") && pcode!=null){
        var d1 = findBySQL(sql2);
var g = d1.getItemValueAsString("PC_weight");

                     if(zktype.equals("先降后折")){
                           total=p*g+h*g-downprice;     //(((p+h)*g-downprice)*zhekou)/100;
                           total=total*zhekou;
                          total=total/100;
                     }else if(zktype.equals("先折后降")){
                           total=p*g+h*g;//(((p+h)*g)*zhekou)/100-downprice;
                          total=total*zhekou;
                          total=total/100;
                          total=total-downprice;
                    }
}

}else if(itype.equals("002")){
         if(zktype.equals("先降后折")){//
       
          var tp=getItemValue("PC_jiagongfei");

                  total=((tp-downprice)*zhekou)/100;
          }else if(zktype.equals("先折后降")){
                   var tp=getItemValue("PC_jiagongfei");
total=((tp*zhekou)/100-downprice);
          }
}
total.toFixed(2);
 楼主| 西北有色 发表于 2014-4-3 10:23:13 | 显示全部楼层
这个能不能远程看下?
punk 发表于 2014-4-3 13:58:50 | 显示全部楼层
远程我看一下吧,qq 2023469350
 楼主| 西北有色 发表于 2014-4-3 17:14:09 | 显示全部楼层
回复 5# punk


  你好 刚给我远程看的问题 是不是bug 。 定夺下吧。
 楼主| 西北有色 发表于 2014-4-4 09:16:39 | 显示全部楼层
回复 6# 西北有色


    你好 在吗  麻烦帮我看下这个问题  很着急 谢谢
 楼主| 西北有色 发表于 2014-4-4 14:05:03 | 显示全部楼层
回复 7# 西北有色


    有人在吗  帮忙看下这个帖子问题
punk 发表于 2014-4-4 14:10:27 | 显示全部楼层
这个问题,网格试图是做不到时时刷新的,如果你真的一定要这么做可以增加字段的形式,当你变化金额汇率的时候更新这些金额字段。
 楼主| 西北有色 发表于 2014-4-4 14:37:52 | 显示全部楼层
本帖最后由 西北有色 于 2014-4-4 14:43 编辑

回复 9# punk


    那这就是系统bug。
    有这个功能但不完善。
    你们能不能想办法解决下这个问题。

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-13 14:29

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表