# app_template

id: 618464b6993236a4844f9f65
pid: 618464b6993236a4844f9f61
name: script
code: 618464b6993236a4844f9f65
namepath: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单
codepath: 618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61
fullname: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单/script
nodetype: column
createdate: 2021.11.05 06:54:47.000
lastmodifieddate: 2023.12.06 10:50:18.342
fullcode:
618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61.618464b6993236a4844f9f65


id: 618464b6993236a4844f9f66
pid: 618464b6993236a4844f9f61
name: description
code: 618464b6993236a4844f9f66
namepath: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单
codepath: 618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61
fullname: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单/description
nodetype: column
createdate: 2021.11.05 06:54:47.000
lastmodifieddate: 2023.12.06 10:50:18.342
fullcode:
618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61.618464b6993236a4844f9f66


id: 618464b6993236a4844f9f67
pid: 618464b6993236a4844f9f61
name: dbdescription
code: 618464b6993236a4844f9f67
namepath: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单
codepath: 618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61
fullname: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单/dbdescription
nodetype: column
createdate: 2021.11.05 06:54:47.000
lastmodifieddate: 2023.12.06 10:50:18.342
fullcode:
618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61.618464b6993236a4844f9f67


id: 618464b8993236a4844fa0b1
pid: 618464b6993236a4844f9f61
name: updatedisabledcolumns
code: 618464b8993236a4844fa0b1
namepath: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单
codepath: 618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61
fullname: /打印格式/影像调阅查询/凭证影像调阅/调阅申请单/updatedisabledcolumns
nodetype: column
value: []
createdate: 2021.11.05 06:54:49.000
lastmodifieddate: 2023.12.06 10:50:18.342
fullcode:
618464b6993236a4844f9f5e.618464b6993236a4844f9f5f.618464b6993236a4844f9f60.618464b6993236a4844f9f61.618464b8993236a4844fa0b1


id: 619a5454993208680e522973
pid: 60c4bd735db2478f9c5a1117
name: 凭证审核clone20211104075044clone20211121221444
code: 60c4bd735db2478f9c5a11182021110407504420211121221444
namepath: /凭证影像化/凭证审核
codepath: 60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
nodetype: leaf
createdate: 2021.06.12 22:00:47.000
lastmodifieddate: 2023.12.06 10:50:18.342
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444


id: 619a5454993208680e522977
pid: 619a5454993208680e522973
name: csp_script_src
code: 60c5615f5db2e8eff0d867f72021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/csp_script_src
nodetype: column
createdate: 2021.06.13 09:37:58.000
lastmodifieddate: 2023.12.06 10:50:18.342
codepath:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444

fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c5615f5db2e8eff0d867f72021110407504420211121221444


id: 619a5454993208680e52297b
pid: 619a5454993208680e522973
name: db
code: 60c4bd735db2478f9c5a111b2021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/db
nodetype: column
createdate: 2021.06.12 22:00:48.000
lastmodifieddate: 2023.12.06 10:50:18.342
codepath:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444

fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c4bd735db2478f9c5a111b2021110407504420211121221444

value:
[{"name":"dzpz_pz","label":"凭证","type":"query","dbpool":"default","description":"","multirow":true,"updatedtable":"dzpz_pz","sql":"select\n  a.corpid,\n  b.*,\n  c.id as img_id,\n  c.pz,\n  c.fj,\n  ifnull(c.pz, 0) + ifnull(c.fj, 0) as img_sl,\n  case when c.verifierid is not null then 1 else 0 end as is_verified\nfrom\n  pzdj a\n  inner join pzdjex b on a.gguid = b.gguid\n  left join dzpz_pz c on a.corpid = c.corpid\n  and b.pzh = c.pzh\norder by\n  a.corpid asc,\n  b.y asc,\n  b.m asc,\n  b.pzh asc","dynamicwhere":"","dynamicwhere2":"\"a.corpid='\"+ st_corpid+\"' \"\n\"b.y='\"+st_y+\"'\"\n\"b.m='\"+st_m+\"'\"\n\"b.code='\"+st_code+\"'\"\n\"b.pzh like '%\"+st_pzh+\"%'\"\niif( shzt==1, \" c.verifierid is not null\" , iif ( shzt==2, \"c.verifierid is null \", \"\"))\n\"b.\"+st_key1+\" like '%\"+st_value1+\"%'\"\n\"b.\"+st_key2+\" like '%\"+st_value2+\"%'\"\n\"b.pzrq >='\"+st_date1+\"'\"\n\"b.pzrq <'\"+date2yyyymmdd(nextDate(yyyymmdd2Date(st_date2),1))+\"'\"","dynamicwheredata2":"st_corpid:filter!st_corpid\nst_y:filter!st_y\nst_m:filter!st_m\nst_code:filter!st_code\nst_pzh:filter!st_pzh\nshzt:filter!shzt\nst_key1:filter!st_key1\nst_value1:filter!st_value1\nst_key2:filter!st_key2\nst_value2:filter!st_value2\nst_date1:date2yyyymmdd(filter!st_date1)\nst_date2:date2yyyymmdd(filter!st_date2)","primarykey":"id","autoretrieve":true,"table_query_id":"619a5454993208680e5229a1","column":[{"name":"kmdm","label":"科目代码","description":"","type":"varchar(50)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"zdr","label":"制单人","description":"","type":"varchar(30)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"ykzcmxmc","label":"预会支出明细名称","description":"","type":"varchar(100)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"ykzcmxdm","label":"预会支出明细编码","description":"","type":"varchar(50)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"y","label":"年度","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"rkdh","label":"入库单号","description":"","type":"varchar(50)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"pzrq","label":"凭证日期","description":"","type":"datetime","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"pzh","label":"凭证号","description":"","type":"varchar(20)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"pzdjex_corpid","label":"帐套ID","description":"","type":"varchar(10)","nullable":true,"smartretrieve":false,"updatable":"true","datamask":"","usedingroupby":"false","usedinsum":"false","defaultvalue":"","dbdefaultvalue":""},{"name":"pz","label":"凭证的图片数","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"posted","label":"是否已过账（是/否）","description":"","type":"varchar(4)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"m","label":"月份","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"lastmodifieddate","label":"数据最后修改日期","description":"","type":"datetime","nullable":true,"smartretrieve":false,"updatable":"true","datamask":"","usedingroupby":"false","usedinsum":"false","defaultvalue":"","dbdefaultvalue":""},{"name":"kmmc","label":"科目名称","description":"","type":"varchar(100)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"bz","label":"备注","description":"","type":"varchar(50)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"is_verified","label":"is_verified","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"inner_xh","label":"序号","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"img_sl","label":"影像数量","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"true","datamask":"","usedingroupby":"false","usedinsum":"false","defaultvalue":"","dbdefaultvalue":""},{"name":"img_id","label":"ID","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"id","label":"ID","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"gguid","label":"GGUID","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"fj","label":"附件的图片数","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"deleteflag","label":"删除标记","description":"","type":"int","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"corporationid","label":"帐套ID","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"corpid","label":"账套ID","description":"","type":"varchar(10)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"code","label":"核算账号编码","description":"","type":"varchar(20)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"ckzcmxmc","label":"财会支出明细名称","description":"","type":"varchar(100)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"ckzcmxdm","label":"财会支出明细编码","description":"","type":"varchar(50)","nullable":true,"smartretrieve":false,"updatable":"","datamask":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""}],"computer":[{"name":"c_xh","label":"","expression":"thisrow()+1","description":"","fillback":""}]}]


id: 619a5454993208680e52297f
pid: 619a5454993208680e522973
name: description
code: 60c4bd735db2478f9c5a111d2021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/description
nodetype: column
createdate: 2021.06.12 22:00:48.000
lastmodifieddate: 2023.12.06 10:50:18.343
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c4bd735db2478f9c5a111d2021110407504420211121221444


id: 619a5454993208680e522983
pid: 619a5454993208680e522973
name: functionGroup
code: 60c5615f5db2e8eff0d867f62021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/functionGroup
nodetype: column
createdate: 2021.06.13 09:37:58.000
lastmodifieddate: 2023.12.06 10:50:18.343
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c5615f5db2e8eff0d867f62021110407504420211121221444


id: 619a5454993208680e522987
pid: 619a5454993208680e522973
name: rightcheckpoint
code: 60c4bd735db2478f9c5a111a2021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/rightcheckpoint
nodetype: column
createdate: 2021.06.12 22:00:48.000
lastmodifieddate: 2023.12.06 10:50:18.343
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c4bd735db2478f9c5a111a2021110407504420211121221444

value:
{"b83a18372d1e0c552da51ecc990e916a":{"name":"filter","buttonClick":[{"name":"cb_retrieve","title":" 检索"}]}}


id: 619a5454993208680e52298b
pid: 619a5454993208680e522973
name: script
code: 60c4bd735db2478f9c5a111c2021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/script
nodetype: column
createdate: 2021.06.12 22:00:48.000
lastmodifieddate: 2023.12.06 10:50:18.343
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c4bd735db2478f9c5a111c2021110407504420211121221444

value:
var pzh_prefix;
var pzh_length;

var fullScreenDiv = null;



function formOpen() {
    book.showTabOnWhere = 'none';
    //加载帐套信息及年月
    var corpid = book.getWorkSheet("filter").cells("corpid").getValueString();
    runTask("当前记帐期", { corpid: corpid }, function (ym) {
        if (ym == null || ym == 'null') return;
        //得到年月后，获取凭证号相关设置
        pzh_len = getPZHLen(corpid);

        book.getWorkSheet("filter").cells("ym").setValue(ym);

        pzh_prefix = getPZHPrefix(corpid, ym);
        book.getWorkSheet("filter").cells("pzh_prefix").setValue(pzh_prefix);


    });

    // 追加一些CSS类 ，用于凭证号标记
    $(document.body).append(`<style>
                        .pzh {position:absolute;left:0;bottom:0px; 
                                height:24px; line-height:24px;width:100%; 
                                background-color:#40af40a0; 
                                color:white;font-weight:bold;font-size:12px;text-align:center;}
                        .delete_pzh { position:absolute; right:0; width:40px; height:14px; top:0; text-align:right; 
                                    vertical-align:top; font-size:12px; color:gray;padding-right:5px;}      
                        .delete_pzh:hover { color:white;}      
                          
                        </style>
                    `);


}



/**
 * 多行结果集当前焦点行发生变化
 * @param dsname  结果集名称
 * @param row  行号
 */
function currentBindRowChanged(dsname, row) {
    if (dsname == 'dzpz_pz') {
        //重新加载凭证图片列表

        let id = $dzpz_pz_ds.getString(row, "img_id");
        let pzh = $dzpz_pz_ds.getString(row, "pzh");
        loadPZ(pzh, id);

    }
}

/**
 * 单元格的值发生了改变
 * @param sheet  所在的工作表
 * @param cell  单元格对象
 * @param oldValue  原先的值
 * @param newValue 变化后的值
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行发生变化
 */
function cellValueChanged(sheet, cell, oldValue, newValue, innerRow) {

    //如果是绑定了数据库的，强烈不建议使用本事件，换用结果集变化事件 itemChanged

    //通过别名来判断
    if (cell.alias == 'ym') {
        var corpid = book.getWorkSheet("filter").cells("corpid").getValueString();
        var ym = book.getWorkSheet("filter").cells("ym").getValue();

        pzh_prefix = getPZHPrefix(corpid, ym);
        book.getWorkSheet("filter").cells("pzh_prefix").setValue(pzh_prefix);
    }




}

function loadPZ(pzh, id) {
    let data = getPZFJ(id); //得到凭证的所有图片
    let FJ = book.getWorkSheet("凭证详情").getBrick('FJ');
    FJ.buildGridly(data, function () {
        let shortPZH = pzh;//.substring(pzh_prefix.length);
        //加载图片完成后， 如果是凭证，那么加上凭证号信息
        for (let i = 0; i < data.length; i++) {
            if (data[i].groupname == '凭证') {
                setPZH(data[i].id, shortPZH, false);
            }
        }

    });
    book.getWorkSheet("凭证详情").yOffset = 0; //垂直卷滚条归位
}


//@comment (group=凭证号,caption=设置图片的凭证号,needRightControl=false)
function setPZH(id, pzh, needDeleteButton) {
    if (needDeleteButton == undefined) needDeleteButton = true
    find_pzh(id, true, needDeleteButton).find('.no').text(pzh);
}

//@comment (group=凭证号,caption=查找或创建凭证号标记对象,needRightControl=false)
function find_pzh(id, create_if_not_exists, needDeleteButton) {

    if (needDeleteButton == undefined) needDeleteButton = true;

    var d = $('#' + id);
    if (!d) {
        $.alert(id + "不存在");
        return null;
    }

    var ret = d.find('.pzh');
    if (ret.length == 0) {
        if (create_if_not_exists) //如果需要创建，则创建它
        {
            d.append(`<div class="pzh" >
                        <div class="no"></div>
                        <div class="delete_pzh"  ${needDeleteButton ? "" : " style='display:none' "} ><i class="fa fa-close" onclick="removePZH('${id}');  event.preventDefault(); event.stopPropagation();"> </i></div>
                      </div>`);
        }
        ret = d.find('.pzh');
    }
    return ret;

}



/**
 * 单元格单击事件
 * @param sheet
 * @param cell
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行被点击
 * @param event 事件对象
 */
//@comment (group=单元格事件,caption=单元格点击)
function cellOnClick(sheet, cell, innerRow, event) {

    //通过别名来判断
    if (cell.alias == 'XXX') {

    }

    //通过数据库绑定情况来判断
    let bind = cell.bind;
    if (bind != null && bind.dataSource == 'dzpz_pz') {

    }

}

//@comment (group=工具函数,caption=全选或取消全选)
function seletOrUnSelectAll() {
    //让selection单元格失去编辑焦点，不然再点击，它不会触发单元格的点击事件，因为此时点击的编辑框对象，不会触发单元格的点击
    book.getWorkSheet("list").View.forceCurrentEditControlGiveUpFocus();

    var v = book.getWorkSheet("list").cells('selection').getValueInt();

    book.getWorkSheet("list").paintPermit = false;
    $dzpz_pz_ds.setValueWithTrigger = false;
    for (var i = 0; i < $dzpz_pz_ds.rowCount; i++) {
        $dzpz_pz_ds.setValue(i, "selected", v);
    }
    $dzpz_pz_ds.setValueWithTrigger = true;
    book.getWorkSheet("list").paintPermit = true;
}





/**
 * 图片控件初始化完成
 * @param sheet   所在Sheet
 * @param config  图片控件的名称
 *@param data  该图片的详细信息
 *
 */
//@comment (group=图片控件,caption=图片控件初始化完成)
function imageGridlyInited(sheet, name, data) {


    if (name == "FJ") {
        
        let brick = sheet.getBrick(name);
        brick.addToolButton(1  //在从右往左数第2个工作栏位置添加一个工具按钮
            , "fa-print",   // 字符图标
            "打印图片",  // 鼠标悬停的提示信息
            "green", //按钮背景色
            function (id) {  //点击后的回调函数
                imagePrint(brick, id);

            }
        );


    }
}


function imagePrint(brick, id) {

    if ( ! isRoleGrantedToUser( currentUserId(), "凭证影像打印") ) 
    {
        toastr.error('抱歉，您无此权限');
        return;
    }

    //把数据中的图片替换，
    for (let i = 0; i < brick.data.length; i++) {
        if (brick.data[i].id == id) {
            //属性从新的属性中替换 
            let url = brick.data[i].url_img;
            printThisWindow(url);
            break;
        }
    }

}

function printThisWindow(imgSrc) {
    let iframe = document.createElement('IFRAME')
    let doc = null
    iframe.setAttribute('class', 'print-iframe')
    iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;')
    document.body.appendChild(iframe)
    doc = iframe.contentWindow.document
    // 取一个不重复的方法名称，可以随机字符串
    doc.___imageLoad___ = function () {
        iframe.contentWindow.print()
        if (navigator.userAgent.indexOf('MSIE') > 0) {
            document.body.removeChild(iframe)
        }
    }
    doc.write('<div style="height: 100%;width: 100%;">' + `<img src="${imgSrc}" style="max-height:100%;max-width: 100%;" onload="___imageLoad___()"/>` + '</div>')
    doc.close()
    iframe.contentWindow.focus()
}

/**
 * 图片控件中显示大图时添加水印图片
 * @param sheet   所在Sheet
 * @param name  图片控件的名称

 * @return  返回水印图片的url地址 ，如果返回  '' 则表示不添加水印图片
 */
//@comment (group=图片控件,caption=鼠标在某个图片上释放)
function imageOnPopupWithWatermark(sheet, name) {

    var info = currentUserShowName() + "" + formatDate(new Date(), "yyyy.MM.dd-HH:mm");

    return "watermark?watermark=" + info;

}


id: 619a5454993208680e522993
pid: 619a5454993208680e522973
name: ui
code: 60c4bd735db2478f9c5a11192021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/ui
nodetype: column
createdate: 2021.06.12 22:00:47.000
lastmodifieddate: 2023.12.06 10:50:18.343
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c4bd735db2478f9c5a11192021110407504420211121221444

value:
{"version":"1.0","sheetcount":4,"gui":true,"theme":"default","showTabOnBottom":false,"sheets":[{"index":0,"rowCount":13,"columnCount":11,"guid":"08e66c0e81c8327bad541d11a7b5751f","name":"main","gridLineVisible":false,"freezedRow":0,"freezedCol":0,"ignoreBeforeRowWhenPrinting":0,"forDevice":"all","rows":[{"index":0,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":1,"height":22,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":2,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":3,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":4,"height":100,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":5,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":6,"height":45,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":7,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":8,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":9,"height":138,"isColumnScrollEnabled":true,"stretchHeight":10},{"index":10,"height":33,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":11,"height":5,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":12,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0}],"columns":[{"index":0,"width":10,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":1,"width":3,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":2,"width":10,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":3,"width":600,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":4,"width":100,"width2":-1,"stretchWidth":80,"rowHeightAutoFit":false},{"index":5,"width":60,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":6,"width":100,"width2":-1,"stretchWidth":20,"rowHeightAutoFit":false},{"index":7,"width":60,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":8,"width":100,"width2":-1,"stretchWidth":20,"rowHeightAutoFit":false},{"index":9,"width":20,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":10,"width":10,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false}],"focusRange":[],"cells":[{"row":0,"col":0},{"row":0,"col":1},{"row":0,"col":2},{"row":0,"col":3},{"row":0,"col":4},{"row":0,"col":5},{"row":0,"col":6},{"row":0,"col":7},{"row":0,"col":8},{"row":0,"col":9},{"row":0,"col":10},{"row":1,"col":0},{"row":1,"col":1,"PI":0},{"row":1,"col":2,"define":"凭证影像查询 - 凭证资料库","rowSpan":1,"colSpan":3,"PI":1},{"row":1,"col":5},{"row":1,"col":6},{"row":1,"col":7},{"row":1,"col":8},{"row":1,"col":9},{"row":1,"col":10},{"row":3,"col":0,"PI":2},{"row":3,"col":1,"PI":2},{"row":3,"col":2,"PI":2},{"row":3,"col":3,"PI":2},{"row":3,"col":4,"PI":2},{"row":3,"col":5,"PI":2},{"row":3,"col":6,"PI":2},{"row":3,"col":7,"PI":2},{"row":3,"col":8,"PI":2},{"row":3,"col":9,"PI":2},{"row":3,"col":10,"PI":2},{"row":4,"col":0,"PI":2},{"row":4,"col":1,"PI":2},{"row":4,"col":2,"PI":2},{"row":4,"col":3,"rowSpan":1,"colSpan":6,"bricks":[{"type":"SheetContainer","name":"sheetContainer1","config":{"name":"sheetContainer1","sheetGUID":"b83a18372d1e0c552da51ecc990e916a","caption":"嵌入sheet","enable":true,"visible":true,"x":1,"y":1,"width":-1,"height":-1,"DOMName":"sheetContainer1-ac09ae11db92798fb2c35875b835acc9"},"x":1,"y":1,"width":-1,"height":-1}]},{"row":4,"col":9,"PI":3},{"row":4,"col":10,"PI":2},{"row":5,"col":0,"PI":2},{"row":5,"col":1,"PI":2},{"row":5,"col":2,"PI":2},{"row":5,"col":3,"PI":2},{"row":5,"col":4,"PI":2},{"row":5,"col":5,"PI":4},{"row":5,"col":6,"PI":4},{"row":5,"col":7,"PI":4},{"row":5,"col":8,"PI":4},{"row":5,"col":9,"PI":2},{"row":5,"col":10,"PI":4},{"row":6,"col":0,"PI":2},{"row":6,"col":1,"PI":2},{"row":6,"col":2,"PI":2},{"row":6,"col":3,"rowSpan":4,"colSpan":2,"PI":5,"bricks":[{"type":"SheetContainer","name":"sheetContainer1","config":{"name":"sheetContainer1","sheetGUID":"192dd2dd59913157df6b1620fb10e4b5","caption":"嵌入sheet","enable":true,"visible":true,"x":1,"y":1,"width":-1,"height":-1,"DOMName":"sheetContainer1-8d6246bfa534954576c43166719e33ad"},"x":1,"y":1,"width":-1,"height":-1}]},{"row":6,"col":5,"PI":6},{"row":6,"col":6,"cellValueType":3,"PI":7},{"row":6,"col":7,"PI":7},{"row":6,"col":8,"PI":8},{"row":6,"col":9,"PI":9},{"row":6,"col":10,"PI":10},{"row":7,"col":0,"PI":2},{"row":7,"col":1,"PI":2},{"row":7,"col":2,"PI":2},{"row":7,"col":5,"define":"凭证号：","PI":11},{"row":7,"col":6,"cellValueType":3,"rowSpan":1,"colSpan":3,"PI":12,"bind":{"dataSource":"dzpz_pz","DBCol":"pzh","dsType":"4"}},{"row":7,"col":9},{"row":7,"col":10,"PI":2},{"row":8,"col":0,"PI":2},{"row":8,"col":1,"PI":2},{"row":8,"col":2,"PI":2},{"row":8,"col":5,"define":"凭证：","PI":11},{"row":8,"col":6,"suffix":"张","cellValueType":1,"PI":13,"bind":{"dataSource":"dzpz_pz","DBCol":"pz","dsType":"4"}},{"row":8,"col":7,"define":"附件：","PI":11},{"row":8,"col":8,"suffix":"张","cellValueType":1,"PI":14,"bind":{"dataSource":"dzpz_pz","DBCol":"fj","dsType":"4"}},{"row":8,"col":9,"PI":5},{"row":8,"col":10,"PI":15},{"row":9,"col":0,"PI":2},{"row":9,"col":1,"PI":2},{"row":9,"col":2,"PI":2},{"row":9,"col":5,"rowSpan":2,"colSpan":4,"PI":16,"bricks":[{"type":"SheetContainer","name":"sheetContainer1","config":{"name":"sheetContainer1","sheetGUID":"beed53ada49f7fd9efab3a92ceec68b4","caption":"嵌入sheet","enable":true,"visible":true,"x":1,"y":1,"width":-1,"height":-1,"DOMName":"sheetContainer1-dddfcb82f42872a14256e95bb3b35a68"},"x":1,"y":1,"width":-1,"height":-1}]},{"row":9,"col":9,"PI":5},{"row":9,"col":10,"PI":17},{"row":10,"col":0,"PI":2},{"row":10,"col":1,"PI":2},{"row":10,"col":2,"PI":2},{"row":10,"col":3,"rowSpan":1,"colSpan":2,"bricks":[{"type":"dbpage","name":"dbnav","config":{"name":"dbnav","caption":"分页导航条","enable":true,"visible":true,"showDBRowCount":true,"x":1,"y":1,"width":-1,"height":-1,"align":"center","onceRetrieveRowCount":"100","countPerPagePermitToChange":true,"dsn":"dzpz_pz","DOMName":"dbnav-ec7169d9104c99e37d520445b46b3e4d","html":" \n                   <style>\n                   .workbook_db_tool_button {border-radius: 50%; min-width:24px; width:24px; height:24px; padding:0px;margin-right:5px;}\n                   .workbook_db_tool_noborder { border:0px solid #fff; background-color:transparent;}\n                   </style>     \n                   \n        \n                <div  class=\"   \"  id=\"dbnav-ec7169d9104c99e37d520445b46b3e4d\"  \n                       unselectable=\"on\" onselectstart=\"return false;\"\n                       style=\" padding:2px;min-width:24px; padding-right:8px;padding-left:8px;  text-align:center;\">\n                        \n                       <span class=\"group1\" style=\"display:none;\"><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page1 workbook_db_tool_button\" >1</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page2 workbook_db_tool_button\" >2</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page3 workbook_db_tool_button\" >3</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page4 workbook_db_tool_button\" >4</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page5 workbook_db_tool_button\" >5</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page6 workbook_db_tool_button\" >6</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page7 workbook_db_tool_button\" >7</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page8 workbook_db_tool_button\" >8</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page9 workbook_db_tool_button\" >9</button><button \n                       type=\"button\"   class=\"btn   btn-xs btn-default cb_page10 workbook_db_tool_button\" >10</button>\n                       </span><span class=\"group2\">\n                        <button type=\"button\"   class=\"btn   btn-xs btn-default cb_First workbook_db_tool_button\" >\n                        <i class=\"fa fa-step-backward\"></i></button><button type=\"button\"   \n                                class=\"btn   btn-xs btn-default cb_Prior workbook_db_tool_button\" >\n                        <i class=\"fa fa-chevron-left\"></i></button><button type=\"button\"   \n                                class=\"btn btn-alt btn-xs btn-default  workbook_db_tool_noborder \" ><span style=\"display:inline-block\">\n                        <input type=\"tel\"  class=\"pageIndex btn btn-alt btn-xs \" \n                               style=\"width:50px;height:24px; line-height:24px ; border-radius:12px; border:1px dotted #efefef;\"> /\n                        <span class=\"pageCountOfDataSource\"></span></button><button type=\"button\"   \n                                class=\"btn   btn-xs btn-default cb_Next workbook_db_tool_button\" >\n                        <i class=\"fa fa-chevron-right\"></i></button><button type=\"button\"   \n                                class=\"btn   btn-xs btn-default cb_Last workbook_db_tool_button\" >\n                        <i class=\"fa fa-step-forward\"></i></button></span><span \n                         unselectable=\"on\" onselectstart=\"return false;\" style=\"padding-left:10px; display:inline-block\"  \n                               class=\"countPerPageContainer\">每页<input type=\"tel\"   class=\"countPerPage btn btn-alt btn-default\"  \n                                value=\"100\" \n                                style=\"width:65px;height:24px; line-height:24px;border-radius: 12px; \"\n                                 \n                                >行</span>\n                        </span>\n                        <span class=\"dbRowCountContainer\" >&nbsp;&nbsp;共<span class=\"dbrowcount\"></span>行\n                </div>\n            \n            "},"x":0,"y":0,"width":0,"height":0}]},{"row":10,"col":9,"PI":3},{"row":10,"col":10,"PI":18},{"row":11,"col":0,"PI":2},{"row":11,"col":1,"PI":2},{"row":11,"col":2,"PI":2},{"row":11,"col":3},{"row":11,"col":4},{"row":11,"col":5},{"row":11,"col":6},{"row":11,"col":7},{"row":11,"col":8},{"row":11,"col":9},{"row":11,"col":10,"PI":2},{"row":12,"col":0,"PI":2},{"row":12,"col":1,"PI":2},{"row":12,"col":2,"PI":2},{"row":12,"col":3,"PI":2},{"row":12,"col":4,"PI":2},{"row":12,"col":5,"PI":2},{"row":12,"col":6,"PI":2},{"row":12,"col":7,"PI":2},{"row":12,"col":8,"PI":2},{"row":12,"col":9,"PI":2},{"row":12,"col":10,"PI":2}]},{"index":1,"rowCount":7,"columnCount":16,"guid":"b83a18372d1e0c552da51ecc990e916a","name":"filter","gridLineVisible":false,"freezedRow":0,"freezedCol":0,"ignoreBeforeRowWhenPrinting":0,"forDevice":"all","rows":[{"index":0,"height":5,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":1,"height":22,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":2,"height":5,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":3,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":4,"height":5,"isColumnScrollEnabled":true,"stretchHeight":10},{"index":5,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":6,"height":5,"isColumnScrollEnabled":true,"stretchHeight":10}],"columns":[{"index":0,"width":10,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":1,"width":70,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":2,"width":95,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":3,"width":95,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":4,"width":45,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":5,"width":55,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":6,"width":95,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":7,"width":87,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":8,"width":120,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":9,"width":100,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":10,"width":10,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":11,"width":89,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":12,"width":100,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":13,"width":70,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":14,"width":100,"width2":-1,"stretchWidth":20,"rowHeightAutoFit":false},{"index":15,"width":1,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false}],"focusRange":[],"cells":[{"row":0,"col":0},{"row":0,"col":1},{"row":0,"col":2},{"row":0,"col":3},{"row":0,"col":4},{"row":0,"col":5},{"row":0,"col":6},{"row":0,"col":7},{"row":0,"col":8},{"row":0,"col":9},{"row":0,"col":10},{"row":0,"col":11},{"row":0,"col":12},{"row":0,"col":13},{"row":0,"col":14},{"row":0,"col":15},{"row":1,"col":0},{"row":1,"col":1,"define":"筛选条件","PI":19},{"row":1,"col":2},{"row":1,"col":3},{"row":1,"col":4},{"row":1,"col":5},{"row":1,"col":6},{"row":1,"col":7},{"row":1,"col":8},{"row":1,"col":9},{"row":1,"col":10},{"row":1,"col":11},{"row":1,"col":12},{"row":1,"col":13},{"row":1,"col":14,"PI":20},{"row":1,"col":15},{"row":2,"col":0},{"row":2,"col":1},{"row":2,"col":2},{"row":2,"col":3},{"row":2,"col":4},{"row":2,"col":5},{"row":2,"col":6},{"row":2,"col":7},{"row":2,"col":8},{"row":2,"col":9},{"row":2,"col":10},{"row":2,"col":11},{"row":2,"col":12},{"row":2,"col":13},{"row":2,"col":14},{"row":2,"col":15},{"row":3,"col":0,"PI":5},{"row":3,"col":1,"define":"* 帐  套：","PI":21},{"row":3,"col":2,"define":"00","editable":true,"rowSpan":1,"colSpan":2,"alias":"st_corpid","PI":22,"editstyle":{"editType":4,"ddlbName":"basic_账套列表(code2name)-全称","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"","showRealData":false,"columnCount":null}},{"row":3,"col":4,"define":"年度：","PI":23},{"row":3,"col":5,"editable":true,"appData":{"valueChangedToAutoCompleteType":"sql","valueChangedToAutoCompleteDBPool":"default","valueChangedToAutoCompleteQuery":"select distinct y\nfrom(\nselect distinct y from pzdjex \nunion\nselect distinct left(ym,4) as y from dzpz_pz\n) x\norder by y","valueChangedToAutoCompleteContext":"","valueChangedToAutoCompleteMaxCount":"20","valueChangedToAutoCompleteMinLen":"0","valueChangedToAutoCompleteCopyMap":"","valueChangedToAutoCompleteRender":"","valueChangedToAutoCompleteQuery_encrypted":"V2RICT7EAMKYZF4LUWOIWKJ2WPQTOYNHN2JM655OUKAU7ZADCWGJPC5FTSFSSOVTLQ4SLNZ5JGR7GQQJHDDFVCXYODNLMBTOSDQEM6DXZKTO2QXBCL3FLM4ZQ7DFMRNEP5CPN3IQHUTFO7MRNO5NBHREGMI4G6PNJQDO7F3AEDWMUVP6W4C2KWUPXWLOV5PI5YSRY6CXAC7XY"},"cellValueType":3,"alias":"st_y","PI":13},{"row":3,"col":6,"define":"code","cellValueType":3,"PI":24,"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"code;核算单位编号：\npzh;凭证号：\nkmdm;会计科目代码：\nkmmc;会计科目名称：\nckzcmxdm;财会支出明细编码：\nckzcmxmc;财会支出明细名称：\nykzcmxdm;预会支出明细编码：\nykzcmxmc;预会支出明细名称：\nrkdh;入库单号：\nbz;摘要：\nzdr;凭证制单人：","showRealData":false,"columnCount":null}},{"row":3,"col":7,"editable":true,"appData":{"valueChangedToAutoCompleteType":"url","valueChangedToAutoCompleteMaxCount":"20","valueChangedToAutoCompleteMinLen":"0","valueChangedToAutoCompleteCopyMap":"","valueChangedToAutoCompleteRender":"","valueChangedToAutoCompleteQuery_encrypted":"V2RICT7EAMKYZF4LUWOIWKJ2WOMSXW4LTEGETLP242NIAOTXT6OGGWWA6L7STCQ5JOZR2MBQ3LBC6PZIWMPXZ255KM","valueChangedToAutoCompleteURL":"","valueChangedToAutoCompleteResultFunc":"","valueChangedToAutoCompleteParam":""},"cellValueType":3,"alias":"st_code","PI":22,"editstyle":{"editType":0,"inputAttribute":""}},{"row":3,"col":8,"define":"kmmc","editable":true,"cursorName":"hand","alias":"st_key1","PI":25,"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"code;核算单位编号：\npzh;凭证号：\nkmdm;会计科目代码：\nkmmc;会计科目名称：\nckzcmxdm;财会支出明细编码：\nckzcmxmc;财会支出明细名称：\nykzcmxdm;预会支出明细编码：\nykzcmxmc;预会支出明细名称：\nrkdh;入库单号：\nbz;摘要：\nzdr;凭证制单人：","showRealData":false,"columnCount":null}},{"row":3,"col":9,"editable":true,"appData":{"valueChangedToAutoCompleteType":"url","valueChangedToAutoCompleteMaxCount":"20","valueChangedToAutoCompleteMinLen":"0","valueChangedToAutoCompleteCopyMap":"","valueChangedToAutoCompleteRender":"","valueChangedToAutoCompleteQuery_encrypted":"V2RICT7EAMKYZF4LUWOIWKJ2WOMSXW4LTEGETLP242NIAOTXT6OGGWWA6L7STCQ5JOZR2MBQ3LBC6PZIWMPXZ255KM","valueChangedToAutoCompleteURL":"","valueChangedToAutoCompleteResultFunc":"","valueChangedToAutoCompleteParam":""},"alias":"st_value1","PI":22,"editstyle":{"editType":0,"inputAttribute":""}},{"row":3,"col":10},{"row":3,"col":11,"define":"3","editable":true,"cellValueType":3,"rowSpan":3,"colSpan":1,"alias":"shzt","PI":26,"editstyle":{"editType":6,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"3;全部\n1;已校对\n2;未校对","showRealData":false,"columnCount":1}},{"row":3,"col":12},{"row":3,"col":13,"bricks":[{"type":"button","name":"cb_retrieve","config":{"name":"cb_retrieve","caption":" 检索","enable":true,"visible":true,"size":"1","x":5,"y":-30,"width":60,"height":30,"buttonStyle":"default","buttonColorStyle":"info","leftIcon":"fa-search","rightIcon":"","action":"retrieve","dsn":"dzpz_pz","moreDataSource":"","cachefirst":true,"DOMName":"cb_retrieve-8f16198dee2921889e053b64657b74cf","html":" \n                <button class=\"btn  btn-info btn-xs\" \n                        id=\"cb_retrieve-8f16198dee2921889e053b64657b74cf\">\n                       <i class='fa fa-search'></i> 检索\n                </button>\n                "},"x":5,"y":-30,"width":60,"height":30}]},{"row":3,"col":14},{"row":3,"col":15,"PI":20},{"row":4,"col":0,"PI":27},{"row":4,"col":1,"PI":3},{"row":4,"col":2,"PI":28},{"row":4,"col":3,"PI":29},{"row":4,"col":4},{"row":4,"col":5},{"row":4,"col":6},{"row":4,"col":7},{"row":4,"col":8,"PI":30},{"row":4,"col":9,"PI":3},{"row":4,"col":10},{"row":4,"col":12},{"row":4,"col":13},{"row":4,"col":14},{"row":4,"col":15,"PI":3},{"row":5,"col":0,"PI":31},{"row":5,"col":1,"define":"凭证日期：","PI":32},{"row":5,"col":2,"editable":true,"cellValueType":4,"alias":"st_date1","PI":22,"editstyle":{"editType":3,"datetimeFormat":"yyyy.MM.dd"}},{"row":5,"col":3,"editable":true,"cellValueType":4,"alias":"st_date2","PI":22,"editstyle":{"editType":3,"datetimeFormat":"yyyy.MM.dd"}},{"row":5,"col":4,"define":"月份：","cellValueType":3,"PI":33},{"row":5,"col":5,"editable":true,"cellValueType":3,"alias":"st_m","PI":13,"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13","showRealData":false,"columnCount":null}},{"row":5,"col":6,"define":"凭 证 号：","cellValueType":3,"PI":24,"editstyle":{"editType":0,"inputAttribute":""}},{"row":5,"col":7,"editable":true,"appData":{"valueChangedToAutoCompleteType":"url","valueChangedToAutoCompleteMaxCount":"20","valueChangedToAutoCompleteMinLen":"0","valueChangedToAutoCompleteCopyMap":"","valueChangedToAutoCompleteRender":"","valueChangedToAutoCompleteQuery_encrypted":"V2RICT7EAMKYZF4LUWOIWKJ2WOMSXW4LTEGETLP242NIAOTXT6OGGWWA6L7STCQ5JOZR2MBQ3LBC6PZIWMPXZ255KM","valueChangedToAutoCompleteURL":"","valueChangedToAutoCompleteResultFunc":"","valueChangedToAutoCompleteParam":""},"cellValueType":3,"alias":"st_pzh","PI":22,"editstyle":{"editType":0,"inputAttribute":""}},{"row":5,"col":8,"define":"zdr","editable":true,"cursorName":"hand","cellValueType":3,"alias":"st_key2","PI":25,"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"code;核算单位编号：\npzh;凭证号：\nkmdm;会计科目代码：\nkmmc;会计科目名称：\nckzcmxdm;财会支出明细编码：\nckzcmxmc;财会支出明细名称：\nykzcmxdm;预会支出明细编码：\nykzcmxmc;预会支出明细名称：\nrkdh;入库单号：\nbz;摘要：\nzdr;凭证制单人：","showRealData":false,"columnCount":null}},{"row":5,"col":9,"editable":true,"appData":{"valueChangedToAutoCompleteType":"url","valueChangedToAutoCompleteMaxCount":"20","valueChangedToAutoCompleteMinLen":"0","valueChangedToAutoCompleteCopyMap":"","valueChangedToAutoCompleteRender":"","valueChangedToAutoCompleteQuery_encrypted":"V2RICT7EAMKYZF4LUWOIWKJ2WOMSXW4LTEGETLP242NIAOTXT6OGGWWA6L7STCQ5JOZR2MBQ3LBC6PZIWMPXZ255KM","valueChangedToAutoCompleteURL":"","valueChangedToAutoCompleteResultFunc":"","valueChangedToAutoCompleteParam":""},"cellValueType":3,"alias":"st_value2","PI":22,"editstyle":{"editType":0,"inputAttribute":""}},{"row":5,"col":10},{"row":5,"col":12},{"row":5,"col":13},{"row":5,"col":14},{"row":5,"col":15,"PI":3},{"row":6,"col":0,"PI":30},{"row":6,"col":1,"PI":30},{"row":6,"col":2},{"row":6,"col":3},{"row":6,"col":4},{"row":6,"col":5},{"row":6,"col":6},{"row":6,"col":7},{"row":6,"col":8},{"row":6,"col":9},{"row":6,"col":10},{"row":6,"col":11},{"row":6,"col":12},{"row":6,"col":13},{"row":6,"col":14},{"row":6,"col":15,"PI":3}]},{"index":2,"rowCount":8,"columnCount":18,"guid":"192dd2dd59913157df6b1620fb10e4b5","name":"list","gridLineVisible":false,"freezedRow":5,"freezedCol":0,"ignoreBeforeRowWhenPrinting":0,"forDevice":"all","rows":[{"index":0,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":1,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":2,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":3,"height":20,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":4,"height":20,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":5,"height":30,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":6,"height":27,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":7,"height":5,"isColumnScrollEnabled":true,"stretchHeight":0}],"columns":[{"index":0,"width":10,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":1,"width":3,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":2,"width":40,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":3,"width":100,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":4,"width":69,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":5,"width":80,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":6,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":7,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":8,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":9,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":10,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":11,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":12,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":13,"width":85,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":14,"width":60,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":15,"width":45,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":16,"width":45,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":17,"width":20,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false}],"focusRange":[],"cells":[{"row":1,"col":0},{"row":1,"col":1,"PI":34},{"row":1,"col":2,"define":"数据列表","rowSpan":1,"colSpan":2,"PI":19},{"row":1,"col":4},{"row":1,"col":5},{"row":1,"col":6},{"row":1,"col":7},{"row":1,"col":8},{"row":1,"col":9},{"row":1,"col":10},{"row":1,"col":11},{"row":1,"col":12},{"row":1,"col":13},{"row":1,"col":14},{"row":1,"col":15},{"row":1,"col":16},{"row":1,"col":17},{"row":2,"col":0},{"row":2,"col":1},{"row":2,"col":2,"PI":29},{"row":2,"col":3,"PI":29},{"row":2,"col":4,"PI":29},{"row":2,"col":5,"PI":29},{"row":2,"col":6,"PI":29},{"row":2,"col":7,"PI":29},{"row":2,"col":8,"PI":29},{"row":2,"col":9,"PI":29},{"row":2,"col":10,"PI":29},{"row":2,"col":11,"PI":29},{"row":2,"col":12,"PI":29},{"row":2,"col":13,"PI":29},{"row":2,"col":14,"PI":29},{"row":2,"col":15,"PI":29},{"row":2,"col":16,"PI":29},{"row":2,"col":17},{"row":3,"col":0},{"row":3,"col":1,"PI":35},{"row":3,"col":2,"define":"序号","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":3,"define":"账套","dblClickSort":"dzpz_pz.corpid","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":4,"define":"凭证日期","dblClickSort":"dzpz_pz.pzrq","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":5,"define":"凭证号","dblClickSort":"dzpz_pz.pzh","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":6,"define":"会计科目名称","dblClickSort":"dzpz_pz.kmmc","rowSpan":2,"colSpan":1,"PI":37},{"row":3,"col":7,"define":"财会支出\\n明细编码","dblClickSort":"dzpz_pz.ckzcmxdm","rowSpan":2,"colSpan":1,"PI":37},{"row":3,"col":8,"define":"财会支出\\n明细名称","dblClickSort":"dzpz_pz.ckzcmxmc","rowSpan":2,"colSpan":1,"PI":37},{"row":3,"col":9,"define":"预会支出\\n明细编码","dblClickSort":"dzpz_pz.ckzcmxdm","rowSpan":2,"colSpan":1,"PI":37},{"row":3,"col":10,"define":"预会支出\\n明细名称","dblClickSort":"dzpz_pz.ykzcmxmc","rowSpan":2,"colSpan":1,"PI":37},{"row":3,"col":11,"define":"核算账号编号","dblClickSort":"dzpz_pz.code","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":12,"define":"入库单号","dblClickSort":"dzpz_pz.rkdh","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":13,"define":"摘要","dblClickSort":"dzpz_pz.bz","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":14,"define":"凭证制单","dblClickSort":"dzpz_pz.zdr","rowSpan":2,"colSpan":1,"PI":36},{"row":3,"col":15,"define":"影像\\n数量","dblClickSort":"dzpz_pz.img_sl","rowSpan":2,"colSpan":1,"PI":38},{"row":3,"col":16,"define":"状态","rowSpan":2,"colSpan":1,"PI":38},{"row":3,"col":17,"rowSpan":2,"colSpan":1,"PI":39},{"row":4,"col":0},{"row":4,"col":1,"PI":35},{"row":5,"col":0},{"row":5,"col":1,"PI":35},{"row":5,"col":2,"PI":40,"bind":{"dataSource":"dzpz_pz","DBCol":"c_xh","dsType":2},"editstyle":{"editType":1,"showComma":false,"decimalCount":0,"zeroVisible":true}},{"row":5,"col":3,"cellValueType":3,"PI":41,"bind":{"dataSource":"dzpz_pz","DBCol":"corpid","dsType":2},"editstyle":{"editType":4,"ddlbName":"basic_账套列表(code2name)-简称","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"","showRealData":false,"columnCount":null}},{"row":5,"col":4,"cellValueType":4,"PI":40,"bind":{"dataSource":"dzpz_pz","DBCol":"pzrq","dsType":2},"editstyle":{"editType":3,"datetimeFormat":"yyyy.MM.dd"}},{"row":5,"col":5,"cellValueType":3,"alias":"pzh","PI":40,"bind":{"dataSource":"dzpz_pz","DBCol":"pzh","dsType":2}},{"row":5,"col":6,"cellValueType":3,"PI":40,"bind":{"dataSource":"dzpz_pz","DBCol":"kmmc","dsType":2}},{"row":5,"col":7,"cellValueType":3,"PI":22,"bind":{"dataSource":"dzpz_pz","DBCol":"ckzcmxdm","dsType":2}},{"row":5,"col":8,"cellValueType":3,"PI":22,"bind":{"dataSource":"dzpz_pz","DBCol":"ckzcmxmc","dsType":2}},{"row":5,"col":9,"cellValueType":3,"PI":22,"bind":{"dataSource":"dzpz_pz","DBCol":"ykzcmxdm","dsType":2}},{"row":5,"col":10,"cellValueType":3,"PI":22,"bind":{"dataSource":"dzpz_pz","DBCol":"ykzcmxmc","dsType":2}},{"row":5,"col":11,"cellValueType":3,"PI":40,"bind":{"dataSource":"dzpz_pz","DBCol":"code","dsType":2}},{"row":5,"col":12,"cellValueType":3,"alias":"入库单号","PI":40,"bind":{"dataSource":"dzpz_pz","DBCol":"rkdh","dsType":2}},{"row":5,"col":13,"popoverContent":"=bz ","cellValueType":3,"alias":"bz","PI":42,"bind":{"dataSource":"dzpz_pz","DBCol":"bz","dsType":2}},{"row":5,"col":14,"cellValueType":3,"PI":40,"bind":{"dataSource":"dzpz_pz","DBCol":"zdr","dsType":2}},{"row":5,"col":15,"cellValueType":1,"alias":"img","PI":43,"bind":{"dataSource":"dzpz_pz","DBCol":"img_sl","dsType":2},"editstyle":{"editType":1,"showComma":false,"decimalCount":0,"zeroVisible":false}},{"row":5,"col":16,"cellValueType":1,"alias":"is","PI":43,"bind":{"dataSource":"dzpz_pz","DBCol":"is_verified","dsType":2},"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbFilterContext":"","ddlbInnerItems":"1;已校对\n0;","showRealData":false,"columnCount":null}},{"row":5,"col":17,"PI":39},{"row":6,"col":0},{"row":6,"col":1,"PI":35},{"row":6,"col":2,"define":"合计","PI":44},{"row":6,"col":3,"rowSpan":1,"colSpan":12,"PI":45},{"row":6,"col":15,"define":"=sum(attachmentcount)","PI":44},{"row":6,"col":16,"PI":44},{"row":6,"col":17,"PI":39},{"row":7,"col":0},{"row":7,"col":1},{"row":7,"col":2,"PI":46},{"row":7,"col":3,"PI":46},{"row":7,"col":4,"PI":46},{"row":7,"col":5,"PI":46},{"row":7,"col":6,"PI":46},{"row":7,"col":7,"PI":46},{"row":7,"col":8,"PI":46},{"row":7,"col":9,"PI":46},{"row":7,"col":10,"PI":46},{"row":7,"col":11,"PI":46},{"row":7,"col":12,"PI":46},{"row":7,"col":13,"PI":46},{"row":7,"col":14,"PI":46},{"row":7,"col":15,"PI":46},{"row":7,"col":16,"PI":46},{"row":7,"col":17}]},{"index":3,"rowCount":2,"columnCount":2,"guid":"beed53ada49f7fd9efab3a92ceec68b4","name":"凭证详情","gridLineVisible":false,"freezedRow":0,"freezedCol":0,"ignoreBeforeRowWhenPrinting":0,"forDevice":"all","rows":[{"index":0,"height":286,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":1,"height":10,"isColumnScrollEnabled":true,"stretchHeight":0}],"columns":[{"index":0,"width":300,"width2":-1,"stretchWidth":10,"rowHeightAutoFit":false},{"index":1,"width":10,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false}],"focusRange":[],"cells":[{"row":0,"col":0,"PI":47,"bricks":[{"type":"uploadImage","name":"FJ","config":{"name":"FJ","action":"view","serverIndex":"1","serverIndexExpression":"=currentBillServerIndex()","dbpool":"default","logTable":"app_fileupload","blockSize":256,"imgMaxSize":1920,"cropWidth":0,"cropHeight":0,"columns":1,"maxCount":5,"groupName":"附件","tableName":"--","gguid":"--","path":"=currentMasterTableName()","showImageLabel":false,"showImageIndexNo":true,"autoLoad":false,"autoLoadFunction":"-","caption":"图片上传","enable":true,"visible":true,"x":1,"y":1,"width":-1,"height":-1,"DOMName":"FJ-121ff04018243b9f7c7affc1cd1c16f6","gutter":10,"homeURL":"","maxThumbnailSize":256,"rightMouseDownToViewLargeImage":true,"html":"<div><div id='FJ-121ff04018243b9f7c7affc1cd1c16f67eb49824bc861a6c18ce956477585972' style='width:100%;height:100%;background-color: transparent; pointer-events:none; '></div></div>"},"x":1,"y":1,"width":-1,"height":-1}]},{"row":0,"col":1,"PI":9},{"row":1,"col":0,"PI":30},{"row":1,"col":1,"PI":5}]}],"propertyCache":{"b3f11927403750ad41af93752148e509":{"background-color":"rgb(40, 116, 166)"},"854bc2c21bbbb631ed9056ba9ef218db":{"font-family":"黑体","font-size":"16"},"3e824c86b66344de0d8b546937f4cbf2":{"background-color":"#ebedef"},"99914b932bd37a50b983c5e7c90ae93b":{},"be64caef07159566df8795b22e17d845":{"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"background-color":"#ebedef"},"d40439625fae1006a802f59daeb608c1":{"border-right-width":2,"border-right-color":[128,128,128,1]},"9e88079a54ad188cac6846f15c2fc42d":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-color":[128,128,128,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1]},"7207fd81a5f61d7975bce68c6cd3d6d9":{"border-left-color":[128,128,128,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-color":[128,128,128,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1]},"c6b833700f21dfb69360b9d75ad8c619":{"border-left-color":[128,128,128,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-width":2,"border-right-color":[128,128,128,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1]},"7f973ca9852913d1d137e4bafe0bf62c":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-right-width":2,"border-right-color":[128,128,128,1]},"a6827ea44c8f901a1e03738c37b4bd1b":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-width":2,"border-right-color":[128,128,128,1],"border-bottom-color":[128,128,128,1],"background-color":"#ebedef"},"ee5723836a4b5b5bf5ee0b0cfc22918c":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12","text-align":1},"f59dcabe69ca3218ba0d1a06ddfbb4b3":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12","color":"rgb(33, 97, 140)"},"b3de616a54b5cf0c276e9db14a7998b2":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12","color":"rgb(33, 97, 140)","text-align":2},"c849c7ff626b2927d73c2ccc724a4cca":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12","color":"rgb(40, 116, 166)","text-align":2},"324e25b70f30a3a35e0a91a80b8e8b64":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-top-color":[128,128,128,1],"border-right-width":2,"border-right-color":[128,128,128,1],"border-bottom-color":[128,128,128,1],"background-color":"#ebedef"},"e4fcb63c7108732c010118148924f1ca":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"0404736ef7e731007c1bf60e4236a94c":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-top-color":[128,128,128,1],"border-right-width":2,"border-right-color":[128,128,128,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"background-color":"#ebedef"},"12c8f64b3cd0683238278aac5a38a662":{"border-top-width":2,"border-top-color":[128,128,128,1],"background-color":"#ebedef"},"d9b7e78fd60149a6ba819365564c46b8":{"font-family":"黑体"},"3749828a2f4e560e94e519058d334bd0":{"border-left-width":2,"border-left-color":[128,128,128,1]},"e337025cbd00a114725be81004634326":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"font-size":"12","text-align":1},"1662c5b4a5db1a205a4a9d704d38634d":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12"},"3d443b00663becf58198a5d1a8509b21":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"font-size":"12","text-align":1},"6901bda958b911e1d166c4a311a4d37a":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"font-size":"12","color":"rgb(40, 55, 71)","text-align":1},"7c0b0dea59fb82c6e269af27ba0d57ee":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"font-size":"12","color":"rgb(40, 116, 166)","text-align":2},"f5bcc2c64e56d4e94c28b17de4ebd3c8":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"padding-left":"10","font-size":"12","text-align":0},"3736221b6320a5ed99534cefdf10ef9b":{"border-bottom-width":2,"border-bottom-color":[128,128,128,1]},"0f4ec947c6784488bfe73f5041225ff8":{"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"125018f3eef635c9d10037c06e4a0236":{"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"5e4df84994cee3dc53009c98b95703cf":{"border-top-width":2,"border-top-color":[128,128,128,1]},"3c7d0af7ca5f205a2cb63cda86ace448":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-width":2,"border-right-color":[128,128,128,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1]},"51db118cef6079848f7fb8625f08a6eb":{"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"font-size":"12","text-align":1},"48c15333cdfb8c2ede62c6ee26cdecdd":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"font-size":"12","text-align":1},"c2ccd111c68253e305603e4b64d48d28":{"background-color":"rgb(46, 134, 193)"},"47a00a41624c6383ac8392dd4e2d2817":{"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1]},"83bb42f26e5bef7d1f678b741e88f6dc":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(242, 244, 244)","font-size":"12","text-align":2},"52ce3267a685d0e7c589310d756638ca":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(242, 244, 244)","font-size":"12","word-wrap":true,"text-align":2},"6379cd717d5fbb30e9bbcd91ede106d4":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"#f2f4f4","font-size":"12","word-wrap":true,"text-align":2},"20118c09fa9c7e8fb2753e163d4f4c03":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1]},"0067d6ecee987d1282b3c4d5f421b3c0":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12","text-align":2},"5d784b6ccfe3fa37bff715c149b76091":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12","word-wrap":true,"text-align":0},"cddf7f2b2aed4bf2b43057fac1fa6a02":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-size":"12","text-align":2,"word-wrap":true},"b39c6f133af40e52c7ebe4cdac23bbaf":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"font-family":"黑体","font-size":"12","text-align":2},"4b765f7d7f0c811540c20716a8c3372c":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(248, 249, 249)","font-size":"12","text-align":2},"b89c51077dea7a231cf8f1bef67f22ad":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(248, 249, 249)"},"fc406aa51250ead084dba7e6ed9e7117":{"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1]},"806fea0805342d08ba024387ba473468":{"border-left-width":2,"border-left-color":[128,128,128,1],"border-top-width":2,"border-top-color":[128,128,128,1],"border-right-width":2,"border-right-color":[128,128,128,1],"border-bottom-width":2,"border-bottom-color":[128,128,128,1],"text-align":2}},"propertyIdList":["b3f11927403750ad41af93752148e509","854bc2c21bbbb631ed9056ba9ef218db","3e824c86b66344de0d8b546937f4cbf2","99914b932bd37a50b983c5e7c90ae93b","be64caef07159566df8795b22e17d845","d40439625fae1006a802f59daeb608c1","9e88079a54ad188cac6846f15c2fc42d","7207fd81a5f61d7975bce68c6cd3d6d9","c6b833700f21dfb69360b9d75ad8c619","7f973ca9852913d1d137e4bafe0bf62c","a6827ea44c8f901a1e03738c37b4bd1b","ee5723836a4b5b5bf5ee0b0cfc22918c","f59dcabe69ca3218ba0d1a06ddfbb4b3","b3de616a54b5cf0c276e9db14a7998b2","c849c7ff626b2927d73c2ccc724a4cca","324e25b70f30a3a35e0a91a80b8e8b64","e4fcb63c7108732c010118148924f1ca","0404736ef7e731007c1bf60e4236a94c","12c8f64b3cd0683238278aac5a38a662","d9b7e78fd60149a6ba819365564c46b8","3749828a2f4e560e94e519058d334bd0","e337025cbd00a114725be81004634326","1662c5b4a5db1a205a4a9d704d38634d","3d443b00663becf58198a5d1a8509b21","6901bda958b911e1d166c4a311a4d37a","7c0b0dea59fb82c6e269af27ba0d57ee","f5bcc2c64e56d4e94c28b17de4ebd3c8","3736221b6320a5ed99534cefdf10ef9b","0f4ec947c6784488bfe73f5041225ff8","125018f3eef635c9d10037c06e4a0236","5e4df84994cee3dc53009c98b95703cf","3c7d0af7ca5f205a2cb63cda86ace448","51db118cef6079848f7fb8625f08a6eb","48c15333cdfb8c2ede62c6ee26cdecdd","c2ccd111c68253e305603e4b64d48d28","47a00a41624c6383ac8392dd4e2d2817","83bb42f26e5bef7d1f678b741e88f6dc","52ce3267a685d0e7c589310d756638ca","6379cd717d5fbb30e9bbcd91ede106d4","20118c09fa9c7e8fb2753e163d4f4c03","0067d6ecee987d1282b3c4d5f421b3c0","5d784b6ccfe3fa37bff715c149b76091","cddf7f2b2aed4bf2b43057fac1fa6a02","b39c6f133af40e52c7ebe4cdac23bbaf","4b765f7d7f0c811540c20716a8c3372c","b89c51077dea7a231cf8f1bef67f22ad","fc406aa51250ead084dba7e6ed9e7117","806fea0805342d08ba024387ba473468"]}


id: 619a5454993208680e522997
pid: 619a5454993208680e522973
name: uniqueindexinfo
code: 60c5615f5db2e8eff0d867f52021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/uniqueindexinfo
nodetype: column
createdate: 2021.06.13 09:37:57.000
lastmodifieddate: 2023.12.06 10:50:18.707
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c5615f5db2e8eff0d867f52021110407504420211121221444


id: 619a5454993208680e52299b
pid: 619a5454993208680e522973
name: updatedisabledcolumns
code: 60c5615f5db2e8eff0d867e32021110407504420211121221444
namepath: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444
fullname: /凭证影像化/凭证审核/凭证审核clone20211104075044clone20211121221444/updatedisabledcolumns
nodetype: column
value: []
createdate: 2021.06.13 09:37:40.000
lastmodifieddate: 2023.12.06 10:50:18.707
fullcode:
60c4bd735db2478f9c5a1116.60c4bd735db2478f9c5a1117.60c4bd735db2478f9c5a11182021110407504420211121221444.60c5615f5db2e8eff0d867e32021110407504420211121221444


id: 62a069f1993272a2d678c9f8
pid: 60c4bd735db2478f9c5a1118
name: pagesetup-192dd2dd59913157df6b1620fb10e4b5
nodetype: column
createdate: 2022.06.08 17:20:49.000
lastmodifieddate: 2023.12.06 10:50:18.707
value:
{"pageWidth":"210","pageHeight":"297","leftMargin":"20","topMargin":"20","rightMargin":"20","bottomMargin":"20","paper":"210*297","printDir":1,"pageHeaderConfig":{"define":"","height":"20"},"pageFooterConfig":{"define":"=\"第 \"+pageIndex()+\" 页，共 \"+pageCount()+\" 页\"","height":"20"},"printScale":"0","printerDeviceName":"PDF生成器"}


id: 642266db99321de22c2dba09
pid: 60c4bd735db2478f9c5a1118
name: script_h5
nodetype: column
createdate: 2023.04.03 07:17:38.000
lastmodifieddate: 2023.12.06 10:50:18.707
value:
var pzh_prefix;
var pzh_length;

var fullScreenDiv = null;



function formOpen() {
    book.showTabOnWhere = 'none';
    //加载帐套信息及年月
    var corpid = book.sheet0.cells("corpid").getValueString();
    runTask("当前记帐期", { corpid: corpid }, function (ym) {
        if (ym == null || ym == 'null') return;
        //得到年月后，获取凭证号相关设置
        pzh_len = getPZHLen(corpid);

        book.sheet0.cells("ym").setValue(ym);

        pzh_prefix = getPZHPrefix(corpid, ym);
        book.sheet0.cells("pzh_prefix").setValue(pzh_prefix);


    });

    book.sheet2.getBrick('FJ').selectionMode = 'multi'; //图片设置成多选模式


    // 追加一些CSS类 ，用于凭证号标记
    $(document.body).append(`<style>
                        .pzh {position:absolute;left:0;bottom:0px; 
                                height:24px; line-height:24px;width:100%; 
                                background-color:#40af40a0; 
                                color:white;font-weight:bold;font-size:12px;text-align:center;}
                        .delete_pzh { position:absolute; right:0; width:40px; height:14px; top:0; text-align:right; 
                                    vertical-align:top; font-size:12px; color:gray;padding-right:5px;}      
                        .delete_pzh:hover { color:white;}      
                          
                        </style>
                    `);


}

function cb_check_onClick() {
    smartRetrieve(book.sheet0, "pzh_check", true, false, function () { //检索完后回调
        if ($pzh_check_ds.rowCount == 0) {
            toastr.success("凭证号检测通过");

        } else {
            book.sheet3.popup('fa fa-cog', '缺失的凭证', 250, 350, true, true, {});
        }
    });
}


/**
 * 多行结果集当前焦点行发生变化
 * @param dsname  结果集名称
 * @param row  行号
 */
function currentBindRowChanged(dsname, row) {
    if (dsname == 'dzpz_pz') {
        //重新加载凭证图片列表

        let id = $dzpz_pz_ds.getString(row, "id");
        let pzh = $dzpz_pz_ds.getString(row, "pzh");
        loadPZ(pzh, id);

    }
}

function viewPDF( id)
{
    var url=  get_PZ_PDF_URL(id);
    openWindow(url);
}

/**
 * 单元格的值发生了改变
 * @param sheet  所在的工作表
 * @param cell  单元格对象
 * @param oldValue  原先的值
 * @param newValue 变化后的值
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行发生变化
 */
function cellValueChanged(sheet, cell, oldValue, newValue, innerRow) {

    //如果是绑定了数据库的，强烈不建议使用本事件，换用结果集变化事件 itemChanged

    //通过别名来判断
    if (cell.alias == 'ym') {
        var corpid = book.sheet0.cells("corpid").getValueString();
        var ym = book.sheet0.cells("ym").getValue();

        pzh_prefix = getPZHPrefix(corpid, ym);
        book.sheet0.cells("pzh_prefix").setValue(pzh_prefix);
    }




}

function loadPZ(pzh, id) {
    let data = getPZFJ(id); //得到凭证的所有图片
    let FJ = book.sheet2.getBrick('FJ');
    FJ.buildGridly(data, function () {
        let shortPZH = pzh;//.substring(pzh_prefix.length);
        //加载图片完成后， 如果是凭证，那么加上凭证号信息
        for (let i = 0; i < data.length; i++) {
            if (data[i].groupname == '凭证') {
                setPZH(data[i].id, shortPZH, false);
            }
        }




    });
    g_selectedAll = false; //加载一个凭证的图片后 ，默认是不全选中的
    book.sheet2.yOffset = 0; //垂直卷滚条归位
}


//@comment (group=凭证号,caption=设置图片的凭证号,needRightControl=false)
function setPZH(id, pzh, needDeleteButton) {
    if (needDeleteButton == undefined) needDeleteButton = true
    find_pzh(id, true, needDeleteButton).find('.no').text(pzh);
}

//@comment (group=凭证号,caption=查找或创建凭证号标记对象,needRightControl=false)
function find_pzh(id, create_if_not_exists, needDeleteButton) {

    if (needDeleteButton == undefined) needDeleteButton = true;

    var d = $('#' + id);
    if (!d) {
        $.alert(id + "不存在");
        return null;
    }

    var ret = d.find('.pzh');
    if (ret.length == 0) {
        if (create_if_not_exists) //如果需要创建，则创建它
        {
            d.append(`<div class="pzh" >
                        <div class="no"></div>
                        <div class="delete_pzh"  ${needDeleteButton ? "" : " style='display:none' "} ><i class="fa fa-close" onclick="removePZH('${id}');  event.preventDefault(); event.stopPropagation();"> </i></div>
                      </div>`);
        }
        ret = d.find('.pzh');
    }
    return ret;

}



/**
 * 单元格单击事件
 * @param sheet
 * @param cell
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行被点击
 * @param event 事件对象
 */
//@comment (group=单元格事件,caption=单元格点击)
function cellOnClick(sheet, cell, innerRow, event) {

    //通过别名来判断
    if (cell.alias == 'XXX') {

    }

    //通过数据库绑定情况来判断
    let bind = cell.bind;
    if (bind != null && bind.dataSource == 'dzpz_pz') {
        if (bind.DBCol == 'c_sh1') {
            if ($dzpz_pz_ds.getInt(innerRow, "verifierid") != 0) return; //已审核，不要再审核
            do_sh1(innerRow);
        }
        if (bind.DBCol == 'c_sh2') {
            if ($dzpz_pz_ds.getInt(innerRow, "verifierid") == 0) return; //没有审核，不需要取消审核
            do_sh2(innerRow);
        }
    }

}

function do_sh1(innerRow, callback) {
    let id = $dzpz_pz_ds.getString(innerRow, "id");
    let pzh = $dzpz_pz_ds.getString(innerRow, "pzh");

    do_sh(id,true, function (ret)  //后台执行
    {
        if (ret.success) {
            $dzpz_pz_ds.setValue(innerRow, "verifierid", ret.verifierid);
            $dzpz_pz_ds.setValue(innerRow, "verifiername", ret.verifiername);
            $dzpz_pz_ds.setValue(innerRow, "verifieddate", ret.verifieddate);
            $dzpz_pz_ds.setValue(innerRow, "tipinfo", "审核成功");
            $dzpz_pz_ds.setValue(innerRow, "c_sh1", "");
            $dzpz_pz_ds.setValue(innerRow, "c_sh2", "取消校对");

        } else {
            $dzpz_pz_ds.setValue(innerRow, "tipinfo", ret.message);

        }
        if (callback) callback();
    });
}

function do_sh2(innerRow, callback) {
    let id = $dzpz_pz_ds.getString(innerRow, "id");
    do_sh(id, false, function (ret) //后台执行
    {
        if (ret.success) {
            $dzpz_pz_ds.setValue(innerRow, "verifierid", null);
            $dzpz_pz_ds.setValue(innerRow, "verifiername", null);
            $dzpz_pz_ds.setValue(innerRow, "verifieddate", null);
            $dzpz_pz_ds.setValue(innerRow, "tipinfo", "取消成功");
            $dzpz_pz_ds.setValue(innerRow, "c_sh1", "审核");
            $dzpz_pz_ds.setValue(innerRow, "c_sh2", "");


        } else {
            $dzpz_pz_ds.setValue(innerRow, "tipinfo", ret.message);

        }
        if (callback) callback();
    });
}



//@comment (group=工具函数,caption=全选或取消全选)
function seletOrUnSelectAll() {
    //让selection单元格失去编辑焦点，不然再点击，它不会触发单元格的点击事件，因为此时点击的编辑框对象，不会触发单元格的点击
    book.sheet1.View.forceCurrentEditControlGiveUpFocus();

    var v = book.sheet1.cells('selection').getValueInt();

    book.sheet1.paintPermit = false;
    $dzpz_pz_ds.setValueWithTrigger = false;
    for (var i = 0; i < $dzpz_pz_ds.rowCount; i++) {
        $dzpz_pz_ds.setValue(i, "selected", v);
    }
    $dzpz_pz_ds.setValueWithTrigger = true;
    book.sheet1.paintPermit = true;
}


function cb_verify_onClick() {
    $confirm('', '确信要对选中的凭证做审核确认吗?', function () {
        let rows = [];
        for (let i = 0; i < $dzpz_pz_ds.rowCount; i++) {
            if ($dzpz_pz_ds.getInt(i, "selected") == 0) continue;
            rows.push(i);
        };

        showInfoPane("* 正在审核确认...");
        asyncPool(4, rows, function (i, rows) {
            return new Promise(function (resolve, reject) {
                showInfoPane("* 正在审核确认 " + i  );
                do_sh1(i, function () {
                    resolve(i);
                });
            });
        }).then(function (v) {
            hideInfoPane();
            toastr.info("审核完成");
        });

    });
}



function cb_unverify_onClick() {

    $confirm('', '确信要对选中的凭证做取消审核吗?', function () {
        var rows = [];
        for (let i = 0; i < $dzpz_pz_ds.rowCount; i++) {
            if ($dzpz_pz_ds.getInt(i, "selected") == 0) continue;
            rows.push(i);
        };

        showInfoPane("* 正在取消确认...");
        asyncPool(4, rows, function (i, rows) {
            return new Promise(function (resolve, reject) {
                showInfoPane("* 正在取消确认"+i);
                do_sh2(i, function () {
                    resolve(i);
                });
            });
        }).then(function (v) {
            hideInfoPane();
            toastr.info("取消确认完成");
        });

    });


}


function cb_package_onClick() {

    let ids = [];
    for (let i = 0; i < $dzpz_pz_ds.rowCount; i++) {
        if ($dzpz_pz_ds.getInt(i, "selected") == 0) continue;
        ids.push($dzpz_pz_ds.getString(i, "id"));
    }

    if (ids.length == 0) {
        toastr.info("至少选中一张凭证");
        return;
    }

    $confirm('', '确信要将选中的凭证打包下载吗?', function () {
        showInfoPane("*正在压缩打包...");
        runTask("打包下载", { fileName: formatDate(newDate(), "yyyyMMddHHmm") + ".zip", ids: ids },
            function (ret) {
                ret = JSON.parse(ret);
                hideInfoPane();
                if (ret.success) {
                    openWindow(ret.url);
                } else {
                    toastr.error(ret.message);
                }
            });

    });
}

function isVerified() {
    var row = book.getDataSource('dzpz_pz').currentBindRow;
    var verifiername = $dzpz_pz_ds.getString(row, "verifiername");

    if (verifiername != '') {
        toastr.error("已经校对的凭证不允许执行此操作");
        return true;
    }
    return false;
}


/**
 * 图片控件初始化完成
 * @param sheet   所在Sheet
 * @param config  图片控件的名称
 *@param data  该图片的详细信息
 *
 */
//@comment (group=图片控件,caption=图片控件初始化完成)
function imageGridlyInited(sheet, name, data) {


    if (name == "FJ") {
        //图片都初始化后， 定制右上角的工具栏，最多可加5个工具按 钮
        let brick = sheet.getBrick(name);

        brick.addToolButton(1  //在从右往左数第2个工作栏位置添加一个工具按钮
            , "fa-repeat",   // 字符图标
            "旋转图片",  // 鼠标悬停的提示信息
            "green", //按钮背景色
            function (id) {  //点击后的回调函数
                g_turningCount = 0;
                g_turnedCount = 0;
                g_turnNeedCount = 1;
                if (isVerified()) return;  //校对过的不允许再旋转

                rotateImg(sheet, id, '90' ,function(){hideInfoPane();});

            }
        );


        brick.addToolButton(2  //在从右往左数第2个工作栏位置添加一个工具按钮
            , "fa-eye",   // 字符图标
            "浏览大图",  // 鼠标悬停的提示信息
            "green", //按钮背景色
            function (id) {  //点击后的回调函数
                brick.popupShow(id);

            }
        );


        brick.addToolButton(3  //在从右往左数第2个工作栏位置添加一个工具按钮
            , "fa-rotate-left",   // 字符图标
            "旋转图片",  // 鼠标悬停的提示信息
            "green", //按钮背景色
            function (id) {  //点击后的回调函数
                g_turningCount = 0;
                g_turnedCount = 0;
                g_turnNeedCount = 1;
                if (isVerified()) return;  //校对过的不允许再旋转

                rotateImg(sheet, id, '270',function(){hideInfoPane();});

            }
        );



    }
}


function rotateImg(sheet, id, degree, callback) {



    let brick = sheet.getBrick('FJ');
    setTimeout(function () {
        //toastr.info(id);  // id 是当前操作的图片对应数据的ID

        do_imageRotate(id, degree, function (ret) {


            if (ret.success) {

                g_turningCount++;
                showInfoPane('*正在旋转图片' + g_turningCount + "/" + g_turnNeedCount + ' ...');


                //把数据中的图片替换，
                for (let i = 0; i < brick.data.length; i++) {
                    if (brick.data[i].id == id) {
                        //属性从新的属性中替换 
                        for (let prop in brick.data[i]) {
                            brick.data[i][prop] = ret.data[prop];
                        }
                        break;
                    }
                }
                //把缩略图的图片地址替换 ， 

                let img = $('#' + id).find('.image');
                img.attr("src", ret.data.url_thumbnail);
                img.attr('largeimage', ret.data.url_img);
                //把大图预览的地址替换掉
                //book.sheet0.cells("imgPreview").setValue(ret.data.url_img);

            }
            if (callback) callback();



        });
    }, 100);

}


/**
 * 图片控件中的图片控件顺序发生变化
 * @param sheet   所在Sheet
 * @param name  图片控件的名称
 *@param  ids  当前顺序下的图片的ID数组
 *
 *
 *
 */
//@comment (group=图片控件,caption=图片顺序被改变)
function imageOrderChanged(sheet, name, ids) {

    if (isVerified()) return;  //校对过的不允许再调整顺序

    reOrderImage(ids, function (ret) { }); //放一个空的回调函数让它异步执行，不卡界面

}


var g_selectedAll = false;
function cb_selectallimg_onClick() { g_selectedAll = !g_selectedAll; doSelect(g_selectedAll); }


function doSelect(b) {
    var imgPool = book.sheet2.getBrick('FJ');
    if (b) {
        imgPool.selectAll();
    } else {
        imgPool.unSelectAll();
    }
}


function cb_turnLeft_onClick() {
    turnSelection('270');

}

function cb_turnRight_onClick() {

    turnSelection('90');
}

var g_turningCount = 0;
var g_turnedCount = 0;

function turnSelection(degree) {

    if (isVerified()) return;  //校对过的不允许再旋转

    var sheet = book.sheet2;
    var imgPool = sheet.getBrick('FJ');
    // 当前选中的
    var selection = imgPool.getSelectedImageList();
    if (selection.length == 0) {
        toastr.error("至少选中一张图片");
        return;
    }


    $confirm("提示", "确信要对选中的" + selection.length + "张图片做旋转吗?", function () {

        g_turningCount = 0;
        g_turnedCount = 0;
        g_turnNeedCount = selection.length;
        /*
                setTimeout(function () {
                    for (var i = 0; i < selection.length; i++) {
                        rotateImg(sheet, selection[i].id, degree, i * 1000);
                    }
                }, 10);
                */

        asyncPool(4 , selection, function (item, array) {
            return new Promise(function (resolve, reject) {

                console.dir(item);
                rotateImg(sheet, item.id, degree,
                    function () { //注意，在旋转完成后，再设置resolve 表示本任务已完成，而不是直接就resolve ,不然最后的 then 执行时机不对，这么处理，就会在全部旋转完成后，再执行then中的脚本，而不是旋转任务全部发起后就执行 then 
                        resolve(item)
                    });

            });
        }).then(function () {

            setTimeout(function () {

                hideInfoPane();
                toastr.info("旋转完成");
            }, 500);
        });

    });

}


 

function test1() {


    asyncPool(3, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function (item, array) {
        return new Promise(function (resolve, reject) {
            setTimeout(function () {
                console.info(item + "   "+ new Date());
                resolve(item)
            }, 1000);

        });
    }).then(function () {
        console.info("over");
    });

}


id: 643e612499321de22c2dbb57
pid: 60a321f05db27838e0c014bf
name: script_h5
nodetype: column
createdate: 2023.04.19 10:57:09.000
lastmodifieddate: 2023.12.06 10:50:18.707
value:
var pathToMonit = "";//当前监控的目录
var electron = null;
var pzh_prefix = ""; // 凭证号前缀
var pzh_len = 0; //凭证号长度
var lastPZH = "";
var fullScreenDiv = null;

/*
$(document).ready(function () {
    var script = $(`<script src="ui/imageEditor/filerobot-image-editor.min.js">
    
    </script>`);
    $(document.body).append(script);
});
*/

function formOpen() {

    book.sheet4.visible = false;

    book.showTabOnWhere = "none";
    newImgCommingTipVisible(false);

    book.sheet3.getBrick('cb_delete_pz').visible = false;

    //加载帐套信息及年月
    var corpid = book.sheet2.cells("corpid").getValueString();
    var ym = book.sheet2.cells("ym").getValue();
    //得到年月后，获取凭证号相关设置
    pzh_len = getPZHLen(corpid);
    pzh_prefix = getPZHPrefix(corpid, ym);

    getLastPZH(corpid, ym, function (v) {
        if (v == '') v = pzh_prefix + '00000001'.substring(8 - pzh_len, 8);
        lastPZH = v;
    });

    // smartRetrieve(book.sheet2, "dzpz_pz"); //刷新凭证列表
    // });

    book.getWorkSheet('凭证清单').cells("yue").setValue(getMonth(newDate()));

    book.sheet3.getBrick('FJ').config.promptInfoOnDelete = "确信要将图片从当前凭证中移除，并放回到图片池中吗?";
    book.sheet1.getBrick('imgPool').config.promptInfoOnDelete = "确信要将图片放入回收站吗?";

    //收到来自服务器推送的消息
    onPushMessage("electronPushMessage", function (msg) {
        msg = JSON.parse(msg);
        if (msg.cmd == "newFileUploaded") newImgCommingTipVisible(true); //通知有新文件上传了
        if (msg.cmd == "notifyNeedUploadFileCount") notifyNeedUploadFileCount(msg.fileCount); //通知还有多少个文件等待上传
    });

    //获取当前的electron接口对象
    electron = getElectron(); //getElectron是系统全局功能函数

    book.sheet1.getBrick('imgPool').selectionMode = 'multi'; //图片设置成多选模式

    // 追加一些CSS类 ，用于凭证号标记
    $(document.body).append(`<style>
                        .pzh {position:absolute;left:0;bottom:0px; 
                                height:30px; line-height:30px;width:100%; 
                                background-color:#af4040e0; 
                                color:white;font-weight:bold;font-size:20px;text-align:left;}
                        .delete_pzh { position:absolute; right:0; width:40px; height:44px; top:0; text-align:right; 
                                    vertical-align:top; font-size:24px; color:#ffa0a0;padding-right:5px;}      
                        .delete_pzh:hover { color:white;}      
                          
                        </style>
                    `);


    //注册调整缩略图大小的事件
    $('#blockSize').on('input', resetImgPoolBlockSize);


    setTimeout(function () {
        //调取缩略图大小

        var imgPool = book.sheet1.getBrick('imgPool');
        let blockSize = getImagePoolBlockSize();
        if (blockSize != imgPool.config.blockSize) {
            $('#blockSize').val(blockSize);
            resetImgPoolBlockSize(false);
        }
    }, 1000);

    //调取图片目录设置，注意适当延时
    setTimeout(function () {
        if (electron != null) {
            var hostName = electron.getHostName();
            pathToMonit = getMonitePath(hostName);

            //开启监控
            if (pathToMonit == '') pathToMonit = "c:\\凭证影像采集目录";

            moniteStart(pathToMonit);
            $.alert('请将扫描仪的图片目录指向：' + pathToMonit);
        }

        //显示总共图片数
        getTotalImageCount(function (ret) { book.sheet0.cells('imageCountTotal').setValue('共' + ret + '张') });

    }, 500);



    $(document).on('keydown', function (e) {
        console.info(" kkkkk down");
        if (e.ctrlKey) {
           // fullScreenViewImageOpen();
        }
    });


    $(document).on('keyup', function (e) {
        console.info(" kkkkk up");
        if (!e.ctrlKey) {

           // fullScreenViewImageClose();

        }
    });

}


// 先保存当前选中状态及设置的凭证号信息

var g_selection;
var g_pzMap;
//@comment (group=图片清单刷新,caption=保存选中状态及凭证标记信息,needRightControl=false)
function saveSelectionAndPZInfo() {

    var imgPool = book.sheet1.getBrick('imgPool');

    // 保存当前选中状态及设置的凭证号信息
    var selection = imgPool.getSelectedImageList();
    // 保存设置的凭证号信息
    var pzhMap = {};
    var pzhs = imgPool.dom.find('.pzh');
    for (let i = 0; i < pzhs.length; i++) {
        let id = $(pzhs[i]).parent().attr('id');
        let pzh = $(pzhs[i]).find('.no').text();
        pzhMap[id] = pzh;

    }
    g_selection = selection;
    g_pzMap = pzhMap;
}




//@comment (group=图片清单刷新,caption=还原选中及凭证标记,needRightControl=false)
function restoreSelectionAndPZInfo() {
    var selection = g_selection;
    var pzhMap = g_pzMap;
    var imgPool = book.sheet1.getBrick('imgPool');

    //恢复选中状态
    for (let i = 0; i < selection.length; i++) {
        imgPool.setImageSelected(selection[i].id, true);
    }
    //恢复凭证号
    for (let id in pzhMap) {
        var pzh = pzhMap[id];
        find_pzh(id, true).find('.no').text(pzh);
    }

}

//@comment (group=图片控件,caption=重设小图大小,needRightControl=false)
function resetImgPoolBlockSize(needSaveSetting) {
    if (needSaveSetting == null) needSaveSetting = true;
    var imgPool = book.sheet1.getBrick('imgPool');

    // 先保存当前选中状态及设置的凭证号信息
    saveSelectionAndPZInfo();

    let v = $('#blockSize').val();

    imgPool.config.blockSize = parseInt(v);
    imgPool.rebuildGridly();

    //恢复选中状态
    restoreSelectionAndPZInfo();

    if (needSaveSetting) {
        setTimeout(function () {
            setImagePoolBlockSize(imgPool.getConfig("gguid"), v);
        }, 1000);
    }



}

function resetImageCountInfo() {

    setTimeout(function () {
        book.sheet0.cells("imageCount").setValue("前 " + book.sheet1.getBrick("imgPool").imageCount + " 张");
    }, 300);
}

/**
 * 图片控件初始化完成
 * @param sheet   所在Sheet
 * @param config  图片控件的名称
 *@param data  该图片的详细信息
 *
 */
//@comment (group=图片控件,caption=图片控件初始化完成)
function imageGridlyInited(sheet, name, data) {


    if (name == "imgPool") {
        resetImageCountInfo()
        //图片都初始化后， 定制右上角的工具栏，最多可加5个工具按 钮
        let brick = sheet.getBrick(name);

        book.sheet0.cells("imageCount").setValue(brick.imageCout + "张图片");


        brick.addToolButton(2  //在从右往左数第2个工作栏位置添加一个工具按钮
            , "fa-repeat",   // 字符图标
            "旋转图片",  // 鼠标悬停的提示信息
            "green", //按钮背景色
            function (id) {  //点击后的回调函数

                showInfoPane('*正在旋转图片...');
                setTimeout(function () {
                    //toastr.info(id);  // id 是当前操作的图片对应数据的ID
                    var ret = do_imageRotate(id, "90");
                    if (ret.success) {
                        //把数据中的图片替换，
                        for (let i = 0; i < brick.data.length; i++) {
                            if (brick.data[i].id == id) {
                                //属性从新的属性中替换 
                                for (let prop in brick.data[i]) {
                                    brick.data[i][prop] = ret.data[prop];
                                }
                                break;
                            }
                        }
                        //把缩略图的图片地址替换 ， 

                        let img = $('#' + id).find('.image');
                        img.attr("src", ret.data.url_thumbnail);
                        img.attr('largeimage', ret.data.url_img);
                        //把大图预览的地址替换掉
                        book.sheet0.cells("imgPreview").setValue(ret.data.url_img);
                        hideInfoPane();

                    }
                }, 10);
            }
        );


        brick.addToolButton(3  //在从右往左数第2个工作栏位置添加一个工具按钮
            , "fa-plus",   // 字符图标
            "选中此前",  // 鼠标悬停的提示信息
            "green", //按钮背景色
            function (id) {
                let  selected= $('#' + id).parent().find('.brickSelected').length>0; // 可以用 imgPool.isImageSelected( id) 替换，但此时本函数还没有提供，以后可以换成此函数
                
                let imgPool = book.sheet1.getBrick("imgPool");
                let imgs = imgPool.getCurrentSortedImageList();//得到当前排序后的图片清单
                let found = false;
                for (let i = 0; i < imgs.length; i++) {
                    imgPool.setImageSelected(imgs[i].id, !selected);
                    if (imgs[i].id == id) return;

                }


            });


    }
}


/**
 * 图片控件中图片上的删除按钮被点击
 * @param sheet   所在Sheet
 * @param name  图片控件的名称
 * @param data  图片的信息
 *
 * @returns  {object}    返回一个对象 ， 其中  success= boolean 表示继续执行删除操作，否则表示终止删除操作
 *    如果需要显示一个提示信息，则在 属性 message 中指定
 */
//@comment (group=图片控件,caption=图片上的删除按钮被点击)
function imageOnDelete(sheet, name, data) {

    if (name == 'FJ') {
        if (data.groupname == '凭证') {
            return { success: false, message: "这是凭证，不允许这样移除，请点击“删除凭证”" };
        } else {
            var ret = putImageBackToPool(data.id);
            if (ret.success) {
                smartRetrieve(book.sheet3, "one");
                cb_refresh_onClick();
            } else {
                return ret;
            }

        }
    }

    if (name == 'imgPool') {
        moveImageToRecycle(data.id);
        resetImageCountInfo();
    }
    return { success: true };
}
/**
 * 图片控件中上传按钮被点击
 * @param sheet   所在Sheet
 * @param name  图片控件的名称
 *
 @returns  {object}    返回一个对象 ， 其中  success= boolean 表示继续执行上传操作，否则表示终止上传操作
 *    如果需要显示一个提示信息，则在 属性 message 中指定
 */
//@comment (group=图片控件,caption=图片上传按钮被点击)
function imageOnNewUpload(sheet, name) {


    if (name == 'imgPool') {
        toastr.info("请连接扫描仪，或将图片复制到监控的目录下，图片自动上传");
    }

    if (name == 'FJ') {
        var imgPool = book.sheet1.getBrick('imgPool');
        // 保存当前选中状态及设置的凭证号信息
        var selection = imgPool.getSelectedImageList();
        if (selection.length == 0) {
            toastr.error("至少选中一张图片");
            return { success: false }; // 此返回，阻止了默认的上传操作
        }


        var lastPZ = null;
        for (let i = 0; i < selection.length; i++) {
            var one = selection[i];
            var pzh = getPZH(one.id);
            if (pzh != '') {
                toastr.error("选中的图片中有标记为凭证的，禁止将凭证图片添加到当前凭证中");
                return { success: false }; // 此返回，阻止了默认的上传操作
            }
        }

        var ret = addImageToPZ($one_ds.getString(0, "id"), selection);
        if (ret.success) {
            //刷新图片区
            cb_refresh_onClick();
            //刷新凭证
            loadPZ($one_ds.getString(0, "id"), $one_ds.getString(0, "pzh"), $one_ds.getString(0, "verifiername") != "" ? 1 : 0);
        }

    }


    return { success: false }; // 此返回，阻止了默认的上传操作
}

//先定位 Id的序号， 然后返回它左边的图片的ID
function findLeftImageId(id) {
    let imgPool = book.sheet1.getBrick("imgPool");
    let imgs = imgPool.getCurrentSortedImageList();//得到当前排序后的图片清单
    //找到自已的索引号
    let index = 0;
    for (let i = 0; i < imgs.length; i++) {
        if (imgs[i].id == id) {
            index = i;
            break;
        }
    }

    if (index > 0) return imgs[index - 1].id;
    return "";
}


//找到左边最近的一张凭证号
//如果该凭证与自已相临，那么就同号，因为可能是同一个凭证的不同分页
//否则在那个号上加1做为自已的凭证号
function incLeftNearestPZH(id) {
    let imgPool = book.sheet1.getBrick("imgPool");
    let imgs = imgPool.getCurrentSortedImageList();//得到当前排序后的图片清单
    //找到自已的索引号
    let index = 0;
    for (let i = 0; i < imgs.length; i++) {
        if (imgs[i].id == id) {
            index = i;
            break;
        }
    }

    //再从index往左边查到第一张凭证
    for (let i = index - 1; i >= 0; i--) {
        let tid = imgs[i].id;
        let pzh = getPZH(tid);
        if (pzh == '') continue;
        if (i == index - 1) {
            return pzh; // 左边最近的一张凭证号就在自已的左边，那么就意味着自已与左边那张凭证号可能就是一张凭证的不同分页，所以直接返回凭证号
        } else {
            return stringInc(pzh);
        }

    }
    //到这里，都没有找到凭证号，那么直接返回凭证号前缀
    return stringInc(lastPZH);
}

/**
 * 图片控件中鼠标进入某个图片区域
 * @param sheet   所在Sheet
 * @param config  图片控件的名称
 *@param data  该图片的详细信息
 *
 */
//@comment (group=图片控件,caption=鼠标进入图片区域)
function imageOnMouseEnter(sheet, name, data, event) {
    //console.dir(data);
    var url = data.url_img;
    book.sheet0.cells("imgPreview").setValue(url);
}
//@comment (group=图片控件,caption=鼠标从图片移开,needRightControl=false)
function imageOnMouseOut(sheet, name, data, event) {

    // book.sheet0.cells("imgPreview").setValue("");
}

/**
 * 图片控件中图片顺序变化了
 * @param sheet   所在Sheet
 * @param config  图片控件的配置信息
 *@param ids  调整顺序后的id清单
 *
 */
//@comment (group=图片控件,caption=顺序调整后)
function attachmentOrderChanged(sheet, config, ids) {


    let imgs = imgPool.getCurrentSortedImageList();//得到当前排序后的图片清单
    reorderImageFileIndex(imgs);

}

/**
 * 图片控件中某个图片被单击
 * @param sheet   所在Sheet
 * @param config  图片控件的名称
 *@param data  该图片的详细信息
 * @param event  事件对象
 *
 *
 */
//@comment (group=图片控件,caption=图片被单击)
function imageOnClick(sheet, name, data, event) {

    if (name == 'imgPool') {
        if (book.sheet0.cells("clickAction").getValue() == 2) imageOnDBLClick(sheet, name, data, event, false);
    }
}


var g_lastPZH = "";
/**
 * 图片控件中某个图片被双击了
 * @param sheet   所在Sheet
 * @param config  图片控件的名称
 *@param data  该图片的详细信息
 *
 */
//@comment (group=图片控件,caption=图片被双击)
function imageOnDBLClick(sheet, name, data, event, showDlg) {

    if (showDlg == undefined) showDlg = true;

    //因为 mouseOut 会把大图清除掉，所以这里重新再设置上
    setTimeout(function () {
        var url = data.url_img;
        book.sheet0.cells("imgPreview").setValue(url);

    }, 200);

    var pzh = '';
    try {

        pzh = find_pzh(data.id, false).find('.no').text();
    } catch (err) {

    }

    if (pzh == undefined) pzh = "";
    if (pzh == '') {

        //找到左边最近的一张凭证号
        //如果该凭证与自已相临，那么就同号，因为可能是同一个凭证的不同分页
        //否则在那个号上加1做为自已的凭证号
        pzh = incLeftNearestPZH(data.id);
        if (pzh > lastPZH) lastPZH = pzh;


    }

    let $setpzh = function (val) {
        if (val == '') {

            var p = find_pzh(data.id, false);
            if (p) p.remove();
            book.sheet1.getBrick("imgPool").setImageSelected(data.id, false);
            return true;
        } else {
            if (val.length - pzh_prefix.length != pzh_len) {
                toastr.error("凭证号(不含前缀)长度必须是" + pzh_len + "位");
                return false;

            }
            g_lastPZH = val; //记下来
            find_pzh(data.id, true).find('.no').text(val);
            book.sheet1.getBrick("imgPool").setImageSelected(data.id, true);
            return true;
        }
    }

    if (!showDlg) {
        $setpzh(pzh);
        return;
    }

    let dlg = inputBox("标记为凭证", "", pzh, "输入凭证号码",

        function (val) { //确认后的回调

            return $setpzh(val);

        }, false,/*不允许为空*/
        //下面是一些事件的切入
        {
            //输入面板初始化完成后
            onContentReady: function () {

                let input = dlg.$content.find('.name');
                input.on('keyup', function () {
                    if (input.val().indexOf(pzh_prefix) != 0) {
                        input.val(pzh_prefix);
                    }
                });
            }
        }
    );




}


function setLoadImagePoolDataOnceCount()
{
    let onceCount = book.sheet0.cells("onceCount").getValueInt();
    if( onceCount<0) onceCount=100;
    if( onceCount>2000) onceCount = 2000;
    setTimeout( function(){ 
        book.sheet0.cells("onceCount").setValue( onceCount);
        book.sheet1.getBrick("imgPool").config.onceCount= onceCount; 
        cb_refresh_onClick();
    },1);

}

//@comment (group=凭证号,caption=得到图片的凭证号如果有的话,needRightControl=false)
function getPZH(id) {
    let obj = find_pzh(id, false);
    if (obj == null) return;
    let s = obj.text();
    s = s.replace(/\s/g, '');
    return s;
}

//@comment (group=凭证号,caption=设置图片的凭证号,needRightControl=false)
function setPZH(id, pzh, needDeleteButton) {
    if (needDeleteButton == undefined) needDeleteButton = true
    find_pzh(id, true, needDeleteButton).find('.no').text(pzh);
}

//@comment (group=凭证号,caption=查找或创建凭证号标记对象,needRightControl=false)
function find_pzh(id, create_if_not_exists, needDeleteButton) {

    if (needDeleteButton == undefined) needDeleteButton = true;

    var d = $('#' + id);
    if (!d) {
        $.alert(id + "不存在");
        return null;
    }

    var ret = d.find('.pzh');
    if (ret.length == 0) {
        if (create_if_not_exists) //如果需要创建，则创建它
        {
            d.append(`<div class="pzh" >
                        <div class="no"></div>
                        <div class="delete_pzh"  ${needDeleteButton ? "" : " style='display:none' "} ><i class="fa fa-close" onclick="removePZH('${id}');  event.preventDefault(); event.stopPropagation();"> </i></div>
                      </div>`);
        }
        ret = d.find('.pzh');
    }
    return ret;

}

//@comment (group=图片控件,caption=移除图片看的凭证号标记,needRightControl=false)
function removePZH(id) {
    var p = find_pzh(id, false);
    if (p) p.remove();
}

function cb_selectall_onClick() { doSelect(true); }
function cb_selectnull_onClick() { doSelect(false); }

function doSelect(b) {
    var imgPool = book.sheet1.getBrick('imgPool');
    if (b) {
        imgPool.selectAll();
    } else {
        imgPool.unSelectAll();
    }
}


function cb_path_onClick() {
    if (electron == null) {
        toastr.error("此功能仅能在客户端APP中执行");
        return;
    }

    var path = electron.showOpenDialogSync('');
    if (path == '') return;
    if (!path.endsWith('凭证影像采集目录')) {

        $.alert("目录名必须是：“凭证影像采集目录”，盘符及上级目录随意。");
        return;
    }
    var hostName = electron.getHostName();
    setMonitePath(hostName, path);

    moniteStart(path);


}

//@comment (group=上传相关,caption=开始文件变化监控,needRightControl=false)
function moniteStart(path) {
    pathToMonit = path;
    book.sheet0.cells('stateBar').setValue("图片目录 " + pathToMonit);

    if (electron == null) {
        toastr.error("此功能仅能在客户端APP中执行");
        return;
    }

    book.sheet0.cells('stateBar').setValue("图片目录 " + pathToMonit + " 监控中...");
    electron.ipcSendMessage({ cmd: "moniteStart", path: path });
}

function cb_refresh_onClick() {
    newImgCommingTipVisible(false);

    // 先保存当前选中状态及设置的凭证号信息
    saveSelectionAndPZInfo();

    var imgPool = book.sheet1.getBrick('imgPool');
    imgPool.reInit(restoreSelectionAndPZInfo); //重新初始化 ,并在初始化完成后， 恢复选中状态

    toastr.info("重新加载完成");



}

//@comment (group=上传相关,caption=上传好一个文件后，通知有新文件,needRightControl=false)
//@comment (group=上传相关,caption=上传好一个文件后通知有新文件,needRightControl=false)
function newImgCommingTipVisible(v) {
    book.sheet0.getBrick('shineText').visible = v;

}

//@comment (group=上传相关,caption=刷新当前还有多少文件要上传的提示,needRightControl=false)
function notifyNeedUploadFileCount(fc) {
    var info = fc == 0 ? "" : "【" + fc + "】个文件正准备上传";
    book.sheet0.cells("stateInfo2").setValue(info);
}


//@comment (group=归档,caption=凭证归档,needRightControl=false)
function cb_auto_onClick() {

    var imgPool = book.sheet1.getBrick('imgPool');
    // 保存当前选中状态及设置的凭证号信息
    var selection = imgPool.getSelectedImageList();
    if (selection.length == 0) {
        toastr.error("至少选中一张图片");
        return;
    }

    let imgs = imgPool.getCurrentSortedImageList();//得到当前排序后的图片清单
    let nn = imgs.length - selection.length;
    if (nn > 0) {
        $confirm("提示", "有" + nn + "张图片没有选中，确信要继续吗?", function () {
            do_pack(selection);
        });
    } else {
        do_pack(selection);
    }
}

var pzGroup = [];

//@comment (group=归档,caption=归档操作,needRightControl=false)
function do_pack(selection) {
    pzGroup = [];
    let pzh2Config = {}; //凭证号对应的配置信息 ， 辅助数据
    let lastPZ = null;
    for (let i = 0; i < selection.length; i++) {
        let one = selection[i];
        let pzh = getPZH(one.id);
        if (pzh == '') {
            if (lastPZ != null) {
                lastPZ.fj.push(one.id);
            }
        } else {
            //新的凭证号
            if (pzh2Config[pzh] == null) {
                lastPZ = {};
                lastPZ.pzh = pzh;
                lastPZ.fj = []; //附件图片
                lastPZ.pz = []; //凭证图片
                pzh2Config[pzh] = lastPZ; //记下凭证号与配置对象的对应关系
                pzGroup.push(lastPZ); //加入到总配置中
            } else {
                //已经存在配置，说明它是该凭证号的更多的分页图片
                //需要检测，它的左边是不是也是同一个号的凭证
                lastPZ = pzh2Config[pzh];

                let leftID = findLeftImageId(one.id); //找到它左边那张图片的ID
                if (leftID == '') {
                    toastr.error("不可能出现的情况");
                    return;
                }
                let leftPZH = getPZH(leftID);
                if (leftPZH != pzh) {
                    $.alert(pzh + '有多张图片，请将它们移动到相邻位置，即同一张凭证的多个分页必须连续相邻，它们之间不要穿插附件图片或其它凭证号图片');
                    return;
                }

            }
            lastPZ.pz.push(one.id); //凭证图片，同一个凭证可能有多个图片 
        }
    }

    if (pzGroup.length == 0) {
        toastr.error("凭证归档操作，至少需要标记一张凭证，并选中它");
        return;
    }

    console.dir();


    do_pzgdqr();



}

//@comment (group=归档,caption=归档确认,needRightControl=false)
function do_pzgdqr() {

    // 整理归档配置信息用于显示
    book.sheet4.paintPermit = false;

    $gd_ds.reset();
    for (let i = 0; i < pzGroup.length; i++) {
        let one = pzGroup[i];
        let row = $gd_ds.insertRow(9999);
        $gd_ds.setValue(row, { pzh: one.pzh, pzs: one.pz.length, fjs: one.fj.length, hj: one.pz.length + one.fj.length });
    }
    book.sheet4.paintPermit = true;

    book.sheet4.popup('fa fa-cog', '归档确认', 450, 450, true, true, {
        action1: {
            text: '确认',
            btnClass: 'btn-green',
            action: function () {
                do_pzgd();
                return true;    //表示关闭弹窗
            }
        },
        cancel: {
            text: '关闭',
            btnClass: 'btn-red',
            action: function () {

                return true;
            }
        }

    });

}
//@comment (group=归档,caption=归档,needRightControl=false)
function do_pzgd() {
    showInfoPane('*正在归档...');
    setButtonsStatus(false); //禁用一些按钮点击
    //alert(JSON.stringify(pzGroup));
    runTask("归档",
        {
            corpid: book.sheet4.cells("corpid").getValueString(),
            ym: book.sheet4.cells("ym").getValueString(),
            pzGroup: pzGroup
        }, function (ret) {
            hideInfoPane();
            ret = JSON.parse(ret);

            if (ret.success) {

                setButtonsStatus(true); //启用一些按钮点击
                smartRetrieve(book.sheet2, "dzpz_pz"); //刷新凭证列表
                //重新检索图片区
                cb_refresh_onClick();
            } else {
                $.alert(ret.message);
            }

        });
}

function setButtonsStatus(b) {

    book.sheet0.getBrick('cb_auto').enabled = b;
}

//@comment (group=,caption=调取某个凭证,needRightControl=false)
function loadPZ(id, pzh, verified) {
    book.sheet3.cells("id").setValue(id);
    smartRetrieve(book.sheet3, "one");
    //附件图片清单
    //不能从 $one_ds中取数，因为上面的smartRetrieve 是异步的
    let action = (verified == 0) ? "edit" : "view";
    book.sheet3.getBrick('cb_delete_pz').visible = verified == 0;
    var FJ = book.sheet3.getBrick('FJ');
    FJ.config.action = action; //控制是否显示删除和新增按钮
    let data = getPZFJ(id); //得到凭证的所有图片
    FJ.buildGridly(data, function () {
        let shortPZH = pzh.substring(pzh_prefix.length);
        //加载图片完成后， 如果是凭证，那么加上凭证号信息
        for (let i = 0; i < data.length; i++) {
            if (data[i].groupname == '凭证') {
                setPZH(data[i].id, shortPZH, false);
            }
        }

    });
    book.sheet3.yOffset = 0; //垂直卷滚条归位
}


//@comment (group=,caption=删除凭证，并把图片回归到池中,needRightControl=false)
function cb_delete_pz_onClick() {
    $confirm("提示", "确信删除本凭证，并将图片全部回归到待归档状态吗?", function () {
        book.sheet3.getBrick('cb_delete_pz').visible = false;
        var id = $one_ds.getString(0, "id");
        var ret = deletePZAndPutBackToPool(id);
        if (ret.success) {
            $one_ds.reset();
            reload_pzh_info(); //可能删除的就是最后一张凭证，所以要重新取一下
            var FJ = book.sheet3.getBrick('FJ');
            FJ.config.action = 'view';
            FJ.buildGridly([]);
            cb_refresh_onClick();//刷新池中图片

        } else {
            toastr.error(ret.message);
        }
    });

}



function cb_trash_onClick() {
    var url = runTask("urlForTrash", {});
    openInMainFrame(url, false, 'fa-trash', '图片回收站');

}

function cb_deleteSelection_onClick() {
    let imgPool = book.sheet1.getBrick('imgPool');
    // 保存当前选中状态及设置的凭证号信息
    let selection = imgPool.getSelectedImageList();
    if (selection.length == 0) {
        toastr.error("至少选中一张图片");
        return;
    }
    let nn = selection.length;
    $confirm("提示", "确信将选中的" + nn + "张图片移入回收站吗?", function () {
        showInfoPane('*正在移和回收站');
        setTimeout(function () {
            do_trush(selection);
            hideInfoPane();
        }, 100);
    });

}

function do_trush(selection) {

    for (let i = 0; i < selection.length; i++) {
        let one = selection[i];
        moveImageToRecycle(one.id);

    }
    cb_refresh_onClick();

}

function cb_size_onClick() {
    let RPM = book.sheet0.RPM;
    let h = RPM.getRowHeight(1);
    if (h > 1) {
        RPM.setRowStretchHeight(1, 0);//弹性高度取消
        RPM.setRowHeight(1, 1);

        RPM.setRowHeight(2, 0);
        book.sheet0.getBrick('dbnav').visible = false;

    } else {

        RPM.setRowStretchHeight(1, 40);//弹性高度取消
        RPM.setRowHeight(1, 300);

        RPM.setRowHeight(2, 30);
        book.sheet0.getBrick('dbnav').visible = true;
    }
}


/**
 * 单元格的值发生了改变
 * @param sheet  所在的工作表
 * @param cell  单元格对象
 * @param oldValue  原先的值
 * @param newValue 变化后的值
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行发生变化
 */
function cellValueChanged(sheet, cell, oldValue, newValue, innerRow) {

    //通过别名来判断
    if (sheet.name == '凭证清单') {
        if (cell.alias == 'nian' || cell.alias == 'yue') {
            reload_pzh_info();
        };
    }

  

}

/**
 * 单元格因为被编辑而改变。当用户通过编辑单元的值而让单元格发生值改变时本事件被触发。
 * 注意，当使用脚本 sheet.cells(row,col).setValue ( value) 来改变单元格的值时，本事件并不触发
 * @param sheet
 * @param cell
 * @param newValue
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行发生变化
 */
function cellValueChangedByEdit(sheet, cell, newValue, innerRow) {

     if( cell.alias=='onceCount')  
    {
        setLoadImagePoolDataOnceCount();
     
    }


}



function reload_pzh_info() {
    var sheet = book.getWorkSheet('凭证清单');
    //加载帐套信息及年月
    var corpid = sheet.cells("corpid").getValueString();

    var nian = sheet.cells("nian").getValueString();
    var yue = sheet.cells("yue").getValueString();
    var ym = nian + right("00" + yue, 2);

    //得到年月后，获取凭证号相关设置
    pzh_len = getPZHLen(corpid);
    pzh_prefix = getPZHPrefix(corpid, ym);
    getLastPZH(corpid, ym, function (v) {
        if (v == '') v = pzh_prefix + '00000000'.substring(8 - pzh_len, 8);
        lastPZH = v;

    });

    smartRetrieve(sheet, "dzpz_pz"); //刷新凭证列表
}


id: 643f591d99321de22c2dbbef
pid: 60d095db993254220bd8519f
name: script_h5
nodetype: column
createdate: 2023.04.19 11:00:14.000
lastmodifieddate: 2023.12.06 10:50:18.708
value:
/**
 * 表单初始化完成后，执行此事件
 */
//@comment (group=表单事件,caption=表单初始化完成)
function formOpen() {
    book.showTabOnWhere = 'none';
    onPushMessage("dr_info", function (info) {
        if (info == 'over') {
            hideInfoPane();
        } else {
            showInfoPane(info);
        };

    })

}

//导入excel文件
function cb_importXLS_onClick(sheet, cell, button) {

    book.readXLS(function (data) {
        // alert(JSON.stringify(data));
        showInfoPane("*正在导入");
        backend_importExcelData(data[Object.keys(data)[0]], function (ret) {
            //console.dir(ret);
            hideInfoPane();
            if (ret.success) {
                toastr.info('导入成功');
                smartRetrieve(book.getWorkSheet("main"), "pzdj");
                smartRetrieve(book.getWorkSheet("detail"), "pzdjex");
                
            } else {
                toastr.warning(ret.message);
            }
        });
    });
}

/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
function cb_downloadTemplateFile_onClick(sheet, cell, button) {
    var title = "年度\t调整期间\t凭证号\t凭证日期\t会计科目代码\t会计科目名称\t财会支出明细编码\t财会支出明细名称\t预会支出明细编码\t预会支出明细名称\t核算账号编码\t入库单号\t是否已过账\t摘要\t制单人";
    var data = [];
    data.push(title);
    data.push("2021\t6\t210600001\t2021.06.01\t5501\t营业费用\t\t\t\t\tY71JY21201\tRK0001\t否\t这是凭证摘要\t张三");


    var f = $('#form_toexcel')[0];
    f.filename.value = "凭证资料导入模板.xlsx";
    f.data.value = JSON.stringify(data);
    f.submit();

}


id: 643f591d99321de22c2dbc27
pid: 60fa608c9932563b7c99bba5
name: script_h5
nodetype: column
createdate: 2023.04.19 11:01:40.000
lastmodifieddate: 2023.12.06 10:50:18.708
value:
/**
 * 当对某笔单据数据做修改后，列表模板中需要刷新这笔单据的数据，当是修改数据时，
 * 列表中的被修改的行单独执行刷新检索操作。如果是新增单据保存，列表则追加检索出这新增的单据
 *
 *  注意：本函数仅在单据列表模板中使用，当编辑界面保存数据后，触发本事件
 * @param id  需要刷新检索的数据的ID
 * @param row   刷新检索的数据在列表中的行号
 * @param append  true表示是追加检索， false表示是刷新检索
 *
 *
 * @returns {void} 无需返回值
 */
function refreshRetrieveEnd( id ,row , append) {
   //alert( id+  "    "+ row+"    "+  append); 

}


id: 643f591d99321de22c2dbc37
pid: 60fa600f9932563b7c99baff
name: script_h5
nodetype: column
createdate: 2023.04.19 11:01:43.000
lastmodifieddate: 2023.12.06 10:50:18.708
value:
var g_currentUserIsOwner = false; //当前人是不是起草人





/**
 * 表单初始化完成后，执行此事件
 */
//@comment (group=表单事件,caption=表单初始化完成)
function formOpen() {
    book.showTabOnWhere = 'none';
    book.getWorkSheet('下载清单').visible = false;



    if ($dzpz_dy_ds.getString(0, "ziptaskid") == '') {
        book.sheet1.getBrick('cb_cancel').visible = false;
    }

    if (currentUserId() == $dzpz_dy_ds.getInt(0, "userid")) {
        g_currentUserIsOwner = true;
    }
    //按gguid分开接收消息，避免多个打包的消息混在一起
    onPushMessage("打包下载" + currentGUID(), function (info) {
        console.info(info);
        var msg = JSON.parse(info);
        if (msg.action == 'info') {
            console.info(msg.info);
            if (g_currentUserIsOwner) showInfoPane(msg.info);
        }

        if (msg.action == 'gameOver') {
            var result = msg.result;
            //$.alert(JSON.stringify(result));


            $dzpz_dy_ds.setValue(0, "ziptaskid", '', false);//清除打包任务id，因为已经ok了，但不要触发保存
            //不需要保存 ，因为打包完成脚本中已经回填了，仅在界面上回填一下， 方便显示下载清单
            $dzpz_dy_ds.setValue(0, "zipresult", JSON.stringify(result.zipFiles), false);

            console.dir(result);

            cb_package_onClick();

            hideInfoPane();
        }
        if (msg.action == 'over') {

            hideInfoPane();
        }

        if (msg.action == 'error') {
            $.alert(msg.info);
            hideInfoPane();
        }
    })

    $('.navbar-fixed-top').css("z-index", 1);

}
/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=按钮点击事件,caption=下载模板,needRightControl=false)
function cb_downloadTemplateFile_onClick(sheet, cell, button) {
    var title = "序号\t凭证号\t科目代码\t核算账号编号\t摘要";
    var data = [];
    data.push(title);
    data.push("1\t0001\t1001\tRD0001\tABC");
    data.push("2\t0002\t5501\tRD0002\tBBB");

    var f = $('#form_toexcel')[0];
    f.filename.value = "凭证调阅模板.xlsx";
    f.data.value = JSON.stringify(data);
    f.submit();

}

/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=按钮点击事件,caption=导入模板,needRightControl=false)
function cb_importFromExcelFile_onClick(sheet, cell, button) {
    toastr.info("*自动保存，准备导入");
    form.save(false, function () {
        book.readXLS(function (data) {
            showInfoPane("*正在导入");
            setTimeout(function () {
                importData(data);
            }, 10);
        });
    });

}



function safeValue(sheet, row, col) {
    if (row > sheet.length - 1) return null;
    var dataRow = sheet[row];
    if (dataRow == null) return null;
    if (col > dataRow.length - 1) return null;
    return dataRow[col];

}

//@comment (group=,caption=从Excel导入数据,needRightControl=false)
function importData(excelData) {
    var excelSheet = excelData[Object.keys(excelData)[0]];


    var headRow = 0; //题头在第几行
    var dataStartRow = 1;// 数据行从第几行开始

    var RC = excelSheet.length;

    book.sheet0.paintPermit = false;

    for (let row = dataStartRow; row < RC; row++) {
        let data = {
            pzh: safeValue(excelSheet, row, 1) || '',
            kmdm: safeValue(excelSheet, row, 2) || '',
            code: safeValue(excelSheet, row, 3) || '',
            memo: safeValue(excelSheet, row, 4) || '',
        }
        //alert(JSON.stringify(data));
        if (data.pzh == '') continue;
        let r = $dzpz_dymx_ds.insertRow(99999);
        $dzpz_dymx_ds.setValue(r, data);
    }


    showInfoPane("*正在保存并检测凭证号");
    form.save(false, function () {


        book.sheet0.paintPermit = false;
        toastr.info("导入完成");

    });
}




var dymx_changed = false;
/**
 * dsname结果集保存前，对row进行数据校验 ，
 * @param dsname 结果集名称
 * @param row  第row行
 * @returns {boolean} true表示检验通过， false表示校验不通过，update被终止
 */
function validate(dsname, row) {
    if (dsname == 'dzpz_dymx') dymx_changed = true;
    return true;
}

/**
 * 数据集中的数据发生变化
 * @param dsname 数据集名称
 * @param row   数据行号
 * @param col    字段名
 * @param oldValue   原值
 * @param newValue  新值
 */
function itemChanged(dsname, row, col, oldValue, newValue) {
    if (col == 'corpid') dymx_changed = true;

}



/**
 * 单据保存成功后执行本事件。如果单据不需要保存，或保存失败，则不执行本事件
 * @param GUID 当前单据的GGUID
 * @param action 当前单据正在进行的动作，比如 edit , view
 */
function afterSaveSuccessful(GGUID, action) {
    if (dymx_changed) form.loadBill(GGUID); //如果明细有变化，那么保存成功后，重新加载单据，因为在单据保存后，模板后端脚本中会同时更新  pz_id 及 bz
    dymx_changed = false;
}


//@comment (group=按钮点击事件,caption=取消打包,needRightControl=false)
function cb_redo_pack_onClick() {

    $confirm('', '确信要清除压缩文件吗?', function () {

        book.getWorkSheet('下载清单').popupDispose( ) ; 
        
        setTimeout(function () {
            showInfoPane("*正在删除已打包的文件");
            setTimeout(function () {
                $dzpz_dy_ds.setValue(0, "ziptaskid", '');
                $dzpz_dy_ds.setValue(0, "zipresult", '');
                form.save(false);
                $q_result_ds.reset();
                hideInfoPane();
                toastr.info("打包文件已经删除。当再次点击打包下载时会重新打包");
            }, 200);
        },1000);
    });


}

//@comment (group=按钮点击事件,caption=取消打包,needRightControl=false)
function cb_cancel_onClick() {

    $confirm('', '确信要终止打包吗?', function () {
        showInfoPane("*正在终止打包...");
        runTask("终止打包", {
            id: $dzpz_dy_ds.getString(0, "ziptaskid")
        },
            function (ret) {
                ret = JSON.parse(ret);
                if (ret.success) {
                    $dzpz_dy_ds.setValue(0, "ziptaskid", '');
                    $dzpz_dy_ds.setValue(0, "zipresult", '');

                    form.save(false);
                    hideInfoPane();
                } else {
                    toastr.error(ret.message);
                }
            });

    });
}

//@comment (group=按钮点击事件,caption=打包,needRightControl=false)
function cb_package_onClick() {

    form.save(false, function () {
        var ziptaskid = $dzpz_dy_ds.getString(0, "ziptaskid");
        if (ziptaskid != '') {
            toastr.info("正在压缩中...，请稍候");
            return;
        }

        var zipResult = $dzpz_dy_ds.getString(0, "zipresult");
        if (zipResult == '') {
            toastr.info("正在压缩文件，请稍候");
            do_package(currentGUID(), function (ret) {

                if (ret.success) {
                    $dzpz_dy_ds.setValue(0, "ziptaskid", ret.zipTaskId, false); //后台已经回写了，就里只要界面上更新就ok
                }
            });
            return;
        }

        zipResult = zipResult.replace(/&action=view/g, '&action=download');
        zipResult = JSON.parse(zipResult);
        $q_result_ds.reset();
        for (var i = 0; i < zipResult.length; i++) {
            var one = zipResult[i];
            var row = $q_result_ds.insertRow(999);
            $q_result_ds.setValue(row, one);


        }

        book.getWorkSheet('下载清单').popup("", "下载清单", 600, 300, true, true);
    });
}



function cb_package_onClick___() {

    if (form.isSaveNeeded()) {
        toastr.info("请先保存");
        return;
    }

    let ids = [];
    for (let i = 0; i < $dzpz_dymx_ds.rowCount; i++) {
        if ($dzpz_dymx_ds.getString(i, "pz_id") == '') {
            toastr.error("第" + (i + 1) + "行的凭证号不存在，请核对");
            return;
        }
        ids.push($dzpz_dymx_ds.getString(i, "pz_id"));
    }

    if (ids.length == 0) {
        toastr.info("没有凭证清单");
        return;
    }

    $confirm('', '确信要打包下载吗?', function () {
        showInfoPane("*正在压缩打包...");
        let fileName = formatDate(newDate(), "yyyyMMddHHmm") + ".zip";
        runTask("打包下载", {
            fileName: fileName,
            gguid: currentGUID(),
            ids: ids,
            watermark: $dzpz_dy_ds.getString(0, "billno") + "[" + $dzpz_dy_ds.getString(0, "reader") + "]" +
                formatDate(newDate(), "yyyy.MM.dd HH:mm")
        },
            function (ret) {
                ret = JSON.parse(ret);
                hideInfoPane();
                if (ret.success) {
                    let t = window.location.href;
                    let p = t.indexOf("billedit");
                    t = t.substring(0, p);
                    let url = t + ret.url;
                    $.alert(` <a href="${url}" target="_blank">点击下载${fileName}</a>`, `打包完成`);
                } else {
                    toastr.error(ret.message);
                }
            });

    });

}

/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=按钮点击事件,caption=调取凭证列表,needRightControl=false)
function cb_pzlist_onClick(sheet, cell, button) {
    // if (form.isSaveNeeded()) {
    //     toastr.info("请先保存");
    //     return;
    // }
    book.getWorkSheet("凭证资料查询").float('fa fa-cog', "凭证资料查询",
        {
            my: 'right-center',
            at: 'right-center',
            autoposition: 'down',
            offsetX: -5,
            offsetY: 5
        }, { width: '70%', height: '90%' });
    smartRetrieve(book.getWorkSheet("凭证资料查询"), "q_pzdjex")
}


/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=按钮点击事件,caption=选入,needRightControl=false)
function cb_import_onClick(sheet, cell, button) {
    book.getWorkSheet("detail").paintPermit = false;
    let row = book.getDataSource("dzpz_dymx").currentBindRow;

    for (var i = 0; i < $q_pzdjex_ds.getRowCount(); i++) {
        if ($q_pzdjex_ds.getString(i, "selected") == '1') {
            if ($dzpz_dymx_ds.getString(row, "pzh") != '' || row < 0) row = $dzpz_dymx_ds.insertRow(row + 1);
            $dzpz_dymx_ds.setValue(row, {
                pzh: $q_pzdjex_ds.getValue(i, "pzh"),
                kmdm: $q_pzdjex_ds.getValue(i, "kmdm"),
                code: $q_pzdjex_ds.getValue(i, "code"),
                memo: $q_pzdjex_ds.getString(i, "bz")
            });
        }
    }
    book.getDataSource("dzpz_dymx").currentBindRow = row;
    book.getWorkSheet("detail").View.insureSelectionOnScreen(null, false);
    do_removeDuplicated(); //删除重复项

    //********删除行号***********************************
    book.getWorkSheet("凭证资料查询").paintPermit = false;
    for (var i = $q_pzdjex_ds.getRowCount() - 1; i >= 0; i--) {
        if ($q_pzdjex_ds.getString(i, "selected") == '1') $q_pzdjex_ds.deleteRow(i);
    }
    book.getWorkSheet("凭证资料查询").paintPermit = true;
    //**************************************************

    book.getWorkSheet("detail").paintPermit = true;
    book.getWorkSheet("main").paintPermit = true;
}

/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=按钮点击事件,caption=,needRightControl=false)
function cb_opensheet_dr_onClick(sheet, cell, button) {
    book.getWorkSheet("凭证列表").float('fa fa-cog', "导入凭证列表",
        {
            my: 'right-center',
            at: 'right-center',
            autoposition: 'down',
            offsetX: -5,
            offsetY: 5
        }, { width: 400, height: '80%' });

}

/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=按钮点击事件,caption=粘贴界面导入,needRightControl=false)
function cb_dr_onClick(sheet, cell, button) {

    book.getWorkSheet("detail").paintPermit = false;
    let row = book.getDataSource("dzpz_dymx").currentBindRow;
    let pzlist = sheet.cells('pzlist').getValueString().split('\n');
    for (let i = 0; i < pzlist.length; i++) {
        if (pzlist[i] !== '') {
            if ($dzpz_dymx_ds.getString(row, "pzh") != '' || row < 0) row = $dzpz_dymx_ds.insertRow(row + 1);

            $dzpz_dymx_ds.setValue(row, {
                pzh: pzlist[i]
            });
        }
    }
    sheet.cells('pzlist').setValue(null);
    sheet.floatPanelClose();

    book.getWorkSheet("detail").paintPermit = true;

}
/**
 * 单元格因为被编辑而改变。当用户通过编辑单元的值而让单元格发生值改变时本事件被触发。
 * 注意，当使用脚本 sheet.cells(row,col).setValue ( value) 来改变单元格的值时，本事件并不触发
 * @param sheet
 * @param cell
 * @param newValue
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行发生变化
 */
function cellValueChangedByEdit(sheet, cell, newValue, innerRow) {

    //通过数据库绑定情况来判断

    //通过别名来判断
    if (sheet.name == 'detail' && cell.alias == 'st_selectAll') {
        let ds = $dzpz_dymx_ds;
        sheet.paintPermit = false;
        for (var i = 0; i < ds.getRowCount(); i++) {
            ds.setValue(i, "selected", newValue);
        }
        sheet.paintPermit = true;
    }
    if (sheet.name == '凭证资料查询' && cell.alias == 'st_selectAll') {
        let ds = $q_pzdjex_ds;
        sheet.paintPermit = false;
        for (var i = 0; i < ds.getRowCount(); i++) {
            ds.setValue(i, "selected", newValue);
        }
        sheet.paintPermit = true;
    }

    let bind = cell.bind;
    if (bind != null && bind.dataSource == 'dzpz_dymx' && bind.DBCol == 'pzh') {
        showInfoPane('*正在分析凭证号');
        setTimeout(function () {
            do_paste_pzlist(innerRow, newValue) //写入凭证号
        }, 100);
    }
    if (bind != null && bind.dataSource == 'dzpz_dy' && bind.DBCol == 'reader') {
        $dzpz_dy_ds.setValue(0, {
            watermark: '【' + $dzpz_dy_ds.getString(0, "reader") + '】仅用于项目专项审计或检查' 
        })
    }



}

/**
 * 单元格编辑时粘贴内容后触发此事件。
 * @param sheet
 * @param cell
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行被粘贴了内容
 * @param text 当前单元格编辑框中的内容，并不一定是粘贴的内容，是单元格编辑框中原有的内容加上粘贴的内容
 */
//@comment (group=单元格事件,caption=单元格粘贴内容)
function cellOnPaste(sheet, cell, innerRow, text) {

    //通过别名来判断
    if (cell.alias == 'XXX') {

    }

    //通过数据库绑定情况来判断
    let bind = cell.bind;
    if (bind != null && bind.dataSource == 'dzpz_dymx' && bind.DBCol == 'pzh') {
        sheet.View.forceCurrentEditControlGiveUpFocus();
    }

}


/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=do,caption=凭证列表粘贴凭证清单后自动后插并赋值,needRightControl=false)
function do_paste_pzlist(innerRow, newValue) {

    if (newValue == null || newValue == '') return;
    let data = newValue.split(' ');
    book.getWorkSheet("detail").paintPermit = false;
    let row = innerRow;
    for (let i = 0; i < data.length; i++) {
        //row = $dzpz_dymx_ds.insertRow(row + 1);
        if (data[i] != '') {
            $dzpz_dymx_ds.setValue(row, {
                pzh: data[i],
                selected: 1
            });
            if (i < data.length - 1) row = $dzpz_dymx_ds.insertRow(row + 1);
        }
    }
    book.getDataSource("dzpz_dymx").currentBindRow = row;
    book.getWorkSheet("detail").View.insureSelectionOnScreen(null, false);
    do_removeDuplicated(); //删除重复项
    book.getWorkSheet("detail").paintPermit = true;
    book.getWorkSheet("main").paintPermit = true;
    hideInfoPane();
}







//@comment (group=,caption=异步打包,needRightControl=false)
function async_package() {

    if (form.isSaveNeeded()) {
        toastr.info("请先保存");
        return;
    }

    let ids = [];
    for (let i = 0; i < $dzpz_dymx_ds.rowCount; i++) {
        if ($dzpz_dymx_ds.getString(i, "pz_id") == '') {
            toastr.error("第" + (i + 1) + "行的凭证号不存在，请核对");
            return;
        }
        ids.push($dzpz_dymx_ds.getString(i, "pz_id"));
    }

    if (ids.length == 0) {
        toastr.info("没有凭证清单");
        return;
    }

    $confirm('', '确信要重新打包吗?', function () {
        showInfoPane("*正在后台打包...");
        let fileName = $dzpz_dy_ds.getString(0, "reader") +
            formatDate(newDate(), "yyyy.MM.dd HH:mm") + "调阅凭证.zip";
        runTask("后台打包", {
            gguid: currentGUID(),
            fileName: fileName,
            ids: ids,
            watermark: $dzpz_dy_ds.getInt(0, "needwatermark") == 0 ? "" : ($dzpz_dy_ds.getString(0, "reader") + "/" + formatDate($dzpz_dy_ds.getValue(0, "billdate"), "yyyy.MM.dd HH:mm") + "\n" + $dzpz_dy_ds.getString(0, "watermark")),
            mergePDF: $dzpz_dy_ds.getString(0, "filetype") == 'pdf' //是否合并成一个pdf文件
        },
            function (ret) {
                ret = JSON.parse(ret);
                hideInfoPane();
                if (ret.success) {
                    $dzpz_dy_ds.setValue(0, "ziptaskid", ret.zipTaskId);
                    form.save(false);
                    hideInfoPane();

                } else {
                    toastr.error(ret.message);
                }
            });

    });


}

//@comment (group=按钮点击事件,caption=标记重复,needRightControl=false)
function cb_qc_onClick() {
    showInfoPane("*正在检测重复的凭证");
    var map = {};
    for (var i = 0; i < $dzpz_dymx_ds.rowCount; i++) {
        var pzh = $dzpz_dymx_ds.getString(i, "pzh");
        if (pzh == '') continue;
        if (map[pzh] == undefined) map[pzh] = []; //每个凭证号映射到一个数组，记录它所在的行号
        map[pzh].push(i); // 记录下凭证号对应的行号

    }

    book.getWorkSheet('detail').paintPermit = false;
    for (pzh in map) {
        var rows = map[pzh];
        $dzpz_dymx_ds.setValue(rows[0], "bz", "");
        for (var i = 1; i < rows.length; i++) {
            $dzpz_dymx_ds.setValue(rows[i], "bz", "与第" + (rows[0] + 1) + "行重复");
        }
    }
    book.getWorkSheet('detail').paintPermit = true;
    hideInfoPane();
}

//@comment (group=按钮点击事件,caption=删除重复的,needRightControl=false)
function cb_removeDuplicated_onClick() {

    $confirm('', '确信要清除重复的凭证号吗?', function () {

        do_removeDuplicated()

    });

}


//@comment (group=do,caption=执行删除重复的,needRightControl=false)
function do_removeDuplicated() {

    showInfoPane("*正在删除重复的凭证");
    book.getWorkSheet('detail').paintPermit = false;
    var pzhs = []; //凭证号清单
    var rows = [];// 需要删除的行号
    for (var i = 0; i < $dzpz_dymx_ds.rowCount; i++) {
        var pzh = $dzpz_dymx_ds.getString(i, "pzh");
        if (pzhs.contains(pzh)) //此凭证号此前已经出现过
        {
            rows.push(i);//  需要删除
        } else {
            pzhs.push(pzh); //没有出现过，那么加它到凭证号清单中
        }
    }
    //现在反着删除
    for (var i = rows.length - 1; i >= 0; i--) {
        $dzpz_dymx_ds.deleteRow(rows[i]);
    }
    //form.save(false);
    book.getWorkSheet('detail').paintPermit = false;
    hideInfoPane();
}



/**
 * 按钮点击事件
 * 当某个按钮被点击时， 首先触发  {按钮名称}_onClick 事件，然后触发 buttonOnClick事件
 * @param sheet  工作表
 * @param cell   按钮所在的单元格
 * @param button 按钮对象
 */
//@comment (group=按钮点击事件,caption=批量删除已选中记录,needRightControl=false)
function cb_selectedRow_delete_onClick(sheet, cell, button) {
    $confirm("提示", "确定要删除选中的记录吗?", function () {
        book.getWorkSheet('detail').paintPermit = false;
        for (let i = $dzpz_dymx_ds.getRowCount() - 1; i >= 0; i--) {
            if ($dzpz_dymx_ds.getInt(i, "selected") == 1) $dzpz_dymx_ds.deleteRow(i);
        }
        if ($dzpz_dymx_ds.getRowCount() == 0) $dzpz_dymx_ds.insertRow(0);
        book.getWorkSheet('detail').cells("st_selectAll").setValue(0);
        book.getWorkSheet('detail').paintPermit = true;
    }, function () { });



}


id: 646b0638993236a03f8f8a5a
pid: 6183205499328c3820c0c8d9
name: script_h5
nodetype: column
createdate: 2023.05.22 14:05:51.000
lastmodifieddate: 2023.12.06 10:50:18.708
value:
var pzh_prefix;
var pzh_length;

var fullScreenDiv = null;



function formOpen() {
    book.showTabOnWhere = 'none';
    //加载帐套信息及年月
    var corpid = book.getWorkSheet("filter").cells("corpid").getValueString();
    runTask("当前记帐期", { corpid: corpid }, function (ym) {
        if (ym == null || ym == 'null') return;
        //得到年月后，获取凭证号相关设置
        pzh_len = getPZHLen(corpid);

        book.getWorkSheet("filter").cells("ym").setValue(ym);

        pzh_prefix = getPZHPrefix(corpid, ym);
        book.getWorkSheet("filter").cells("pzh_prefix").setValue(pzh_prefix);


    });

    // 追加一些CSS类 ，用于凭证号标记
    $(document.body).append(`<style>
                        .pzh {position:absolute;left:0;bottom:0px; 
                                height:24px; line-height:24px;width:100%; 
                                background-color:#40af40a0; 
                                color:white;font-weight:bold;font-size:12px;text-align:center;}
                        .delete_pzh { position:absolute; right:0; width:40px; height:14px; top:0; text-align:right; 
                                    vertical-align:top; font-size:12px; color:gray;padding-right:5px;}      
                        .delete_pzh:hover { color:white;}      
                          
                        </style>
                    `);


}



/**
 * 多行结果集当前焦点行发生变化
 * @param dsname  结果集名称
 * @param row  行号
 */
function currentBindRowChanged(dsname, row) {
    if (dsname == 'dzpz_pz') {
        //重新加载凭证图片列表

        let id = $dzpz_pz_ds.getString(row, "id");
        let pzh = $dzpz_pz_ds.getString(row, "pzh");
        loadPZ(pzh, id);

    }
}

/**
 * 单元格的值发生了改变
 * @param sheet  所在的工作表
 * @param cell  单元格对象
 * @param oldValue  原先的值
 * @param newValue 变化后的值
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行发生变化
 */
function cellValueChanged(sheet, cell, oldValue, newValue, innerRow) {

    //如果是绑定了数据库的，强烈不建议使用本事件，换用结果集变化事件 itemChanged

    //通过别名来判断
    if (cell.alias == 'ym') {
        var corpid = book.getWorkSheet("filter").cells("corpid").getValueString();
        var ym = book.getWorkSheet("filter").cells("ym").getValue();

        pzh_prefix = getPZHPrefix(corpid, ym);
        book.getWorkSheet("filter").cells("pzh_prefix").setValue(pzh_prefix);
    }




}

function loadPZ(pzh, id) {
    let data = getPZFJ(id); //得到凭证的所有图片
    let FJ = book.getWorkSheet("凭证详情").getBrick('FJ');
    FJ.buildGridly(data, function () {
        let shortPZH = pzh;//.substring(pzh_prefix.length);
        //加载图片完成后， 如果是凭证，那么加上凭证号信息
        for (let i = 0; i < data.length; i++) {
            if (data[i].groupname == '凭证') {
                setPZH(data[i].id, shortPZH, false);
            }
        }

    });
    book.getWorkSheet("凭证详情").yOffset = 0; //垂直卷滚条归位
}


//@comment (group=凭证号,caption=设置图片的凭证号,needRightControl=false)
function setPZH(id, pzh, needDeleteButton) {
    if (needDeleteButton == undefined) needDeleteButton = true
    find_pzh(id, true, needDeleteButton).find('.no').text(pzh);
}

//@comment (group=凭证号,caption=查找或创建凭证号标记对象,needRightControl=false)
function find_pzh(id, create_if_not_exists, needDeleteButton) {

    if (needDeleteButton == undefined) needDeleteButton = true;

    var d = $('#' + id);
    if (!d) {
        $.alert(id + "不存在");
        return null;
    }

    var ret = d.find('.pzh');
    if (ret.length == 0) {
        if (create_if_not_exists) //如果需要创建，则创建它
        {
            d.append(`<div class="pzh" >
                        <div class="no"></div>
                        <div class="delete_pzh"  ${needDeleteButton ? "" : " style='display:none' "} ><i class="fa fa-close" onclick="removePZH('${id}');  event.preventDefault(); event.stopPropagation();"> </i></div>
                      </div>`);
        }
        ret = d.find('.pzh');
    }
    return ret;

}



/**
 * 单元格单击事件
 * @param sheet
 * @param cell
 * @param innerRow   当单元格没有绑定数据库或绑定到单行数据库时，本参数无意义。如果绑定一个
 * 多行数据库，则表示该单元所绑定的字段的第 innerRow行被点击
 * @param event 事件对象
 */
//@comment (group=单元格事件,caption=单元格点击)
function cellOnClick(sheet, cell, innerRow, event) {

    //通过别名来判断
    if (cell.alias == 'XXX') {

    }

    //通过数据库绑定情况来判断
    let bind = cell.bind;
    if (bind != null && bind.dataSource == 'dzpz_pz') {

    }

}

//@comment (group=工具函数,caption=全选或取消全选)
function seletOrUnSelectAll() {
    //让selection单元格失去编辑焦点，不然再点击，它不会触发单元格的点击事件，因为此时点击的编辑框对象，不会触发单元格的点击
    book.getWorkSheet("list").View.forceCurrentEditControlGiveUpFocus();

    var v = book.getWorkSheet("list").cells('selection').getValueInt();

    book.getWorkSheet("list").paintPermit = false;
    $dzpz_pz_ds.setValueWithTrigger = false;
    for (var i = 0; i < $dzpz_pz_ds.rowCount; i++) {
        $dzpz_pz_ds.setValue(i, "selected", v);
    }
    $dzpz_pz_ds.setValueWithTrigger = true;
    book.getWorkSheet("list").paintPermit = true;
}




/**
 * 图片控件初始化完成
 * @param sheet   所在Sheet
 * @param config  图片控件的名称
 *@param data  该图片的详细信息
 *
 */
//@comment (group=图片控件,caption=图片控件初始化完成)
function imageGridlyInited(sheet, name, data) {


    if (name == "FJ") {
        let brick = sheet.getBrick(name);
        brick.addToolButton(1  //在从右往左数第2个工作栏位置添加一个工具按钮
            , "fa-print",   // 字符图标
            "打印图片",  // 鼠标悬停的提示信息
            "green", //按钮背景色
            function (id) {  //点击后的回调函数
                imagePrint(brick, id);

            }
        );


    }
}


function imagePrint(brick, id) {

    if ( ! isRoleGrantedToUser( currentUserId(), "凭证影像打印") ) 
    {
        toastr.error('抱歉，您无此权限');
        return;
    }
    //把数据中的图片替换，
    for (let i = 0; i < brick.data.length; i++) {
        if (brick.data[i].id == id) {
            //属性从新的属性中替换 
            let url = brick.data[i].url_img;
            printThisWindow(url);
            break;
        }
    }

}

function printThisWindow(imgSrc) {
    let iframe = document.createElement('IFRAME')
    let doc = null
    iframe.setAttribute('class', 'print-iframe')
    iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;')
    document.body.appendChild(iframe)
    doc = iframe.contentWindow.document
    // 取一个不重复的方法名称，可以随机字符串
    doc.___imageLoad___ = function () {
        iframe.contentWindow.print()
        if (navigator.userAgent.indexOf('MSIE') > 0) {
            document.body.removeChild(iframe)
        }
    }
    doc.write('<div style="height: 100%;width: 100%;">' + `<img src="${imgSrc}" style="max-height:100%;max-width: 100%;" onload="___imageLoad___()"/>` + '</div>')
    doc.close()
    iframe.contentWindow.focus()
}

/**
 * 图片控件中显示大图时添加水印图片
 * @param sheet   所在Sheet
 * @param name  图片控件的名称

 * @return  返回水印图片的url地址 ，如果返回  '' 则表示不添加水印图片
 */
//@comment (group=图片控件,caption=鼠标在某个图片上释放)
function imageOnPopupWithWatermark(sheet , name ) {

    var info= currentUserShowName( ) +""+ formatDate( new Date() , "yyyy.MM.dd-HH:mm");
    
    return "watermark?watermark="+info;
    
}


id: 653a2ba49932b5260b04c5de
pid: 60a31c475db27838e0c01344
name: pagesetup-5ecfeb4bf86a555c982f4d1afa01015d
nodetype: column
createdate: 2023.10.26 17:05:16.000
lastmodifieddate: 2023.12.06 10:50:18.708
value:
{"pageWidth":"210","pageHeight":"297","leftMargin":"20","topMargin":"20","rightMargin":"20","bottomMargin":"20","paper":"210*297","printDir":1,"pageHeaderConfig":{"define":"","height":"20"},"pageFooterConfig":{"define":"=\"第 \"+pageIndex()+\" 页，共 \"+pageCount()+\" 页\"","height":"20"},"printScale":"0","printerDeviceName":"HP LaserJet Tank 250x"}


id: 655a1eb99932174d03378092
pid: 655a1eb99932174d03378091
name: ui
nodetype: column
createdate: 2023.11.19 22:42:39.000
lastmodifieddate: 2023.12.06 10:50:18.709
value:
{"version":"1.0","sheetcount":1,"gui":true,"theme":"default","showTabOnBottom":false,"runtimeOptions":{},"sheets":[{"index":0,"rowCount":12,"columnCount":13,"guid":"60b2670ecb842f477d57edc3710b9da0","name":"Sheet1","gridLineVisible":false,"freezedRow":7,"freezedCol":0,"bottomFreezedRow":0,"ignoreBeforeRowWhenPrinting":0,"forDevice":"all","canSetColumnVisible":false,"rows":[{"index":0,"height":50,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":1,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":2,"height":17,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":3,"height":32,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":4,"height":32,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":5,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":6,"height":32,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":7,"height":32,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":8,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":9,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":10,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":11,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0}],"columns":[{"index":0,"width":9,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":1,"width":49,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":2,"width":39,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":3,"width":114,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":4,"width":38,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":5,"width":80,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":6,"width":65,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":7,"width":103,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":8,"width":100,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":9,"width":93,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":10,"width":167,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":11,"width":100,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":12,"width":100,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false}],"focusRange":[],"cells":[{"row":0,"col":0},{"row":0,"col":1,"define":"= nian*100 + yue ","cellValueType":1,"rowSpan":1,"colSpan":2,"PI":0,"bind":{"dataSource":"uploadpz","DBCol":"ym","dsType":1}},{"row":0,"col":3,"define":"凭证影像PDF批量导入","rowSpan":1,"colSpan":5,"PI":1},{"row":0,"col":8},{"row":0,"col":9},{"row":0,"col":10},{"row":0,"col":11},{"row":0,"col":12},{"row":2,"col":0},{"row":2,"col":1},{"row":2,"col":2},{"row":2,"col":3},{"row":2,"col":4},{"row":2,"col":5},{"row":2,"col":6},{"row":2,"col":7},{"row":2,"col":8},{"row":2,"col":9,"PI":2},{"row":2,"col":10},{"row":2,"col":11},{"row":2,"col":12},{"row":3,"col":0},{"row":3,"col":1,"define":"*帐  套","rowSpan":1,"colSpan":2,"PI":3},{"row":3,"col":3,"define":"00","editable":true,"cellValueType":3,"rowSpan":1,"colSpan":3,"alias":"corpid","PI":4,"bind":{"dataSource":"uploadpz","DBCol":"corpid","dsType":1},"editstyle":{"editType":4,"ddlbName":"basic_账套列表(code2name)-全称","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbMultiSelect":false,"ddlbFilterContext":"","ddlbInnerItems":"","showRealData":false,"columnCount":null}},{"row":3,"col":6,"define":"*年  份","PI":3},{"row":3,"col":7,"editable":true,"cellValueType":1,"alias":"nian","PI":5,"bind":{"dataSource":"uploadpz","DBCol":"y","dsType":1},"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":true,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbMultiSelect":false,"ddlbFilterContext":"","ddlbInnerItems":"2040\n2039\n2038\n2037\n2036\n2035\n2034\n2033\n2032\n2032\n2030\n2029\n2028\n2027\n2026\n2025\n2024\n2023\n2022\n2021\n2020\n2019\n2018\n2017\n2016\n2015\n2014\n2013\n2012\n2011\n2010","showRealData":false,"columnCount":null}},{"row":3,"col":8,"define":"*月  份","PI":6},{"row":3,"col":9,"editable":true,"cellValueType":1,"alias":"yue","PI":7,"bind":{"dataSource":"uploadpz","DBCol":"m","dsType":1},"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":true,"ddlbFilterBy":"","ddlbMultiSelect":false,"ddlbFilterContext":"","ddlbInnerItems":"1;1月\n2;2月\n3;3月\n4;4月\n5;5月\n6;6月\n7;7月\n8;8月\n9;9月\n10;10月\n11;11月\n12;12月","showRealData":false,"columnCount":null}},{"row":3,"col":10,"PI":8,"bricks":[{"type":"button","name":"cb_upload","config":{"name":"cb_upload","caption":" 上传目录","enable":true,"visible":true,"size":"1","className":"","x":30,"y":1,"width":-1,"height":-1,"buttonStyle":"default","buttonColorStyle":"primary","leftIcon":"fa-paper-plane","rightIcon":"","DOMName":"cb_upload-75027401f0a6cabb7e6c1b1e84310765","html":" \n                <button class=\"btn  btn-primary btn-xs\" \n                        id=\"cb_upload-75027401f0a6cabb7e6c1b1e84310765\">\n                       <i class='fa fa-paper-plane'></i> 上传目录\n                </button>\n                "},"x":30,"y":1,"width":-1,"height":-1}]},{"row":3,"col":11},{"row":3,"col":12},{"row":4,"col":0,"PI":9},{"row":4,"col":1,"define":" 备  注","rowSpan":1,"colSpan":2,"PI":10},{"row":4,"col":3,"editable":true,"cellValueType":3,"rowSpan":1,"colSpan":5,"PI":11,"bind":{"dataSource":"uploadpz","DBCol":"summary","dsType":1}},{"row":4,"col":8,"define":" 凭证份数","PI":10},{"row":4,"col":9,"define":"=count(pzh)","cellValueType":1,"PI":12,"bind":{"dataSource":"uploadpz","DBCol":"pzfs","dsType":1}},{"row":4,"col":10,"PI":8},{"row":4,"col":11},{"row":4,"col":12},{"row":5,"col":0},{"row":5,"col":1,"PI":13},{"row":5,"col":2,"PI":13},{"row":5,"col":3,"PI":13},{"row":5,"col":4,"PI":13},{"row":5,"col":5,"PI":13},{"row":5,"col":6,"PI":13},{"row":5,"col":7,"PI":13},{"row":5,"col":8,"PI":13},{"row":5,"col":9,"PI":13},{"row":5,"col":10,"PI":14},{"row":5,"col":11},{"row":5,"col":12},{"row":6,"col":0,"PI":9},{"row":6,"col":1,"define":"序号","PI":15},{"row":6,"col":2,"define":"凭证号","rowSpan":1,"colSpan":3,"PI":15},{"row":6,"col":5,"define":"上传文件保存地址","rowSpan":1,"colSpan":3,"PI":15},{"row":6,"col":8,"define":"说明","rowSpan":1,"colSpan":3,"PI":15},{"row":6,"col":11,"PI":16},{"row":6,"col":12},{"row":7,"col":0,"PI":9},{"row":7,"col":1,"PI":17,"bind":{"dataSource":"uploadpzmx","DBCol":"c_inner_xh","dsType":2}},{"row":7,"col":2,"cellValueType":3,"rowSpan":1,"colSpan":2,"alias":"pzh","PI":18,"bind":{"dataSource":"uploadpzmx","DBCol":"pzh","dsType":2}},{"row":7,"col":4,"cellValueType":1,"alias":"state","PI":18,"bind":{"dataSource":"uploadpzmx","DBCol":"state","dsType":2},"editstyle":{"editType":4,"ddlbName":"","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbMultiSelect":false,"ddlbFilterContext":"","ddlbInnerItems":"1;√\n0;X","showRealData":false,"columnCount":null}},{"row":7,"col":5,"cellValueType":3,"rowSpan":1,"colSpan":3,"alias":"url","PI":18,"bind":{"dataSource":"uploadpzmx","DBCol":"url","dsType":2}},{"row":7,"col":8,"cellValueType":3,"rowSpan":1,"colSpan":3,"alias":"info","PI":19,"bind":{"dataSource":"uploadpzmx","DBCol":"info","dsType":2}},{"row":7,"col":11,"PI":16},{"row":7,"col":12},{"row":8,"col":0},{"row":8,"col":1,"PI":20},{"row":8,"col":2,"PI":20},{"row":8,"col":3,"PI":20},{"row":8,"col":4,"PI":20},{"row":8,"col":5,"PI":20},{"row":8,"col":6,"PI":20},{"row":8,"col":7,"PI":20},{"row":8,"col":8,"PI":20},{"row":8,"col":9,"PI":20},{"row":8,"col":10,"PI":20},{"row":8,"col":11},{"row":8,"col":12}]}],"propertyCache":{"fa469aad74cdc689d4b3e9bc6bdfe6a2":{"text-align":1,"font-size":22},"f91620f7bf176a48668c6fd1fb5b0f00":{"font-size":22},"125018f3eef635c9d10037c06e4a0236":{"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"91ed707a7c2e38e5870d57b6728c9526":{"border-left-style":1,"border-left-width":1,"border-left-color":[214,219,223,1],"border-top-style":1,"border-top-width":1,"border-top-color":[214,219,223,1],"border-right-style":1,"border-right-width":1,"border-right-color":[214,219,223,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(244, 246, 246)","font-size":"12","color":"rgb(40, 55, 71)","text-align":2},"8552f01f1a00567cad1dd2573fa42231":{"border-left-style":1,"border-left-width":1,"border-left-color":[214,219,223,1],"border-top-style":1,"border-top-width":1,"border-top-color":[214,219,223,1],"border-right-style":1,"border-right-width":1,"border-right-color":[214,219,223,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(248, 249, 249)","font-size":12,"color":"rgb(40, 55, 71)"},"c26a8df6b2a166fff7ed45f30a1e03af":{"border-left-style":1,"border-left-width":1,"border-left-color":[214,219,223,1],"border-top-style":1,"border-top-width":1,"border-top-color":[214,219,223,1],"border-right-style":1,"border-right-width":1,"border-right-color":[214,219,223,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(255, 255, 255)","font-size":"12","color":"rgb(40, 55, 71)","text-align":2},"717e3cc45184b13560792fe312ef2af4":{"border-left-style":1,"border-left-width":1,"border-left-color":[214,219,223,1],"border-top-style":1,"border-top-width":1,"border-top-color":[214,219,223,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(242, 244, 244)","font-size":"12","color":"rgb(40, 55, 71)","text-align":2},"7bbd7ab2ac3c051354a6dc6b2a664cb4":{"font-size":"12","color":"rgb(40, 55, 71)","text-align":2,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"d26a242ebb6a71305473ca925688d0fe":{"font-size":12,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1]},"47a00a41624c6383ac8392dd4e2d2817":{"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1]},"780dd912f5df88d90fb3d1acfeff6b8f":{"font-size":12,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"text-align":2,"background-color":"rgb(244, 246, 246)"},"80b6b48d38e7a2491335478b2efc48af":{"font-size":12,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1]},"6b10049395cc9b41066e8ea702153568":{"font-size":12,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"text-align":2},"0d82eed92c594da113a7fea5f6c1f3eb":{"font-size":12,"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"6d0d36ad07bc633c62da46fe16b2a6ab":{"font-size":12,"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"dc264b867d42731f3587f43c50f8518f":{"font-size":12,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"background-color":"rgb(244, 246, 246)"},"20118c09fa9c7e8fb2753e163d4f4c03":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1]},"7957a5c8f92f1977ba5ff81fdec5e65e":{"font-size":12,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"text-align":2},"588be1a97e459c2fa25cf3e7119b9cec":{"font-size":12,"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"c67619febef652ef9e01b8a1125b9d16":{"font-size":12,"word-wrap":true,"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1]},"fc406aa51250ead084dba7e6ed9e7117":{"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1]}},"propertyIdList":["fa469aad74cdc689d4b3e9bc6bdfe6a2","f91620f7bf176a48668c6fd1fb5b0f00","125018f3eef635c9d10037c06e4a0236","91ed707a7c2e38e5870d57b6728c9526","8552f01f1a00567cad1dd2573fa42231","c26a8df6b2a166fff7ed45f30a1e03af","717e3cc45184b13560792fe312ef2af4","7bbd7ab2ac3c051354a6dc6b2a664cb4","d26a242ebb6a71305473ca925688d0fe","47a00a41624c6383ac8392dd4e2d2817","780dd912f5df88d90fb3d1acfeff6b8f","80b6b48d38e7a2491335478b2efc48af","6b10049395cc9b41066e8ea702153568","0d82eed92c594da113a7fea5f6c1f3eb","6d0d36ad07bc633c62da46fe16b2a6ab","dc264b867d42731f3587f43c50f8518f","20118c09fa9c7e8fb2753e163d4f4c03","7957a5c8f92f1977ba5ff81fdec5e65e","588be1a97e459c2fa25cf3e7119b9cec","c67619febef652ef9e01b8a1125b9d16","fc406aa51250ead084dba7e6ed9e7117"]}


id: 655a1eb99932174d03378094
pid: 655a1eb99932174d03378091
name: rightcheckpoint
nodetype: column
createdate: 2023.11.19 22:42:39.000
lastmodifieddate: 2023.12.06 10:50:18.709
value:
{"60b2670ecb842f477d57edc3710b9da0":{"name":"Sheet1","buttonClick":[{"name":"cb_upload","title":" 上传目录"}]}}


id: 655a1eb99932174d03378095
pid: 655a1eb99932174d03378091
name: db
nodetype: column
createdate: 2023.11.19 22:42:39.000
lastmodifieddate: 2023.12.06 10:50:18.709
value:
[{"name":"uploadpz","label":"上传已归档凭证","type":"table","dbpool":"default","description":"","multirow":false,"rowcount":1,"orderby":"billdate desc","autoretrieve":true,"dynamicwhere":"","dynamicwhere2":"","dynamicwheredata2":"","table_query_id":"655a1eb99932174d0337809b","column":[{"name":"id","label":"ID","description":"ID","type":"decimal(20,0)","nullable":false,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"gguid","label":"GGUID","description":"gguid","type":"decimal(20,0)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"corporationid","label":"企业ID","description":"企业ID","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"deleteflag","label":"删除标记","description":"删除标记，1表示删除","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"0","dbdefaultvalue":"0"},{"name":"billno","label":"单据号","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"billtype","label":"单据类型","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"billdate","label":"制单日期","description":"制单日期","type":"datetime","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"userid","label":"制单人ID","description":"制单人ID","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"username","label":"制单人","description":"制单人","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"attachmentcount","label":"附件个数","description":"上传的附件个数","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"verifierid","label":"审核人ID","description":"审核人ID","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"verifiername","label":"审核人","description":"审核人","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"verifieddate","label":"审核日期","description":"审核日期","type":"datetime","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"lastmodifieddate","label":"数据最后修改日期","description":"数据最后修改日期","type":"datetime","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"summary","label":"备注","description":"备注","type":"varchar(200)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"billprinttimes","label":"单据打印次数","description":"单据打印次数","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"open_bill_with_url","label":"单据打开使用的地址","description":"单据打开使用的地址","type":"varchar(300)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"pzfs","label":"凭证份数","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"ym","label":"年月","description":"","type":"int","nullable":false,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"false","usedingroupby":"false","usedinsum":"false","defaultvalue":"","dbdefaultvalue":""},{"name":"y","label":"年","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"m","label":"月","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"corpid","label":"帐套","description":"","type":"varchar(40)","nullable":false,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"false","usedingroupby":"false","usedinsum":"false","defaultvalue":"","dbdefaultvalue":""}],"computer":[]},{"name":"uploadpzmx","label":"上传凭证清单","type":"table","dbpool":"default","description":"","multirow":true,"rowcount":0,"orderby":"inner_xh asc","autoretrieve":true,"dynamicwhere":"","dynamicwhere2":"","dynamicwheredata2":"","table_query_id":"656599ef9932affff3d38af1","column":[{"name":"id","label":"ID","description":"ID","type":"decimal(20,0)","nullable":false,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"gguid","label":"GGUID","description":"gguid","type":"decimal(20,0)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"corporationid","label":"企业ID","description":"企业ID","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"deleteflag","label":"删除标记","description":"删除标记，1表示删除","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"0","dbdefaultvalue":"0"},{"name":"inner_xh","label":"序号","description":"序号","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"lastmodifieddate","label":"数据最后修改日期","description":"数据最后修改日期","type":"datetime","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"pzh","label":"凭证号","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"url","label":"pdf文件路径","description":"","type":"varchar(1000)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"state","label":"状态","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"info","label":"提示信息","description":"","type":"text","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"true","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""}],"computer":[{"name":"c_inner_xh","label":"序号","expression":"thisrow()+1","description":"","fillback":"inner_xh"},{"name":"c_db_insertrowafter","label":"后插","expression":"innerAction('\\uf067 插入','insertRowAfter')","description":"将本计算列绑定到单元格，字体设置成FontAwesome，点击此单元格即可在本结果集中后插一行","fillback":""},{"name":"c_db_insertrowbefore","label":"前插","expression":"innerAction('\\uf055 前插','insertRowBefore')","description":"将本计算列绑定到单元格，字体设置成FontAwesome，点击此单元格即可在本结果集中后插一行","fillback":""},{"name":"c_db_deleterow","label":"删除","expression":"innerAction('\\uf014 删除','deleteRow')","description":"将本计算列绑定到单元格，字体设置成FontAwesome，点击此单元格即可删除当前行","fillback":""}]}]


id: 655a1eb99932174d03378096
pid: 655a1eb99932174d03378091
name: script
nodetype: column
createdate: 2023.11.19 22:42:39.000
lastmodifieddate: 2023.12.06 10:50:18.709
value:
function cb_upload_onClick() {


    form.save(false, function () {
        let corpid = $uploadpz_ds.getString(0, "corpid");
        let ym = $uploadpz_ds.getString(0, "ym");
        if (ym == 0) {
            toastr.error('请选择年，月');
            return;
        }

        do_upload( corpid ,ym);

    });
}


function do_upload( corpid  ,ym) {
    uploadFolder( {
            fileType: "pdf",
            serverIndex: 1,
            logTable: 'app_archive',
            tableName: 'dzpz_pz',
            gguid: '', //
            path: "凭证归档/" + corpid + "/" + ym

        },
        {
            threadCount: 4,

            //一个文件上传成功后，创建相应的凭证记录
            onFileUploaded: function (data, file) {
                console.dir(data);

                let row = $uploadpzmx_ds.insertRow(99999);
                let pzh = data.filename;
                pzh = pzh.substring(pzh.lastIndexOf("/") + 1, pzh.lastIndexOf("."));
                toastr.show(pzh);
                $uploadpzmx_ds.setValue(row, "pzh", pzh);
                $uploadpzmx_ds.setValue(row, "url", data.objectname);

                let state = 0;
                create_pz(corpid, ym, pzh, data.id, function (info) {  //创建凭证记录
                    if (info == '') {
                        state = 1;
                        info = "成功上传";
                    } else {
                        state = 0;
                    }
                    $uploadpzmx_ds.setValue(row, "state", state);
                    $uploadpzmx_ds.setValue(row, "info", info);
                    toastr.hide();
                    form.save(false);
                });

            },
            //上传进度显示 
            onUploadProgress: function (percent, file) {
                toastr.show(file.name + "  " + percent + '%');
            },

            //文件上传前做校验
            onFilter: function (  oneConfig , file ) {
                console.dir(file);
                let name = file.name.toLowerCase();
                if (!name.endsWith('.pdf')) {
                    console.info(name + "不是pdf，无需上传");
                    return false;
                }


                let pzh = name.substring(0, name.lastIndexOf('.'));

                if (pzh_exists(corpid, ym, pzh)) {
                    let row = $uploadpzmx_ds.insertRow(99999);
                    $uploadpzmx_ds.setValue(row, "pzh", pzh);
                    $uploadpzmx_ds.setValue(row, "state", 0);
                    $uploadpzmx_ds.setValue(row, "info", pzh + "已存在，禁止上传。如需覆盖，请先删除该凭证，再上传");
                    return false;
                }
                //指定上传后的文件名，但是注意，如果name 文件已经存在，那么系统会自动加序号
                oneConfig.objectName = name;

                return true;
            },

            onAllFilesUploaded: function () {
                $.alter("全部上传完成");
                toastr.hide();
            }
        }
    );
}


id: 6566caf29932bfa1d16e40ac
pid: 6566caf29932bfa1d16e40ab
name: ui
nodetype: column
createdate: 2023.11.29 13:39:18.000
lastmodifieddate: 2023.12.06 10:50:18.709
value:
{"version":"1.0","sheetcount":1,"gui":true,"theme":"default","showTabOnBottom":false,"runtimeOptions":{},"sheets":[{"index":0,"rowCount":6,"columnCount":8,"guid":"43206102ad4c9647bbb2be2f206a02b2","name":"Sheet1","gridLineVisible":false,"freezedRow":2,"freezedCol":0,"bottomFreezedRow":0,"ignoreBeforeRowWhenPrinting":0,"forDevice":"all","canSetColumnVisible":false,"rows":[{"index":0,"height":5,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":1,"height":32,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":2,"height":32,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":3,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":4,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0},{"index":5,"height":25,"isColumnScrollEnabled":true,"stretchHeight":0}],"columns":[{"index":0,"width":5,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":1,"width":100,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":2,"width":100,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":3,"width":200,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":4,"width":88,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":5,"width":100,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":6,"width":317,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false},{"index":7,"width":11,"width2":-1,"stretchWidth":0,"rowHeightAutoFit":false}],"focusRange":[],"cells":[{"row":0,"col":0},{"row":0,"col":1,"PI":0},{"row":0,"col":2,"PI":0},{"row":0,"col":3,"PI":0},{"row":0,"col":4,"PI":0},{"row":0,"col":5,"PI":0},{"row":0,"col":6,"PI":0},{"row":0,"col":7},{"row":1,"col":0,"PI":1},{"row":1,"col":1,"define":"导入日期","alias":"t_uploadpz_billdate","PI":2},{"row":1,"col":2,"define":"导入人","alias":"t_uploadpz_username","PI":2},{"row":1,"col":3,"define":"帐套","alias":"t_uploadpz_corpid","PI":2},{"row":1,"col":4,"define":"年月","alias":"t_uploadpz_ym","PI":2},{"row":1,"col":5,"define":"凭证份数","alias":"t_uploadpz_pzfs","PI":2},{"row":1,"col":6,"define":"备注","alias":"t_uploadpz_summary","PI":2},{"row":1,"col":7,"PI":3},{"row":2,"col":0,"PI":1},{"row":2,"col":1,"cellValueType":4,"alias":"uploadpz_billdate","PI":4,"bind":{"dataSource":"uploadpz","DBCol":"billdate","dsType":2}},{"row":2,"col":2,"cellValueType":3,"alias":"uploadpz_username","PI":4,"bind":{"dataSource":"uploadpz","DBCol":"username","dsType":2}},{"row":2,"col":3,"cellValueType":3,"alias":"uploadpz_corpid","PI":4,"bind":{"dataSource":"uploadpz","DBCol":"corpid","dsType":2},"editstyle":{"editType":4,"ddlbName":"basic_账套列表(code2name)-简称","dropDownListEditable":false,"valueMustInDDLB":false,"ddlbFilterBy":"","ddlbMultiSelect":false,"ddlbFilterContext":"","ddlbInnerItems":"","showRealData":false,"columnCount":null}},{"row":2,"col":4,"cellValueType":1,"alias":"uploadpz_ym","PI":4,"bind":{"dataSource":"uploadpz","DBCol":"ym","dsType":2}},{"row":2,"col":5,"cellValueType":1,"alias":"uploadpz_pzfs","PI":4,"bind":{"dataSource":"uploadpz","DBCol":"pzfs","dsType":2}},{"row":2,"col":6,"cellValueType":3,"alias":"uploadpz_summary","PI":4,"bind":{"dataSource":"uploadpz","DBCol":"summary","dsType":2}},{"row":2,"col":7,"PI":3},{"row":3,"col":0},{"row":3,"col":1,"PI":5},{"row":3,"col":2,"PI":5},{"row":3,"col":3,"PI":5},{"row":3,"col":4,"PI":5},{"row":3,"col":5,"PI":5},{"row":3,"col":6,"PI":5},{"row":3,"col":7}]}],"propertyCache":{"125018f3eef635c9d10037c06e4a0236":{"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"47a00a41624c6383ac8392dd4e2d2817":{"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1]},"b2084b9d6e9818690b2786b69ecaa97b":{"background-color":"rgb(242, 244, 244)","border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1]},"20118c09fa9c7e8fb2753e163d4f4c03":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1]},"7cbe511896ca066d9eb5f33da6326edd":{"border-left-style":1,"border-left-width":1,"border-left-color":[211,211,211,1],"border-bottom-style":1,"border-bottom-width":1,"border-bottom-color":[211,211,211,1],"border-right-style":1,"border-right-width":1,"border-right-color":[211,211,211,1],"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1]},"fc406aa51250ead084dba7e6ed9e7117":{"border-top-style":1,"border-top-width":1,"border-top-color":[211,211,211,1]}},"propertyIdList":["125018f3eef635c9d10037c06e4a0236","47a00a41624c6383ac8392dd4e2d2817","b2084b9d6e9818690b2786b69ecaa97b","20118c09fa9c7e8fb2753e163d4f4c03","7cbe511896ca066d9eb5f33da6326edd","fc406aa51250ead084dba7e6ed9e7117"]}


id: 6566caf29932bfa1d16e40af
pid: 6566caf29932bfa1d16e40ab
name: db
nodetype: column
createdate: 2023.11.29 13:39:19.000
lastmodifieddate: 2023.12.06 10:50:18.709
value:
[{"name":"uploadpz","label":"上传已归档凭证","type":"query","dbpool":"default","description":"","multirow":true,"updatedtable":"uploadpz","sql":"select * from  uploadpz   where ifnull(deleteflag,0)=0\norder by billdate desc","dynamicwhere":"","dynamicwhere2":"","dynamicwheredata2":"","primarykey":"id","autoretrieve":true,"needcache":"false","cacheserver":"","cachetimeout":30,"table_query_id":"6566caf29932bfa1d16e40b5","column":[{"name":"id","label":"ID","description":"","type":"decimal(20,0)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"gguid","label":"GGUID","description":"","type":"decimal(20,0)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"corporationid","label":"企业ID","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"deleteflag","label":"删除标记","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"billno","label":"单据号","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"billtype","label":"单据类型","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"billdate","label":"制单日期","description":"","type":"datetime","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"userid","label":"制单人ID","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"username","label":"制单人","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"attachmentcount","label":"附件个数","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"verifierid","label":"审核人ID","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"verifiername","label":"审核人","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"verifieddate","label":"审核日期","description":"","type":"datetime","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"lastmodifieddate","label":"数据最后修改日期","description":"","type":"datetime","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"summary","label":"备注","description":"","type":"varchar(200)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"billprinttimes","label":"单据打印次数","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"open_bill_with_url","label":"单据打开使用的地址","description":"","type":"varchar(300)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"pzfs","label":"凭证份数","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"ym","label":"年月","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"y","label":"年","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"m","label":"月","description":"","type":"int","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""},{"name":"corpid","label":"帐套","description":"","type":"varchar(40)","nullable":true,"smartretrieve":false,"smartretrievecolname":"","dict":"","exportformat":"","cloneable":false,"updatable":"","datamask":"","modifylog":"","usedingroupby":"","usedinsum":"","defaultvalue":"","dbdefaultvalue":""}],"computer":[{"name":"c_inner_xh","label":"序号","expression":"thisrow()+1","description":"","fillback":""},{"name":"c_form_viewbill","label":"查看单据","expression":"innerAction('\\uf06e 查看','viewBill')","description":"单据列表模板中，点击绑定此计算列的单元格可触发查看单据操作","fillback":""},{"name":"c_form_editbill","label":"编辑单据","expression":"innerAction('\\uf044 编辑','editBill')","description":"单据列表模板中，点击绑定此计算列的单元格可触发编辑单据操作","fillback":""},{"name":"c_form_deletebill","label":"删除单据","expression":"innerAction('\\uf1f8 删除','deleteBill')","description":"单据列表模板中，点击绑定此计算列的单元格可触发删除单据操作","fillback":""},{"name":"c_form_verifybill","label":"审核单据","expression":"innerAction(iif( verifierid>0 ,'\\uf02c 取消审核','\\uf02c 审核'),'verifyBill')","description":"单据列表模板中，点击绑定此计算列的单元格可触发审核/取消审核单据操作","fillback":""}]}]


# app_flow

id: 60fa63be9932563b7c99be71
pid: 60fa63be9932563b7c99be6f
appid: 606d21ab99328dc77af633f9
name: 凭证调阅审批
code: dy
namepath: /凭证影像化/凭证调阅
codepath: 60fa63be9932563b7c99be6e.60fa63be9932563b7c99be6f
fullname: /凭证影像化/凭证调阅/凭证调阅审批
fullcode: 60fa63be9932563b7c99be6e.60fa63be9932563b7c99be6f.dy
nodetype: flow
createdate: 2021.07.23 14:38:15.000
lastmodifieddate: 2023.12.06 10:50:19.270
value:
{"process":{"id":"60fa63be9932563b7c99be71","name":"凭证调阅审批","isExecutable":true},"endEvent":[{"bounds":{"x":944,"y":187,"width":38,"height":38},"nodeType":"endEvent","id":"091c005a811747c6a2b48f58663d0a7d","name":"结束"}],"userTask":[{"bounds":{"x":438,"y":180,"width":48,"height":17},"nodeType":"userTask","id":"60b3b08f27644fc18af35ba20ecd2bac","name":"调阅申请","description":"","property":"","code":"","no":"","commentTitle":"","needComment":"false","onCreateEvent":"","afterSubmitEvent":"","isFirst":true,"multiInstance":"single","notice_im":"false","notice_app":"","taskOverConditionExpression":"nrOfInstances == nrOfCompletedInstances","assignee":[]},{"bounds":{"x":622,"y":181,"width":48,"height":17},"nodeType":"userTask","id":"6655df8bedc641aa9bacf1720d13ce2d","name":"调阅审批","description":"","property":"","code":"","no":"","commentTitle":"审批意见","needComment":"true","onCreateEvent":"","afterSubmitEvent":"","isFirst":false,"multiInstance":"single","notice_im":"true","notice_app":"","taskOverConditionExpression":"nrOfInstances == nrOfCompletedInstances","assignee":[{"type":"column","id":"7d1e9bd95d470c130bf5aa6f88e29318","tableName":"dzpz_dy","columnName":"leaderid"}]},{"bounds":{"x":800,"y":180,"width":48,"height":17},"nodeType":"userTask","id":"d9bbab2c330b4fc49ebdc0e5c52c6cfa","name":"影像下载","description":"","property":"","code":"","no":"","commentTitle":"","needComment":"false","onCreateEvent":"","afterSubmitEvent":"","isFirst":false,"multiInstance":"single","notice_im":"true","notice_app":"","taskOverConditionExpression":"nrOfInstances == nrOfCompletedInstances","assignee":[{"type":"sameas","id":"81eca3d6afb3ed8236d2740686af37ac","nodeid":"60b3b08f27644fc18af35ba20ecd2bac"}]}],"gateway":[],"sequenceFlow":[{"id":"f68b1fda47f64909b806ebbbee3bbca7_60b3b08f27644fc18af35ba20ecd2bac","sourceRef":"f68b1fda47f64909b806ebbbee3bbca7","targetRef":"60b3b08f27644fc18af35ba20ecd2bac","label":"","code":"","default":false,"conditionExpression":"","passExpression":""},{"id":"60b3b08f27644fc18af35ba20ecd2bac_6655df8bedc641aa9bacf1720d13ce2d","sourceRef":"60b3b08f27644fc18af35ba20ecd2bac","targetRef":"6655df8bedc641aa9bacf1720d13ce2d","label":"","code":"","default":false,"conditionExpression":"","passExpression":""},{"id":"6655df8bedc641aa9bacf1720d13ce2d_d9bbab2c330b4fc49ebdc0e5c52c6cfa","sourceRef":"6655df8bedc641aa9bacf1720d13ce2d","targetRef":"d9bbab2c330b4fc49ebdc0e5c52c6cfa","label":"","code":"","default":false,"conditionExpression":"","passExpression":""},{"id":"d9bbab2c330b4fc49ebdc0e5c52c6cfa_091c005a811747c6a2b48f58663d0a7d","sourceRef":"d9bbab2c330b4fc49ebdc0e5c52c6cfa","targetRef":"091c005a811747c6a2b48f58663d0a7d","label":"","code":"","default":false,"conditionExpression":"","passExpression":""}],"startEvent":{"bounds":{"x":331,"y":187,"width":42,"height":42},"nodeType":"startEvent","id":"f68b1fda47f64909b806ebbbee3bbca7","name":"开始"}}


id: 60fa63be9932563b7c99be81
pid: 60fa63be9932563b7c99be71
appid: 606d21ab99328dc77af633f9
name: bpmn
code: 60fa63be9932563b7c99be81
namepath: /凭证影像化/凭证调阅/凭证调阅审批
codepath: 60fa63be9932563b7c99be6e.60fa63be9932563b7c99be6f.dy
fullname: /凭证影像化/凭证调阅/凭证调阅审批/bpmn
fullcode: 60fa63be9932563b7c99be6e.60fa63be9932563b7c99be6f.dy.60fa63be9932563b7c99be81
nodetype: column
createdate: 2021.07.23 14:39:48.000
lastmodifieddate: 2023.12.06 10:50:19.270
value:
<?xml version="1.0" encoding="UTF-8"?>
        <definitions id="definitions_60fa63be9932563b7c99be71"  targetNamespace="http://flowable.org/bpmn20"  
                    xmlns:flowable="http://flowable.org/bpmn"  
                    xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">    
<process id="id_60fa63be9932563b7c99be71" name="凭证调阅审批" isExecutable="true">  
<startEvent id="id_f68b1fda47f64909b806ebbbee3bbca7" name="开始"/>
<userTask id="id_60b3b08f27644fc18af35ba20ecd2bac" name="调阅申请" 
                    flowable:isFirst="true" 
                    flowable:notice_im="false" 
                    flowable:notice_app=""  
           >
                    <extensionElements>
                            <flowable:taskListener event="all" class="api.flow.TaskListenerImpl"></flowable:taskListener>
                            <flowable:candidateDefine><![CDATA[[]]]></flowable:candidateDefine>
                            <flowable:code><![CDATA[]]></flowable:code>
                            <flowable:no><![CDATA[]]></flowable:no>
                            <flowable:commentTitle><![CDATA[]]></flowable:commentTitle>
                            <flowable:needComment><![CDATA[false]]></flowable:needComment>
                            
                            
                            <flowable:onCreateEvent><![CDATA[]]></flowable:onCreateEvent>
                            <flowable:afterSubmitEvent><![CDATA[]]></flowable:afterSubmitEvent>
                            <flowable:description><![CDATA[]]></flowable:description>
                            <flowable:property><![CDATA[]]></flowable:property>
                            
                    </extensionElements>                  
               </userTask>
<userTask id="id_6655df8bedc641aa9bacf1720d13ce2d" name="调阅审批" 
                    flowable:isFirst="false" 
                    flowable:notice_im="true" 
                    flowable:notice_app=""  
           >
                    <extensionElements>
                            <flowable:taskListener event="all" class="api.flow.TaskListenerImpl"></flowable:taskListener>
                            <flowable:candidateDefine><![CDATA[[{"type":"column","id":"7d1e9bd95d470c130bf5aa6f88e29318","tableName":"dzpz_dy","columnName":"leaderid"}]]]></flowable:candidateDefine>
                            <flowable:code><![CDATA[]]></flowable:code>
                            <flowable:no><![CDATA[]]></flowable:no>
                            <flowable:commentTitle><![CDATA[审批意见]]></flowable:commentTitle>
                            <flowable:needComment><![CDATA[true]]></flowable:needComment>
                            
                            
                            <flowable:onCreateEvent><![CDATA[]]></flowable:onCreateEvent>
                            <flowable:afterSubmitEvent><![CDATA[]]></flowable:afterSubmitEvent>
                            <flowable:description><![CDATA[]]></flowable:description>
                            <flowable:property><![CDATA[]]></flowable:property>
                            
                    </extensionElements>                  
               </userTask>
<userTask id="id_d9bbab2c330b4fc49ebdc0e5c52c6cfa" name="影像下载" 
                    flowable:isFirst="false" 
                    flowable:notice_im="true" 
                    flowable:notice_app=""  
           >
                    <extensionElements>
                            <flowable:taskListener event="all" class="api.flow.TaskListenerImpl"></flowable:taskListener>
                            <flowable:candidateDefine><![CDATA[[{"type":"sameas","id":"81eca3d6afb3ed8236d2740686af37ac","nodeid":"60b3b08f27644fc18af35ba20ecd2bac"}]]]></flowable:candidateDefine>
                            <flowable:code><![CDATA[]]></flowable:code>
                            <flowable:no><![CDATA[]]></flowable:no>
                            <flowable:commentTitle><![CDATA[]]></flowable:commentTitle>
                            <flowable:needComment><![CDATA[false]]></flowable:needComment>
                            
                            
                            <flowable:onCreateEvent><![CDATA[]]></flowable:onCreateEvent>
                            <flowable:afterSubmitEvent><![CDATA[]]></flowable:afterSubmitEvent>
                            <flowable:description><![CDATA[]]></flowable:description>
                            <flowable:property><![CDATA[]]></flowable:property>
                            
                    </extensionElements>                  
               </userTask>
<endEvent id="id_091c005a811747c6a2b48f58663d0a7d" name="结束"/>

            <sequenceFlow id="id_f68b1fda47f64909b806ebbbee3bbca7_60b3b08f27644fc18af35ba20ecd2bac" 
                 sourceRef="id_f68b1fda47f64909b806ebbbee3bbca7" 
                 targetRef="id_60b3b08f27644fc18af35ba20ecd2bac" 
                 name="开始→调阅申请" 
             
                  
>
<extensionElements>
<flowable:description><![CDATA[]]></flowable:description>
<flowable:code><![CDATA[]]></flowable:code>
<flowable:executionListener event="end" class="api.flow.ExecutionListenerImpl"></flowable:executionListener>
</extensionElements>
</sequenceFlow>

            <sequenceFlow id="id_60b3b08f27644fc18af35ba20ecd2bac_6655df8bedc641aa9bacf1720d13ce2d" 
                 sourceRef="id_60b3b08f27644fc18af35ba20ecd2bac" 
                 targetRef="id_6655df8bedc641aa9bacf1720d13ce2d" 
                 name="调阅申请→调阅审批" 
             
                  
>
<extensionElements>
<flowable:description><![CDATA[]]></flowable:description>
<flowable:code><![CDATA[]]></flowable:code>
<flowable:executionListener event="end" class="api.flow.ExecutionListenerImpl"></flowable:executionListener>
</extensionElements>
</sequenceFlow>

            <sequenceFlow id="id_6655df8bedc641aa9bacf1720d13ce2d_d9bbab2c330b4fc49ebdc0e5c52c6cfa" 
                 sourceRef="id_6655df8bedc641aa9bacf1720d13ce2d" 
                 targetRef="id_d9bbab2c330b4fc49ebdc0e5c52c6cfa" 
                 name="调阅审批→影像下载" 
             
                  
>
<extensionElements>
<flowable:description><![CDATA[]]></flowable:description>
<flowable:code><![CDATA[]]></flowable:code>
<flowable:executionListener event="end" class="api.flow.ExecutionListenerImpl"></flowable:executionListener>
</extensionElements>
</sequenceFlow>

            <sequenceFlow id="id_d9bbab2c330b4fc49ebdc0e5c52c6cfa_091c005a811747c6a2b48f58663d0a7d" 
                 sourceRef="id_d9bbab2c330b4fc49ebdc0e5c52c6cfa" 
                 targetRef="id_091c005a811747c6a2b48f58663d0a7d" 
                 name="影像下载→结束" 
             
                  
>
<extensionElements>
<flowable:description><![CDATA[]]></flowable:description>
<flowable:code><![CDATA[]]></flowable:code>
<flowable:executionListener event="end" class="api.flow.ExecutionListenerImpl"></flowable:executionListener>
</extensionElements>
</sequenceFlow>
</process>
                   </definitions>


# app_ddlb

id: 60c965549932d177d8ac5d7f
pid: 60c965549932d177d8ac5d5f
name: sql
code: 60c965549932d177d8ac5d7f
namepath: /userid2usershowname
codepath: 60c965549932d177d8ac5d5f
fullname: /userid2usershowname/sql
fullcode: 60c965549932d177d8ac5d5f.60c965549932d177d8ac5d7f
nodetype: column
createdate: 2021.06.16 11:20:12.000
lastmodifieddate: 2023.12.06 10:50:19.821
value:
select id , showname from app_user 
where id in(
SELECT distinct userid from app_department_user where station like '凭证调阅审批人%'
)
order by showname


# app_script

id: 6090ffc7280cc084c578f0c5
pid: templateScriptOnServer
name: templateScriptOnServer-5d7cf44d993297db174018e2clone20210504160324
code: 6090ffc7280cc084c578f0c5
fullname: /templateScriptOnServer-5d7cf44d993297db174018e2clone20210504160324
fullcode: 6090ffc7280cc084c578f0c5
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:21.234
value:
function work_order_unit_message(gguid,action){
	runTask("work_order_unit",{"gguid":gguid,"action":action});
}

function new_work_order_unit_message(gguid,action){
	runTask("new_work_order_unit",{"gguid":gguid,"action":action});
}


id: 609d2b1f5db2d89ef50d29da
pid: 609d3f3f5db2b0a331d6bced
name: functionlist
code: 609d2b1f5db2d89ef50d29da
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/functionlist
nodetype: column
value: ["main"]
createdate: 2021.05.13 23:26:55.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d2b1f5db2d89ef50d29da


id: 609d2b1f5db2d89ef50d29db
pid: 609d3f3f5db2b0a331d6bced
name: functioncheckpoint
code: 609d2b1f5db2d89ef50d29db
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/functioncheckpoint
nodetype: column
value: {}
createdate: 2021.05.13 23:26:55.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d2b1f5db2d89ef50d29db


id: 609d3cfc5db2b0a331d6bb4b
pid: templateScriptOnServer
name: templateScriptOnServer-609d3cfc5db2b0a331d6bb4b
code: 609d3cfc5db2b0a331d6bb4b
fullname: /templateScriptOnServer-609d3cfc5db2b0a331d6bb4b
fullcode: 609d3cfc5db2b0a331d6bb4b
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:21.234
value:
function getImageList1()
{
    return getImageList("");
}
function getImageList2()
{
    return getImageList("回收站");
}


//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)
function getImageList(info2) {
     
    //排除掉回收站的图片
    var sql= "select * from  dzpz_imgpool_fileupload  where  gguid='" + currentGUID() + "'   and ifnull(info2,'')='"+info2+"'  order by info1 ";
    println( sql);
    var ds = newDataStore("", sql); // info1 是客户端文件创建的时间，以它排序
    ds.setOnceRetrieveCount(400);
    var n = ds.retrieve();
    
    var ret = [];
    for (var i = 0; i < n; i++) {
        ret.push(JSON.parse(ds.getJSONRow(i, true)));
    }

    return  { success:true,  data:ret};

}

function  moveImageToRecycle(id)
{
    
    runSQL("",  "update dzpz_imgpool_fileupload set info2='回收站' where id='"+id+"'  ",true);

}

function  moveImageToNormal(id)
{
    var config = JSON.parse(runTask("get_dzpz_imgpool_id_of_current_user", {}));
    runSQL(config.dbpool,  " update "+config.logTable+ " set info2='' where id='"+id+"'  ",true);
}

function  realDeleteImage(id)
{
    
    runSQL("",  "delete from dzpz_imgpool_fileupload  where id='"+id+"'  ",true);

}


id: 609d3f3f5db2b0a331d6bced
pid: 609d3f3f5db2b0a331d6bce1
name: Electron调用本接口向自已推送消息
code: electronPushMessageToSelf
namepath: /凭证数字化/由Electron调用的接口
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
fullcode: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
nodetype: leaf
createdate: 2021.05.13 23:24:05.000
lastmodifieddate: 2023.12.06 10:50:21.234
value:
function main(arg)
{

    println(arg);

    var userid= currentUserId();
    println(userid);
    return  userid;
}


id: 609d3f3f5db2b0a331d6bcf5
pid: 609d3f3f5db2b0a331d6bced
name: enabled
code: 609d3f3f5db2b0a331d6bcf5
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/enabled
nodetype: column
value: true
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcf5


id: 609d3f3f5db2b0a331d6bcf6
pid: 609d3f3f5db2b0a331d6bced
name: timeout
code: 609d3f3f5db2b0a331d6bcf6
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/timeout
nodetype: column
value: 300
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcf6


id: 609d3f3f5db2b0a331d6bcf7
pid: 609d3f3f5db2b0a331d6bced
name: writeCallingLog
code: 609d3f3f5db2b0a331d6bcf7
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/writeCallingLog
nodetype: column
value: true
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcf7


id: 609d3f3f5db2b0a331d6bcf8
pid: 609d3f3f5db2b0a331d6bced
name: runningLog
code: 609d3f3f5db2b0a331d6bcf8
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/runningLog
nodetype: column
value: true
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcf8


id: 609d3f3f5db2b0a331d6bcf9
pid: 609d3f3f5db2b0a331d6bced
name: deletelogafter
code: 609d3f3f5db2b0a331d6bcf9
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/deletelogafter
nodetype: column
value: 7
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcf9


id: 609d3f3f5db2b0a331d6bcfa
pid: 609d3f3f5db2b0a331d6bced
name: maxlogsize
code: 609d3f3f5db2b0a331d6bcfa
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/maxlogsize
nodetype: column
value: 50
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcfa


id: 609d3f3f5db2b0a331d6bcfb
pid: 609d3f3f5db2b0a331d6bced
name: maxactivethreadcount
code: 609d3f3f5db2b0a331d6bcfb
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/maxactivethreadcount
nodetype: column
value: 30
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcfb


id: 609d3f3f5db2b0a331d6bcfc
pid: 609d3f3f5db2b0a331d6bced
name: maxwaittime
code: 609d3f3f5db2b0a331d6bcfc
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/maxwaittime
nodetype: column
value: 30
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcfc


id: 609d3f3f5db2b0a331d6bcfd
pid: 609d3f3f5db2b0a331d6bced
name: anonymousRun
code: 609d3f3f5db2b0a331d6bcfd
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/anonymousRun
nodetype: column
value: true
createdate: 2021.05.13 23:24:26.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d3f3f5db2b0a331d6bcfd


id: 609d44aa5db2b0a331d6bd35
pid: 609d3f3f5db2b0a331d6bced
name: code
code: 609d44aa5db2b0a331d6bd35
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/code
nodetype: column
value: electronPushMessageToSelf
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.234
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd35


id: 609d44aa5db2b0a331d6bd36
pid: 609d3f3f5db2b0a331d6bced
name: sharding
code: 609d44aa5db2b0a331d6bd36
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/sharding
nodetype: column
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd36


id: 609d44aa5db2b0a331d6bd37
pid: 609d3f3f5db2b0a331d6bced
name: type_rhino
code: 609d44aa5db2b0a331d6bd37
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/type_rhino
nodetype: column
value: rhino
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd37


id: 609d44aa5db2b0a331d6bd38
pid: 609d3f3f5db2b0a331d6bced
name: engine
code: 609d44aa5db2b0a331d6bd38
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/engine
nodetype: column
value: rhino
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd38


id: 609d44aa5db2b0a331d6bd39
pid: 609d3f3f5db2b0a331d6bced
name: type_v8
code: 609d44aa5db2b0a331d6bd39
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/type_v8
nodetype: column
value: v8
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd39


id: 609d44aa5db2b0a331d6bd3a
pid: 609d3f3f5db2b0a331d6bced
name: roles
code: 609d44aa5db2b0a331d6bd3a
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/roles
nodetype: column
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd3a


id: 609d44aa5db2b0a331d6bd3b
pid: 609d3f3f5db2b0a331d6bced
name: group_AAAAAAA=
code: 609d44aa5db2b0a331d6bd3b
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/group_AAAAAAA=
nodetype: column
value: false
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd3b


id: 609d44aa5db2b0a331d6bd3c
pid: 609d3f3f5db2b0a331d6bced
name: role-default
code: 609d44aa5db2b0a331d6bd3c
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/role-default
nodetype: column
value: false
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd3c


id: 609d44aa5db2b0a331d6bd3d
pid: 609d3f3f5db2b0a331d6bced
name: description
code: 609d44aa5db2b0a331d6bd3d
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/description
nodetype: column
createdate: 2021.05.13 23:24:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d44aa5db2b0a331d6bd3d


id: 609d45045db2b0a331d6bd99
pid: 609d3f3f5db2b0a331d6bced
name: functionGroup
code: 609d45045db2b0a331d6bd99
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/functionGroup
nodetype: column
createdate: 2021.05.13 23:26:55.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d45045db2b0a331d6bd99

value:
{"全局函数":[{"source":"function main(","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function main","index":0}]}


id: 609d45045db2b0a331d6bd9c
pid: 609d3f3f5db2b0a331d6bced
name: finalscript
code: 609d45045db2b0a331d6bd9c
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/finalscript
nodetype: column
createdate: 2021.05.13 23:26:55.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d45045db2b0a331d6bd9c

value:
function main(arg)
{

    println(arg);

    var userid= currentUserId();
    println(userid);
    return  userid;
}


id: 609d45045db2b0a331d6bd9d
pid: 609d3f3f5db2b0a331d6bced
name: depend
code: 609d45045db2b0a331d6bd9d
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/depend
nodetype: column
value: ,
createdate: 2021.05.13 23:26:55.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.609d45045db2b0a331d6bd9d


id: 609d4b105db2b0a331d6bf04
pid: 609d3f3f5db2b0a331d6bce1
name: 得到当前用户待归档图片单据的记录ID
code: get_dzpz_imgpool_id_of_current_user
namepath: /凭证数字化/由Electron调用的接口
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
fullcode: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
nodetype: leaf
createdate: 2021.05.13 23:51:45.000
lastmodifieddate: 2023.12.06 10:50:21.235
value:
//为每个操作员创建一个待归档图片单据 ， 所有单据都先上传到这个单据中做附件
function main(arg) {
    var gguid = '';
    runSQL(""," create unique index ui_dzpz_imgpool_userid on dzpz_imgpool (userid) ");

    var ds = newDataStore("", "select * from dzpz_imgpool  ");
    ds.setUpdateProperty("dzpz_imgpool", "id", "*", "id");
    println ( "currentUserId="+ currentUserId());
    ds.retrieve(" userid='" + currentUserId() + "'");
    println( ds.getSelectLastRetrieved());
    if (ds.getRowCount() == 1) {
        gguid = ds.getString(0, "gguid");
    } else {

        println( "new record");
        ds.insertRow(0);
        gguid = newGUID();
        ds.setValue(0, "id", gguid);
        ds.setValue(0, "gguid", gguid);
        ds.setValue(0, "billno", gguid);
        ds.setValue(0, "billdate", newDate());
        ds.setValue(0, "billtype", '');
        ds.setValue(0, "userid", currentUserId());
        ds.setValue(0, "username", currentUserShowName());
        ds.setValue(0, "deleteflag", 0);
        ds.setValue(0, "blocksize", 128);
        

        if (ds.update(true)) {
            error = ds.getError().getMessage();
            println(error);
            return { success: false, message: error };
        }else
        {
            ds.retrieve(" userid='" + currentUserId() + "'");
            gguid = ds.getString(0, "gguid");
        }
    }

    var blockSize=  ds.getInt(0,"blocksize");
    if( blockSize==0) blockSize=128; 

    //提供图片上传的必要的参数
    var config = { "serverIndex": "2", 
                    "dbpool": "default", 
                    "logTable": "dzpz_imgpool_fileupload", 
                    "blockSize": blockSize, 
                    "imgMaxSize": 1920, 
                    "groupName": "附件",
                     "tableName": "dzpz_imgpool", 
                     "gguid": gguid, 
                     "path": "dzpz_imgpool/"+ date2yyyymmdd(newDate(), "/"), 
                     "maxThumbnailSize": 512 ,
                     "responseType":"JSON"  //表示上传成功捂返回 JSON格式的结果
             }

    println(JSON.stringify(config));
    return config;
}


id: 609d4b105db2b0a331d6bf0c
pid: 609d4b105db2b0a331d6bf04
name: enabled
code: 609d4b105db2b0a331d6bf0c
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/enabled
nodetype: column
value: true
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf0c


id: 609d4b105db2b0a331d6bf0d
pid: 609d4b105db2b0a331d6bf04
name: timeout
code: 609d4b105db2b0a331d6bf0d
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/timeout
nodetype: column
value: 300
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf0d


id: 609d4b105db2b0a331d6bf0e
pid: 609d4b105db2b0a331d6bf04
name: writeCallingLog
code: 609d4b105db2b0a331d6bf0e
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/writeCallingLog
nodetype: column
value: true
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf0e


id: 609d4b105db2b0a331d6bf0f
pid: 609d4b105db2b0a331d6bf04
name: runningLog
code: 609d4b105db2b0a331d6bf0f
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/runningLog
nodetype: column
value: true
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf0f


id: 609d4b105db2b0a331d6bf10
pid: 609d4b105db2b0a331d6bf04
name: deletelogafter
code: 609d4b105db2b0a331d6bf10
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/deletelogafter
nodetype: column
value: 7
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf10


id: 609d4b105db2b0a331d6bf11
pid: 609d4b105db2b0a331d6bf04
name: maxlogsize
code: 609d4b105db2b0a331d6bf11
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/maxlogsize
nodetype: column
value: 50
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf11


id: 609d4b105db2b0a331d6bf12
pid: 609d4b105db2b0a331d6bf04
name: maxactivethreadcount
code: 609d4b105db2b0a331d6bf12
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/maxactivethreadcount
nodetype: column
value: 30
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf12


id: 609d4b105db2b0a331d6bf13
pid: 609d4b105db2b0a331d6bf04
name: maxwaittime
code: 609d4b105db2b0a331d6bf13
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/maxwaittime
nodetype: column
value: 30
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf13


id: 609d4b105db2b0a331d6bf14
pid: 609d4b105db2b0a331d6bf04
name: anonymousRun
code: 609d4b105db2b0a331d6bf14
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/anonymousRun
nodetype: column
value: true
createdate: 2021.05.13 23:52:02.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf14


id: 609d4b105db2b0a331d6bf2a
pid: 609d4b105db2b0a331d6bf04
name: code
code: 609d4b105db2b0a331d6bf2a
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/code
nodetype: column
value: get_dzpz_imgpool_id_of_current_user
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf2a


id: 609d4b105db2b0a331d6bf2b
pid: 609d4b105db2b0a331d6bf04
name: sharding
code: 609d4b105db2b0a331d6bf2b
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/sharding
nodetype: column
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf2b


id: 609d4b105db2b0a331d6bf2c
pid: 609d4b105db2b0a331d6bf04
name: type_rhino
code: 609d4b105db2b0a331d6bf2c
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/type_rhino
nodetype: column
value: rhino
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf2c


id: 609d4b105db2b0a331d6bf2d
pid: 609d4b105db2b0a331d6bf04
name: engine
code: 609d4b105db2b0a331d6bf2d
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/engine
nodetype: column
value: rhino
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf2d


id: 609d4b105db2b0a331d6bf2e
pid: 609d4b105db2b0a331d6bf04
name: type_v8
code: 609d4b105db2b0a331d6bf2e
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/type_v8
nodetype: column
value: v8
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf2e


id: 609d4b105db2b0a331d6bf2f
pid: 609d4b105db2b0a331d6bf04
name: roles
code: 609d4b105db2b0a331d6bf2f
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/roles
nodetype: column
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf2f


id: 609d4b105db2b0a331d6bf30
pid: 609d4b105db2b0a331d6bf04
name: group_AAAAAAA=
code: 609d4b105db2b0a331d6bf30
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/group_AAAAAAA=
nodetype: column
value: false
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf30


id: 609d4b105db2b0a331d6bf31
pid: 609d4b105db2b0a331d6bf04
name: role-default
code: 609d4b105db2b0a331d6bf31
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/role-default
nodetype: column
value: false
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf31


id: 609d4b105db2b0a331d6bf32
pid: 609d4b105db2b0a331d6bf04
name: description
code: 609d4b105db2b0a331d6bf32
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/description
nodetype: column
createdate: 2021.05.13 23:53:10.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf32


id: 609d4b105db2b0a331d6bf64
pid: 609d4b105db2b0a331d6bf04
name: functionGroup
code: 609d4b105db2b0a331d6bf64
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/functionGroup
nodetype: column
createdate: 2021.05.13 23:58:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf64

value:
{"全局函数":[{"source":"function main(arg)","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function main","index":0}]}


id: 609d4b105db2b0a331d6bf67
pid: 609d4b105db2b0a331d6bf04
name: finalscript
code: 609d4b105db2b0a331d6bf67
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/finalscript
nodetype: column
createdate: 2021.05.13 23:58:49.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4b105db2b0a331d6bf67

value:
//为每个操作员创建一个待归档图片单据 ， 所有单据都先上传到这个单据中做附件
function main(arg) {
    var gguid = '';
    runSQL(""," create unique index ui_dzpz_imgpool_userid on dzpz_imgpool (userid) ");

    var ds = newDataStore("", "select * from dzpz_imgpool  ");
    ds.setUpdateProperty("dzpz_imgpool", "id", "*", "id");
    println ( "currentUserId="+ currentUserId());
    ds.retrieve(" userid='" + currentUserId() + "'");
    println( ds.getSelectLastRetrieved());
    if (ds.getRowCount() == 1) {
        gguid = ds.getString(0, "gguid");
    } else {

        println( "new record");
        ds.insertRow(0);
        gguid = newGUID();
        ds.setValue(0, "id", gguid);
        ds.setValue(0, "gguid", gguid);
        ds.setValue(0, "billno", gguid);
        ds.setValue(0, "billdate", newDate());
        ds.setValue(0, "billtype", '');
        ds.setValue(0, "userid", currentUserId());
        ds.setValue(0, "username", currentUserShowName());
        ds.setValue(0, "deleteflag", 0);
        ds.setValue(0, "blocksize", 128);
        

        if (ds.update(true)) {
            error = ds.getError().getMessage();
            println(error);
            return { success: false, message: error };
        }else
        {
            ds.retrieve(" userid='" + currentUserId() + "'");
            gguid = ds.getString(0, "gguid");
        }
    }

    var blockSize=  ds.getInt(0,"blocksize");
    if( blockSize==0) blockSize=128; 

    //提供图片上传的必要的参数
    var config = { "serverIndex": "2", 
                    "dbpool": "default", 
                    "logTable": "dzpz_imgpool_fileupload", 
                    "blockSize": blockSize, 
                    "imgMaxSize": 1920, 
                    "groupName": "附件",
                     "tableName": "dzpz_imgpool", 
                     "gguid": gguid, 
                     "path": "dzpz_imgpool/"+ date2yyyymmdd(newDate(), "/"), 
                     "maxThumbnailSize": 512 ,
                     "responseType":"JSON"  //表示上传成功捂返回 JSON格式的结果
             }

    println(JSON.stringify(config));
    return config;
}


id: 609d4ca45db2d89ef50d2db4
pid: 609d4b105db2b0a331d6bf04
name: functionlist
code: 609d4ca45db2d89ef50d2db4
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/functionlist
nodetype: column
value: ["main"]
createdate: 2021.05.13 23:58:50.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4ca45db2d89ef50d2db4


id: 609d4ca45db2d89ef50d2db5
pid: 609d4b105db2b0a331d6bf04
name: functioncheckpoint
code: 609d4ca45db2d89ef50d2db5
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/functioncheckpoint
nodetype: column
value: {}
createdate: 2021.05.13 23:58:50.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4ca45db2d89ef50d2db5


id: 609d4cb95db2b0a331d6bf68
pid: 609d4b105db2b0a331d6bf04
name: depend
code: 609d4cb95db2b0a331d6bf68
namepath: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user
fullname: /凭证数字化/由Electron调用的接口/得到当前用户待归档图片单据的记录ID/depend
nodetype: column
value: ,
createdate: 2021.05.13 23:58:50.000
lastmodifieddate: 2023.12.06 10:50:21.235
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.get_dzpz_imgpool_id_of_current_user.609d4cb95db2b0a331d6bf68


id: 609deddb5db2696039463ca0
pid: 609d3f3f5db2b0a331d6bce1
name: 记录扫描端在上传成功后删除文件的日志
code: logForDeleteFileAfterUploadSuccess
namepath: /凭证数字化/由Electron调用的接口
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
fullcode: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
nodetype: leaf
createdate: 2021.05.14 20:57:59.000
lastmodifieddate: 2023.12.06 10:50:21.236
value:
//客户端在上传好文件后，把文件删除，并调用本任务记录下日志， 同时通知客户端，有新文件了，注意刷新
function main(arg) {

    var p = JSON.parse(arg);
    println("user:" + currentUserShowName() + " file: " + p.file + "  result:" + p.result);
    pushMessage("electronPushMessage", { cmd:"newFileUploaded",  file: p.file }, currentUserId());  //向当前用户推送消息 

}


id: 609deddb5db2696039463ca8
pid: 609deddb5db2696039463ca0
name: enabled
code: 609deddb5db2696039463ca8
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/enabled
nodetype: column
value: true
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463ca8


id: 609deddb5db2696039463ca9
pid: 609deddb5db2696039463ca0
name: timeout
code: 609deddb5db2696039463ca9
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/timeout
nodetype: column
value: 300
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463ca9


id: 609deddb5db2696039463caa
pid: 609deddb5db2696039463ca0
name: writeCallingLog
code: 609deddb5db2696039463caa
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/writeCallingLog
nodetype: column
value: true
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463caa


id: 609deddb5db2696039463cab
pid: 609deddb5db2696039463ca0
name: runningLog
code: 609deddb5db2696039463cab
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/runningLog
nodetype: column
value: true
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463cab


id: 609deddb5db2696039463cac
pid: 609deddb5db2696039463ca0
name: deletelogafter
code: 609deddb5db2696039463cac
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/deletelogafter
nodetype: column
value: 7
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463cac


id: 609deddb5db2696039463cad
pid: 609deddb5db2696039463ca0
name: maxlogsize
code: 609deddb5db2696039463cad
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/maxlogsize
nodetype: column
value: 50
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463cad


id: 609deddb5db2696039463cae
pid: 609deddb5db2696039463ca0
name: maxactivethreadcount
code: 609deddb5db2696039463cae
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/maxactivethreadcount
nodetype: column
value: 50
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463cae


id: 609deddb5db2696039463caf
pid: 609deddb5db2696039463ca0
name: maxwaittime
code: 609deddb5db2696039463caf
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/maxwaittime
nodetype: column
value: 30
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609deddb5db2696039463caf


id: 609e47905db22e19b5c98ae3
pid: 609deddb5db2696039463ca0
name: functionlist
code: 609e47905db22e19b5c98ae3
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/functionlist
nodetype: column
value: ["main"]
createdate: 2021.05.14 20:59:23.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e47905db22e19b5c98ae3


id: 609e47905db22e19b5c98ae4
pid: 609deddb5db2696039463ca0
name: functioncheckpoint
code: 609e47905db22e19b5c98ae4
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/functioncheckpoint
nodetype: column
value: {}
createdate: 2021.05.14 20:59:23.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e47905db22e19b5c98ae4


id: 609e73ec5db2696039463cb0
pid: 609deddb5db2696039463ca0
name: anonymousRun
code: 609e73ec5db2696039463cb0
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/anonymousRun
nodetype: column
value: true
createdate: 2021.05.14 20:58:20.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463cb0


id: 609e73ec5db2696039463cc6
pid: 609deddb5db2696039463ca0
name: code
code: 609e73ec5db2696039463cc6
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/code
nodetype: column
value: logForDeleteFileAfterUploadSuccess
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463cc6


id: 609e73ec5db2696039463cc7
pid: 609deddb5db2696039463ca0
name: sharding
code: 609e73ec5db2696039463cc7
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/sharding
nodetype: column
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463cc7


id: 609e73ec5db2696039463cc8
pid: 609deddb5db2696039463ca0
name: type_rhino
code: 609e73ec5db2696039463cc8
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/type_rhino
nodetype: column
value: rhino
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463cc8


id: 609e73ec5db2696039463cc9
pid: 609deddb5db2696039463ca0
name: engine
code: 609e73ec5db2696039463cc9
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/engine
nodetype: column
value: rhino
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463cc9


id: 609e73ec5db2696039463cca
pid: 609deddb5db2696039463ca0
name: type_v8
code: 609e73ec5db2696039463cca
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/type_v8
nodetype: column
value: v8
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463cca


id: 609e73ec5db2696039463ccb
pid: 609deddb5db2696039463ca0
name: roles
code: 609e73ec5db2696039463ccb
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/roles
nodetype: column
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463ccb


id: 609e73ec5db2696039463ccc
pid: 609deddb5db2696039463ca0
name: group_AAAAAAA=
code: 609e73ec5db2696039463ccc
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/group_AAAAAAA=
nodetype: column
value: false
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463ccc


id: 609e73ec5db2696039463ccd
pid: 609deddb5db2696039463ca0
name: role-default
code: 609e73ec5db2696039463ccd
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/role-default
nodetype: column
value: false
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463ccd


id: 609e73ec5db2696039463cce
pid: 609deddb5db2696039463ca0
name: description
code: 609e73ec5db2696039463cce
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/description
nodetype: column
createdate: 2021.05.14 20:58:26.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463cce


id: 609e73ec5db2696039463ce1
pid: 609deddb5db2696039463ca0
name: functionGroup
code: 609e73ec5db2696039463ce1
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/functionGroup
nodetype: column
createdate: 2021.05.14 20:59:23.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463ce1

value:
{"全局函数":[{"source":"function main(","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function main","index":0}]}


id: 609e73ec5db2696039463ce4
pid: 609deddb5db2696039463ca0
name: finalscript
code: 609e73ec5db2696039463ce4
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/finalscript
nodetype: column
createdate: 2021.05.14 20:59:23.000
lastmodifieddate: 2023.12.06 10:50:21.236
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463ce4

value:
//客户端在上传好文件后，把文件删除，并调用本任务记录下日志， 同时通知客户端，有新文件了，注意刷新
function main(arg) {

    var p = JSON.parse(arg);
    println("user:" + currentUserShowName() + " file: " + p.file + "  result:" + p.result);
    pushMessage("electronPushMessage", { cmd:"newFileUploaded",  file: p.file }, currentUserId());  //向当前用户推送消息 

}


id: 609e73ec5db2696039463ce5
pid: 609deddb5db2696039463ca0
name: depend
code: 609e73ec5db2696039463ce5
namepath: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess
fullname: /凭证数字化/由Electron调用的接口/记录扫描端在上传成功后删除文件的日志/depend
nodetype: column
value: ,
createdate: 2021.05.14 20:59:23.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.logForDeleteFileAfterUploadSuccess.609e73ec5db2696039463ce5


id: 60a31c3c5db27838e0c0129e
pid: templateScriptOnServer
name: templateScriptOnServer-60a31c3c5db27838e0c0129e
code: 60a31c3c5db27838e0c0129e
fullname: /templateScriptOnServer-60a31c3c5db27838e0c0129e
fullcode: 60a31c3c5db27838e0c0129e
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:21.594
value:
function getImageList1()
{
    return getImageList("凭证");
}
function getImageList2()
{
    return getImageList("附件");
}


//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)
function getImageList(groupName) {
     
    //排除掉回收站的图片
    var sql= "select * from  dzpz_pzfj  where  gguid='" + currentGUID() + "'  and groupname='"+groupName+"'  order by info2 asc, groupname, info1 asc ";
    println( sql);
    var ds = newDataStore("", sql); // info1 是客户端文件创建的时间，以它排序
    var n = ds.retrieve();
   
    var ret = [];
    for (var i = 0; i < n; i++) {
        ret.push(JSON.parse(ds.getJSONRow(i, true)));
    }

    return  { success:true,  data:ret};

}


/**
 * 点击删除单据，在执行单据删除语句后（但尚未提交），系统在服务端触发本事件
 *
 *  可以在本事件中，注入一些操作，返回一组SQL，这此SQL与单据删除操作将在一个事务中执行。
 *
 * @notice 注意：本事件在服务端执行，不要试图访问任何前端UI信息。不要直接执行对数据库的写操作，如果需要
 * 请在返回值中返回这些语句，让系统把它们与单据删除并在一个事务中执行。
 *
 * @param gguid  要删除单据主记录的gguid ，等同于主表的id
 * @param session  一个JSON对象，用于在整个单据删除过程中的各个事件之间传递数据。各个事件
 * 脚本虽然写在一起，但它们是按顺序在服务器上分开独立执行的，各个事件可能并不是在同一个脚本
 * 引擎中执行，如果对session做了写的操作，必须在返回值中
 * 将它返回，系统将它做为参数传递到下一个事件中
 *
 * @return   返回值是这样的一个JSON对象
 * { success:true,
 *    message:'' ,
 *    sql: { "default" : [ sql1, sql2 ...] ,
 *            "dbpool2": [sql1, sql2 ...]
 *         }
 * }
 *   success=true 表示继续允许执行删除单据操作 ， 并且在执行单据删除后，执行一些SQL语句。sql定义的规则：
 *   { 连接池名称1: [ SQL数组] , 连接池名称2: [ SQL数组] ....  }
 *
 *
 * 如果 success 设置成false ,则在 message中放置错误提示信息，此时整个单据删除操作被立即终止
 *
 */
//@comment (group=单据,caption=单据删除语句执行后)
function afterBillDeleteOnServer(gguid, session) {

    //注意：此时单据尚未开始删除，仍可用 gguid 来查询单据数据

    var objectName = getStringFromSQL( `select objectname from app_archive where gguid='${gguid}'` ) ;
    println( objectName +" 将被删除");
    deleteFileOnFileServer (  1 , objectName ) ;
    var sql= `delete from app_archive where gguid='${gguid}'` ;
    println( sql);

    return {
        success: true,
        message: "",
        session: session,
        sql: {"default": [sql]}  // 归档信息删除
    };

}


id: 60a31c475db27838e0c01344
pid: templateScriptOnServer
name: templateScriptOnServer-60a31c475db27838e0c01344
code: 60a31c475db27838e0c01344
fullname: /templateScriptOnServer-60a31c475db27838e0c01344
fullcode: 60a31c475db27838e0c01344
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:21.594
value:
function saveLabel(corpid,data) {
    println(data.length);
    println("=====");
    println(JSON.stringify(data));
     

    var labels={};
    var dzpz_pz_ds = newDataStore("", "select * from dzpz_pz");
    dzpz_pz_ds.setUpdateProperty("dzpz_pz", "id", "*", "id");

    for (var i = 0; i < data.length; i++) {
        var one = data[i];

        var ym = one['记帐期'];
        var pzh = one['凭证号'];
        println(pzh);
        dzpz_pz_ds.retrieve(" corpid='" +  corpid + "' and  ym=" + ym + " and pzh='" + pzh + "'");
        var t = dzpz_pz_ds.getString(0, "labeldata");
        var id = dzpz_pz_ds.getString(0, "id");
        try {
            if (t != '') {
                t = JSON.parse(t);
            } else { t = {}; }
        } catch (err) {
            t = {};
        }
        println(typeof (t));
        if (typeof (t) != 'object') t = {};

        for (var p in one) {
            if( labels[p]==undefined) labels[p]=1;//记录下标签名称 
            var v = one[p];
            t[p] = v;
        }

        t = JSON.stringify(t);
        runSQL("", "update dzpz_pz set  labeldata='" + t + "' where  corpid='" + corpid  + "' and  ym=" + ym + " and pzh='" + pzh + "' and id='" + id + "'   ", true);

    }

    //最后再把标签名称保存一下
    runTask("保存标签名称" , { labels: Object.keys(labels) },10); //延时

}


id: 60a321f05db27838e0c014bf
pid: templateScriptOnServer
name: templateScriptOnServer-60a321f05db27838e0c014bf
code: 60a321f05db27838e0c014bf
fullname: /templateScriptOnServer-60a321f05db27838e0c014bf
fullcode: 60a321f05db27838e0c014bf
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:21.594
value:
//@comment (group=,caption=得到当前操作员待归档图片对应的GGUID,needRightControl=false)
function getImagePoolGGUID() {
    var ret = runTask("get_dzpz_imgpool_id_of_current_user", {});
    return JSON.parse(ret).gguid;

}

function getImagePoolBlockSize() {
    var ret = runTask("get_dzpz_imgpool_id_of_current_user", {});
    return JSON.parse(ret).blockSize;

}


//@comment (group=,caption=保存当前的缩略图大小,needRightControl=false)
function setImagePoolBlockSize(id, blockSize) {
    runSQL("", " update  dzpz_imgpool set blocksize=" + blockSize + " where gguid='" + id + "'  ");
}


//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)
function loadImagePoolData(config) {
    var onceCount = config.onceCount;
    if (onceCount == undefined) onceCount = 500;
    var config = JSON.parse(runTask("get_dzpz_imgpool_id_of_current_user", {}));

    //排除掉回收站的图片
    var sql = "select * from " + config.logTable + "  where  gguid='" + config.gguid +
        "'  and ifnull(info2,'')=''  order by info1 asc, filename asc ";
    println(sql);
    var ds = newDataStore(config.dbpool, sql); // info1 是客户端文件创建的时间，以它排序厅。
    ds.setOnceRetrieveCount(onceCount);

    var n = ds.retrieve();
    println(ds.getSelectLastRetrieved());

    var ret = [];
    for (var i = 0; i < n; i++) {
        ret.push(JSON.parse(ds.getJSONRow(i, true)));
    }

    println(ret);
    return { success: true, totalCount: ds.getDBRowCount(), data: ret };


}

function getTotalImageCount() {
    var config = JSON.parse(runTask("get_dzpz_imgpool_id_of_current_user", {}));

    //排除掉回收站的图片
    var sql = "select count(*) as c from " + config.logTable + "  where  gguid='" + config.gguid +
        "'  and ifnull(info2,'')=''    ";
    println(sql);
    var ds = newDataStore(config.dbpool, sql); // info1 是客户端文件创建的时间，以它排序厅。


    ds.retrieve();
    println(ds.getSelectLastRetrieved());

    return ds.getInt(0, "c");

}

//@comment (group=,caption=保存监控目录设置,needRightControl=false)
function setMonitePath(hostName, path) {
    var ds = newDataStore("", "select * from dzpz_client");
    ds.setUpdateProperty("dzpz_client", "id", "*", "id");
    ds.retrieve(" hostname='" + hostName + "'");
    if (ds.getRowCount() == 0) {
        var newid = newGUID();
        ds.insertRow(0);
        ds.setValue(0, "id", newid);
        ds.setValue(0, "gguid", newid);
        ds.setValue(0, "billno", newid);
        ds.setValue(0, "userid", 1);
        ds.setValue(0, "username", '管理员');
        ds.setValue(0, "billtype", '');
        ds.setValue(0, "hostname", hostName);
    }
    ds.setValue(0, "path", path);
    ds.update(true);
    println(ds.getError().getMessage());

}


//@comment (group=,caption=获取指定机器的监控目录,needRightControl=false)
function getMonitePath(hostName) {
    return getStringFromSQL("select path from dzpz_client where  hostname='" + hostName + "'");
}


//@comment (group=,caption=构建凭证附件清单,needRightControl=false)
function getPZFJ(id) {
    // 在图片池中，info2 表示是否是垃圾箱， 在附件表中，info2记录的是手工调整后的顺序号
    var ds = newDataStore("", "select id , url_img , url_thumbnail ,groupname , info1 from  dzpz_pzfj where  gguid='" + id + "'  order by info2 asc,groupname , info1 asc ");
    var n = ds.retrieve();
    var ret = [];
    for (var i = 0; i < n; i++) {
        ret.push(JSON.parse(ds.getJSONRow(i, true)));
    }
    return ret;
}

//@comment (group=,caption=把凭证中的附件图片回归到待归档池中,needRightControl=false)
function putImageBackToPool(id) {
    println(id);
    return JSON.parse(runTask("凭证附件移除", { id: id }));
}


//@comment (group=,caption=追加图片到凭证中,needRightControl=false)
function addImageToPZ(pzid, images) {
    return JSON.parse(runTask("追加图片到凭证中", { pzid: pzid, images: images }));
}

function deletePZAndPutBackToPool(id) {
    return JSON.parse(runTask("删除凭证所有图片回归池中", { id: id }));
}

function moveImageToRecycle(id) {
    var config = JSON.parse(runTask("get_dzpz_imgpool_id_of_current_user", {}));
    runSQL(config.dbpool, " update " + config.logTable + " set info2='回收站' where id='" + id + "'  ", true);


}

//@comment (group=,caption=凭证号前缀,needRightControl=false)
function getPZHPrefix(corpid, ym) {
    return runTask("getPZHPrefix", { ym: ym, corpid: corpid });

}
//@comment (group=,caption=凭证号长度,needRightControl=false)
function getPZHLen(corpid) {
    return parseInt(runTask("getPZHLen", { corpid: corpid }));
}

function getLastPZH(corpid, ym) {
    var t = getStringFromSQL("select max(pzh) from dzpz_pz where corpid='" + corpid + "' and ym=" + ym);
    return t;
}


function do_imageRotate(id, rt) {
    var ret = imageRotate("", "dzpz_imgpool_fileupload", id, rt);
    println(JSON.stringify(ret));
    return ret;
}


function reorderImageFileIndex(imgs) {

}


function back_ocr(config) {
    config.src = config.src.replace(/电子凭证/g, ''); //把其中的汉字去掉，这个引发一个异常
    pushMessage('pz_ocr', { action: 'info', message: config.src }, currentUserId());
    var ret = OCR(config);
    println(ret);
    var t = ret.text || '';
    if (t == '') return '';

    //下面的算法， 根据每家凭证号的特点需要定制
    t = t.replace(/\s/g, '');
    var n = '' + t.match(/20[0-9]{2}-[0-9]{2}-[0-9]{2}/g);
    println(n);
    if(n)
    { 
    ym = '' + n;

    println( typeof( ym));

    ym = ym.replace(/[-]/g, '');
    if (ym.length > 6) ym = ym.substring(2, 6)   ;
    println(ym);
    }else{
        println("无法识别年月");
    }
    p = t.indexOf('第');
    if (p < 0) return '';
    t = t.substring(p + 1);
    p = t.substring(0, 4)

    return ym + right('0000' + p, 4);


}


id: 60a3505f5db27838e0c01592
pid: 60a321f05db27838e0c014bf
name: functionGroup
code: 60a3505f5db27838e0c01592
namepath: /templateScriptOnServer-60a321f05db27838e0c014bf
codepath: 60a321f05db27838e0c014bf
fullname: /templateScriptOnServer-60a321f05db27838e0c014bf/functionGroup
fullcode: 60a321f05db27838e0c014bf.60a3505f5db27838e0c01592
nodetype: column
createdate: 2021.05.18 16:22:19.000
lastmodifieddate: 2023.12.06 10:50:21.594
value:
{"全局函数":[{"source":"//@comment (group=,caption=得到当前操作员待归档图片对应的GGUID,needRightControl=false)\nfunction getImagePoolGGUID()","comment":"//@comment (group=,caption=得到当前操作员待归档图片对应的GGUID,needRightControl=false)","group":"","caption":"得到当前操作员待归档图片对应的GGUID","needRightControl":"false","func":"getImagePoolGGUID","funcTitle":"function getImagePoolGGUID","index":0},{"source":"function getImagePoolBlockSize()","comment":"","group":"","caption":"","needRightControl":"","func":"getImagePoolBlockSize","funcTitle":"function getImagePoolBlockSize","index":1},{"source":"//@comment (group=,caption=保存当前的缩略图大小,needRightControl=false)\nfunction setImagePoolBlockSize(id, blockSize)","comment":"//@comment (group=,caption=保存当前的缩略图大小,needRightControl=false)","group":"","caption":"保存当前的缩略图大小","needRightControl":"false","func":"setImagePoolBlockSize","funcTitle":"function setImagePoolBlockSize","index":2},{"source":"//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)\nfunction loadImagePoolData(config)","comment":"//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)","group":"","caption":"得到待归档的图片清单","needRightControl":"true","func":"loadImagePoolData","funcTitle":"function loadImagePoolData","index":3},{"source":"function getTotalImageCount()","comment":"","group":"","caption":"","needRightControl":"","func":"getTotalImageCount","funcTitle":"function getTotalImageCount","index":4},{"source":"//@comment (group=,caption=保存监控目录设置,needRightControl=false)\nfunction setMonitePath(hostName, path)","comment":"//@comment (group=,caption=保存监控目录设置,needRightControl=false)","group":"","caption":"保存监控目录设置","needRightControl":"false","func":"setMonitePath","funcTitle":"function setMonitePath","index":5},{"source":"//@comment (group=,caption=获取指定机器的监控目录,needRightControl=false)\nfunction getMonitePath(hostName)","comment":"//@comment (group=,caption=获取指定机器的监控目录,needRightControl=false)","group":"","caption":"获取指定机器的监控目录","needRightControl":"false","func":"getMonitePath","funcTitle":"function getMonitePath","index":6},{"source":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)\nfunction getPZFJ(id)","comment":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)","group":"","caption":"构建凭证附件清单","needRightControl":"false","func":"getPZFJ","funcTitle":"function getPZFJ","index":7},{"source":"//@comment (group=,caption=把凭证中的附件图片回归到待归档池中,needRightControl=false)\nfunction putImageBackToPool(id)","comment":"//@comment (group=,caption=把凭证中的附件图片回归到待归档池中,needRightControl=false)","group":"","caption":"把凭证中的附件图片回归到待归档池中","needRightControl":"false","func":"putImageBackToPool","funcTitle":"function putImageBackToPool","index":8},{"source":"//@comment (group=,caption=追加图片到凭证中,needRightControl=false)\nfunction addImageToPZ(pzid, images)","comment":"//@comment (group=,caption=追加图片到凭证中,needRightControl=false)","group":"","caption":"追加图片到凭证中","needRightControl":"false","func":"addImageToPZ","funcTitle":"function addImageToPZ","index":9},{"source":"function deletePZAndPutBackToPool(id)","comment":"","group":"","caption":"","needRightControl":"","func":"deletePZAndPutBackToPool","funcTitle":"function deletePZAndPutBackToPool","index":10},{"source":"function moveImageToRecycle(id)","comment":"","group":"","caption":"","needRightControl":"","func":"moveImageToRecycle","funcTitle":"function moveImageToRecycle","index":11},{"source":"//@comment (group=,caption=凭证号前缀,needRightControl=false)\nfunction getPZHPrefix(corpid, ym)","comment":"//@comment (group=,caption=凭证号前缀,needRightControl=false)","group":"","caption":"凭证号前缀","needRightControl":"false","func":"getPZHPrefix","funcTitle":"function getPZHPrefix","index":12},{"source":"//@comment (group=,caption=凭证号长度,needRightControl=false)\nfunction getPZHLen(corpid)","comment":"//@comment (group=,caption=凭证号长度,needRightControl=false)","group":"","caption":"凭证号长度","needRightControl":"false","func":"getPZHLen","funcTitle":"function getPZHLen","index":13},{"source":"function getLastPZH(corpid, ym)","comment":"","group":"","caption":"","needRightControl":"","func":"getLastPZH","funcTitle":"function getLastPZH","index":14},{"source":"function do_imageRotate(id, rt)","comment":"","group":"","caption":"","needRightControl":"","func":"do_imageRotate","funcTitle":"function do_imageRotate","index":15},{"source":"function reorderImageFileIndex(imgs)","comment":"","group":"","caption":"","needRightControl":"","func":"reorderImageFileIndex","funcTitle":"function reorderImageFileIndex","index":16},{"source":"function back_ocr(config)","comment":"","group":"","caption":"","needRightControl":"","func":"back_ocr","funcTitle":"function back_ocr","index":17}]}


id: 60a370d25db2863f93619766
pid: 60a321f05db27838e0c014bf
name: functionlist
code: 60a370d25db2863f93619766
namepath: /templateScriptOnServer-60a321f05db27838e0c014bf
codepath: 60a321f05db27838e0c014bf
fullname: /templateScriptOnServer-60a321f05db27838e0c014bf/functionlist
fullcode: 60a321f05db27838e0c014bf.60a370d25db2863f93619766
nodetype: column
createdate: 2021.05.18 16:22:20.000
lastmodifieddate: 2023.12.06 10:50:21.594
value:
["back_ocr","reorderImageFileIndex","do_imageRotate","getLastPZH","getPZHLen","getPZHPrefix","moveImageToRecycle","deletePZAndPutBackToPool","addImageToPZ","putImageBackToPool","getPZFJ","getMonitePath","setMonitePath","getTotalImageCount","loadImagePoolData","setImagePoolBlockSize","getImagePoolBlockSize","getImagePoolGGUID"]


id: 60a9e42d5db2172e3066fbfc
pid: 609d3f3f5db2b0a331d6bce1
name: 通知客户端有多少文件等待上传中
code: notifyNeedUploadFileCount
namepath: /凭证数字化/由Electron调用的接口
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
fullcode: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
nodetype: leaf
createdate: 2021.05.23 23:47:33.000
lastmodifieddate: 2023.12.06 10:50:21.594
value:
function main(arg) {
    var p = JSON.parse(arg);
    println(" fileCount " +  p.fileCount); 
    pushMessage("electronPushMessage", { cmd:'notifyNeedUploadFileCount' , fileCount: p.fileCount }, currentUserId());  //向当前用户推送消息 

}


id: 60a9e42d5db2172e3066fc04
pid: 60a9e42d5db2172e3066fbfc
name: enabled
code: 60a9e42d5db2172e3066fc04
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/enabled
nodetype: column
value: true
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc04


id: 60a9e42d5db2172e3066fc05
pid: 60a9e42d5db2172e3066fbfc
name: timeout
code: 60a9e42d5db2172e3066fc05
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/timeout
nodetype: column
value: 300
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc05


id: 60a9e42d5db2172e3066fc06
pid: 60a9e42d5db2172e3066fbfc
name: writeCallingLog
code: 60a9e42d5db2172e3066fc06
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/writeCallingLog
nodetype: column
value: true
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc06


id: 60a9e42d5db2172e3066fc07
pid: 60a9e42d5db2172e3066fbfc
name: runningLog
code: 60a9e42d5db2172e3066fc07
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/runningLog
nodetype: column
value: true
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc07


id: 60a9e42d5db2172e3066fc08
pid: 60a9e42d5db2172e3066fbfc
name: deletelogafter
code: 60a9e42d5db2172e3066fc08
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/deletelogafter
nodetype: column
value: 7
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc08


id: 60a9e42d5db2172e3066fc09
pid: 60a9e42d5db2172e3066fbfc
name: maxlogsize
code: 60a9e42d5db2172e3066fc09
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/maxlogsize
nodetype: column
value: 50
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc09


id: 60a9e42d5db2172e3066fc0a
pid: 60a9e42d5db2172e3066fbfc
name: maxactivethreadcount
code: 60a9e42d5db2172e3066fc0a
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/maxactivethreadcount
nodetype: column
value: 30
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.594
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc0a


id: 60a9e42d5db2172e3066fc0b
pid: 60a9e42d5db2172e3066fbfc
name: maxwaittime
code: 60a9e42d5db2172e3066fc0b
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/maxwaittime
nodetype: column
value: 30
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc0b


id: 60a9e42d5db2172e3066fc0d
pid: 60a9e42d5db2172e3066fbfc
name: anonymousRun
code: 60a9e42d5db2172e3066fc0d
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/anonymousRun
nodetype: column
value: true
createdate: 2021.05.23 23:47:47.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60a9e42d5db2172e3066fc0d


id: 60aa75da5db236f288bee1f4
pid: 60a9e42d5db2172e3066fbfc
name: functionlist
code: 60aa75da5db236f288bee1f4
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/functionlist
nodetype: column
value: ["main"]
createdate: 2021.05.23 23:49:47.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa75da5db236f288bee1f4


id: 60aa75da5db236f288bee1f6
pid: 60a9e42d5db2172e3066fbfc
name: functioncheckpoint
code: 60aa75da5db236f288bee1f6
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/functioncheckpoint
nodetype: column
value: {}
createdate: 2021.05.23 23:49:47.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa75da5db236f288bee1f6


id: 60aa79235db2172e3066fc22
pid: 60a9e42d5db2172e3066fbfc
name: code
code: 60aa79235db2172e3066fc22
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/code
nodetype: column
value: notifyNeedUploadFileCount
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc22


id: 60aa79235db2172e3066fc23
pid: 60a9e42d5db2172e3066fbfc
name: sharding
code: 60aa79235db2172e3066fc23
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/sharding
nodetype: column
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc23


id: 60aa79235db2172e3066fc24
pid: 60a9e42d5db2172e3066fbfc
name: type_rhino
code: 60aa79235db2172e3066fc24
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/type_rhino
nodetype: column
value: rhino
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc24


id: 60aa79235db2172e3066fc25
pid: 60a9e42d5db2172e3066fbfc
name: engine
code: 60aa79235db2172e3066fc25
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/engine
nodetype: column
value: rhino
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc25


id: 60aa79235db2172e3066fc26
pid: 60a9e42d5db2172e3066fbfc
name: type_v8
code: 60aa79235db2172e3066fc26
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/type_v8
nodetype: column
value: v8
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc26


id: 60aa79235db2172e3066fc27
pid: 60a9e42d5db2172e3066fbfc
name: roles
code: 60aa79235db2172e3066fc27
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/roles
nodetype: column
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc27


id: 60aa79235db2172e3066fc28
pid: 60a9e42d5db2172e3066fbfc
name: group_AAAAAAA=
code: 60aa79235db2172e3066fc28
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/group_AAAAAAA=
nodetype: column
value: false
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc28


id: 60aa79235db2172e3066fc29
pid: 60a9e42d5db2172e3066fbfc
name: role-default
code: 60aa79235db2172e3066fc29
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/role-default
nodetype: column
value: false
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc29


id: 60aa79235db2172e3066fc2a
pid: 60a9e42d5db2172e3066fbfc
name: description
code: 60aa79235db2172e3066fc2a
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/description
nodetype: column
createdate: 2021.05.23 23:47:52.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc2a


id: 60aa79235db2172e3066fc55
pid: 60a9e42d5db2172e3066fbfc
name: functionGroup
code: 60aa79235db2172e3066fc55
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/functionGroup
nodetype: column
createdate: 2021.05.23 23:49:47.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc55

value:
{"全局函数":[{"source":"function main(","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function main","index":0}]}


id: 60aa79235db2172e3066fc58
pid: 60a9e42d5db2172e3066fbfc
name: finalscript
code: 60aa79235db2172e3066fc58
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/finalscript
nodetype: column
createdate: 2021.05.23 23:49:47.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc58

value:
function main(arg) {
    var p = JSON.parse(arg);
    println(" fileCount " +  p.fileCount); 
    pushMessage("electronPushMessage", { cmd:'notifyNeedUploadFileCount' , fileCount: p.fileCount }, currentUserId());  //向当前用户推送消息 

}


id: 60aa79235db2172e3066fc59
pid: 60a9e42d5db2172e3066fbfc
name: depend
code: 60aa79235db2172e3066fc59
namepath: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount
fullname: /凭证数字化/由Electron调用的接口/通知客户端有多少文件等待上传中/depend
nodetype: column
value: ,
createdate: 2021.05.23 23:49:47.000
lastmodifieddate: 2023.12.06 10:50:21.595
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.notifyNeedUploadFileCount.60aa79235db2172e3066fc59


id: 60aafc935db277fa0f8e07c7
pid: 60ab09f85db2f37491f99447
name: finalscript
code: 60aafc935db277fa0f8e07c7
namepath: /凭证数字化/记帐期相关/指定帐帐套当前记帐期
codepath: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b.当前记帐期
fullname: /凭证数字化/记帐期相关/指定帐帐套当前记帐期/finalscript
fullcode: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b.当前记帐期.60aafc935db277fa0f8e07c7
nodetype: column
createdate: 2021.05.24 10:19:46.000
lastmodifieddate: 2023.12.06 10:50:21.595
value:
/*
得到指定帐套的当前帐期
原理：  获取上一个关帐的年月，如果不存在，那么直接返回本月
        关帐年月的下一个月就是当前活动年月
 */

function main(arg)
{
    var p= JSON.parse( arg);
    var corpid= p.corpid ||'';
    println( corpid);

    var sql= " select  max(ym) from dzpz_gz where   state = 1 and corpid='"+ corpid+"' ";
    println( sql);
    var ym= ''+getStringFromSQL2( "pz", sql);
    println(" ym= "+ ym);
   
    if( ym=='') 
    {
        sql="select  min(ym) from dzpz_gz where  ifnull(  state,0) = 0 and corpid='"+ corpid+"' ";
        println(sql);
        ym =  getIntFromSQL2("pz", sql);
        if( ym ==0)         ym =  getYear(newDate())*100+ getMonth(newDate());
     //   println( ym);
    }else{
        ym= parseInt(ym);
        var  y = round( ym /100 ,0);
        var m= ym -  y *100;
        m=m+1;
        if( m==13)
        {
            y++;
            m=1;
        }
        ym=  y*100 + m ;
    }

    return ''+ round(ym,0); 


	

}


id: 60aaff095db2f37491f99012
pid: templateScriptOnServer
name: templateScriptOnServer-60aaff095db2f37491f99012
code: 60aaff095db2f37491f99012
fullname: /templateScriptOnServer-60aaff095db2f37491f99012
fullcode: 60aaff095db2f37491f99012
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:21.595
value:
/**
*   指定的单据审核完成后，执行本事件 ，注意： 无论本事件中的执行是成功还失败，都不影响审核标记
*
*   @param：gguid： 单据的gguid
*
*   @return :  无返回值
* */
function afterBillVerified(gguid) {
    var userid = currentUserId();
    //本事件请写在单据的编辑模板的后端脚本中

    //...
    runSQL('', "update dzpz_gz set state=1 where gguid='" + gguid + "'");
    return true;

}
/**
*   指定的单据取消审核完成后，执行本事件 ，注意： 无论本事件中的执行是成功还失败，都不影响审核标记
*
*   @param：gguid： 单据的gguid
*
*   @return :  无返回值
* */
function afterBillUnVerified(gguid) {
    var userid = currentUserId();
    //本事件请写在单据的编辑模板的后端脚本中
    runSQL('', "update dzpz_gz set state=0 where gguid='" + gguid + "'");
    //...

    return true;

}


id: 60aaff145db2f37491f990b8
pid: templateScriptOnServer
name: templateScriptOnServer-60aaff145db2f37491f990b8
code: 60aaff145db2f37491f990b8
fullname: /templateScriptOnServer-60aaff145db2f37491f990b8
fullcode: 60aaff145db2f37491f990b8
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:21.595
value:
function backend_import_list() {
    var sqls = [];

    runSQL(""," create index di_pz_corp_ym on dzpz_pz (corpid,ym) ",true);
    runSQL('', "delete from dzpz_gz where verifierid is null and not exists(select id from dzpz_pz b where dzpz_gz.corpid=b.corpid and dzpz_gz.ym=b.ym)", true);
    runSQL('', "update dzpz_gz set pzsl=(" +
        " select count(pzh) as pzsl from dzpz_pz b where dzpz_gz.corpid=b.corpid and dzpz_gz.ym=b.ym " +
        " ) where verifierid is null "
        , true);
    runSQL('', "insert into dzpz_gz " +
        "(id, gguid, billno, corpid, ym, pzsl) " +
        " select concat(corpid, '-', ym) as id, concat(corpid, '-', ym) as gguid, " +
        "   concat(corpid, '-', ym) as billno, corpid, ym, " +
        "   count(pzh) as pzsl " +
        " from dzpz_pz a " +
        " where not exists(select id from dzpz_gz b where a.corpid = b.corpid and a.ym = b.ym) " +
        " group by corpid, ym"
        , true);
}


id: 60ab0ab55db2f37491f994ce
pid: 60ab09f85db2f37491f9943b
name: 指定帐套最后关帐期
code: 最后关帐期
namepath: /凭证数字化/记帐期相关
codepath: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b
fullname: /凭证数字化/记帐期相关/指定帐套最后关帐期
fullcode: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b.最后关帐期
nodetype: leaf
createdate: 2021.05.24 10:24:12.000
lastmodifieddate: 2023.12.06 10:50:21.595
value:
/*
得到指定帐套的最后关帐期

 */

function main(arg)
{
    var p= JSON.parse( arg);
    var corpid= p.corpid ||'';

    var ym= getStringFromSQL2( "pz", "  select  max(ym)  from dzpz_gz where   state = 1 and corpid='"+ corpid+"' ");
   
    return ym ; 
    


	

}


id: 60ab0e675db2f37491f99530
pid: 60ab09f85db2f37491f9943b
name: 关帐
code: 关帐
namepath: /凭证数字化/记帐期相关
codepath: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b
fullname: /凭证数字化/记帐期相关/关帐
fullcode: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b.关帐
nodetype: leaf
createdate: 2021.05.24 10:38:42.000
lastmodifieddate: 2023.12.06 10:50:21.596
value:
function main(arg)
{
    var p= JSON.parse(arg);
    var corpid= p.corpid;
    var ym= p.ym;
    var ds=newDataStore("pz", "select * from dzpz_gz");
    ds.setUpdateProperty("dzpz_gz","id","*","id");
    ds.retrieve(" corpid='"+ corpid+"'  and ym="+ ym);
    if( ds.getRowCount()==0)
    {
        ds.insertRow(0);
        var newid= newGUID();
        ds.setValue(0,"id", newid);
        ds.setValue(0,"gguid", newid);
        ds.setValue(0,"billno", newid);
        ds.setValue(0,"billdate", newDate());
        ds.setValue(0,"userid", currentUserId());
        ds.setValue(0,"username", currentUserShowName());
        ds.setValue(0,"corpid", corpid);
        ds.setValue(0,"ym", ym);
        
    }

    ds.setValue(0,"state", 1);
    ds.setValue(0,"gzsj", newDate()); //关帐时间 
    
    if( ds.update(true)) return {success:true};
    var err= ds.getError().getMessage();
    println( err);
    return {success:false, message:err};

}


id: 60ab2c0d5db2f37491f9970b
pid: 60ab09f85db2f37491f9943b
name: 取消关帐
code: 取消关帐
namepath: /凭证数字化/记帐期相关
codepath: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b
fullname: /凭证数字化/记帐期相关/取消关帐
fullcode: 60b71f5a5db22398a379d9ec.60ab09f85db2f37491f9943b.取消关帐
nodetype: leaf
createdate: 2021.05.24 10:38:42.000
lastmodifieddate: 2023.12.06 10:50:21.951
value:
function main(arg)
{
    var p= JSON.parse(arg);
    var corpid= p.corpid;
    var ym= p.ym;
    var ds=newDataStore("", "select * from dzpz_gz");
    ds.setUpdateProperty("dzpz_gz","id","*","id");
    ds.retrieve(" corpid='"+ corpid+"'  and ym="+ ym);
    if( ds.getRowCount()==0)
    {
        ds.insertRow(0);
        var newid= newGUID();
        ds.setValue(0,"id", newid);
        ds.setValue(0,"gguid", newid);
        ds.setValue(0,"billno", newid);
        ds.setValue(0,"billdate", newDate());
        ds.setValue(0,"userid", currentUserId());
        ds.setValue(0,"username", currentUserShowName());
        ds.setValue(0,"corpid", corpid);
        ds.setValue(0,"ym", ym);
        
    }

    ds.setValue(0,"state", 0);
    ds.setValue(0,"gzsj", null); //关帐时间 
    
    if( ds.update(true)) return {success:true};
    var err= ds.getError().getMessage();
    println( err);
    return {success:false, message:err};

}


id: 60ab513d5db26b6db2c28aa6
pid: 60ab513d5db26b6db2c28a8c
name: 归档
code: 归档
namepath: /凭证数字化/归档相关
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c
fullname: /凭证数字化/归档相关/归档
fullcode: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.归档
nodetype: leaf
createdate: 2021.05.24 16:11:14.000
lastmodifieddate: 2023.12.06 10:50:21.951
value:
/*
归档处理
  1 生成凭证主记录
  2 生成凭证附件记录

   pzGroup = 
   [
       { pzh:'xx1' , pz:['id1','id2'...] , fj :['id1', 'id2'.....]} , 
       { pzh:'xx2' , pz:['id1','id2'...] , fj :['id1', 'id2'.....]} ...  
       
   ]
*/

function main(arg) {

    var p = JSON.parse(arg);
    println(p.rawdata);
    var corpid = p.corpid;
    var ym = p.ym;
    var pzGroup = p.pzGroup;  //pzGroup 的结构是 [   {pzh: '0001', imgID:'xxxx', fj:['xxxx', 'xxxxx'...] } , { ... } ] 

    //先校验，要么全部归档，要么全部放弃

    for (var i = 0; i < pzGroup.length; i++) {
        var pzh   =  pzGroup[i].pzh;
        //验重： 指定单位，指定年月，指定凭证号不能重复
        if(  getStringFromSQL( "select id from dzpz_pz where pzh='"+pzh+"' and corpid='"+ corpid+"' and ym="+ym )!='')
        {
            return {success:false, message:pzh+"凭证号已存在，不允许重复归档"};
        }       
    }


    for (var i = 0; i < pzGroup.length; i++) {
        ret = gd(corpid, ym, pzGroup[i]);
        if (!ret.success) return ret;
    }

    return { success: true };

}


function gd(corpid, ym, config) {
    var dzpz_pz_ds = newDataStore("", "select * from dzpz_pz ");  //凭证主记录
    dzpz_pz_ds.setUpdateProperty("dzpz_pz", "id", "*", "id");

    var dzpz_pzfj_ds = newDataStore("", "select * from dzpz_pzfj "); //凭证附件
    dzpz_pzfj_ds.setUpdateProperty("dzpz_pzfj", "id", "*", "id");

    //用来检索数据
    var dzpz_imgpool_ds = newDataStore("", "select * from dzpz_imgpool_fileupload");

    //用来更新数据
    var dzpz_imgpool_fileupload_ds = newDataStore("", "select * from dzpz_imgpool_fileupload");
    dzpz_imgpool_fileupload_ds.setUpdateProperty("dzpz_imgpool_fileupload", "id", "*", "id");


    var id = newGUID();
    dzpz_pz_ds.insertRow(0);
    dzpz_pz_ds.setValue(0, "id", id);
    dzpz_pz_ds.setValue(0, "gguid", id);
    dzpz_pz_ds.setValue(0, "billno", id);
    dzpz_pz_ds.setValue(0, "billdate", newDate());
    dzpz_pz_ds.setValue(0, "billtype", "");
    dzpz_pz_ds.setValue(0, "open_bill_with_url", "billedit?action=view&gguid=" + id + "&id=dzpz");
    dzpz_pz_ds.setValue(0, "userid", currentUserId());
    dzpz_pz_ds.setValue(0, "username", currentUserShowName());
    dzpz_pz_ds.setValue(0, "pzh", config.pzh);
    dzpz_pz_ds.setValue(0, "attachmentcount", config.fj.length + config.pz.length); //凭证与附件的图片总和
    dzpz_pz_ds.setValue(0, "ym", ym);
    dzpz_pz_ds.setValue(0, "imgid", config.imgID);

    dzpz_pz_ds.setValue(0, "corpid", corpid);
    dzpz_pz_ds.setValue(0, "deleteflag", 0);

    // 附件清单

    var FJGD = function (imgs, groupName) {
        for (var i = 0; i < imgs.length; i++) {
            var fromID = imgs[i];

            dzpz_imgpool_ds.retrieve(" id='" + fromID + "'");
            if (dzpz_imgpool_ds.getRowCount() != 1) {
                println(config.fj[i] + " 对应的上传记录不存在")
                continue;
            }

            var row = dzpz_pzfj_ds.insertRow(9999);

            cloneRow(dzpz_imgpool_ds, dzpz_pzfj_ds, row);

            //数据调整



            //附件表上的附件类型
            dzpz_pzfj_ds.setValue(row, "groupname", groupName);  //把类型改成 凭证

            dzpz_pzfj_ds.setValue(row, "fileindex", i + 1);

            dzpz_pzfj_ds.setValue(row, "gguid", id);
            dzpz_pzfj_ds.setValue(row, "tablename", "dzpz_pz");
            dzpz_pzfj_ds.setValue(row, "corpid", corpid);

            //删除源
            //当 
            dzpz_imgpool_fileupload_ds.executeAfterUpdate(" delete from dzpz_imgpool_fileupload where id='" + fromID + "' ");

        }
    }

    FJGD( config.pz , '凭证' ); //凭证
    FJGD( config.fj , '附件' ); //附件
    
    dzpz_pz_ds.setValue(0,"pz", config.pz.length);//凭证张数
    dzpz_pz_ds.setValue(0,"fj", config.fj.length);//附件张数
    

    var err = '' + updateAll(dzpz_pz_ds, dzpz_pzfj_ds, dzpz_imgpool_fileupload_ds);

    if (err == '') return { success: true };
    println(err);
    return { success: false, message: err };

}

function cloneRow(dzpz_imgpool_ds, dzpz_pzfj_ds, row) {
    for (var i = 0; i < dzpz_imgpool_ds.getColumnCount(); i++) {
        var col = dzpz_imgpool_ds.getColumnName(i);
        var value = dzpz_imgpool_ds.getValue(0, i);
        dzpz_pzfj_ds.setValue(row, col, value);
    }
}


id: 60ab5fa75db26b6db2c28b0c
pid: 60ab513d5db26b6db2c28aa6
name: functionGroup
code: 60ab5fa75db26b6db2c28b0c
namepath: /凭证数字化/归档相关/归档
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.归档
fullname: /凭证数字化/归档相关/归档/functionGroup
fullcode: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.归档.60ab5fa75db26b6db2c28b0c
nodetype: column
createdate: 2021.05.24 16:32:55.000
lastmodifieddate: 2023.12.06 10:50:21.952
value:
{"全局函数":[{"source":"function main(","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function main","index":0},{"source":"function gd(","comment":"","group":"","caption":"","needRightControl":"","func":"gd","funcTitle":"function gd","index":1},{"source":"function cloneRow(","comment":"","group":"","caption":"","needRightControl":"","func":"cloneRow","funcTitle":"function cloneRow","index":2}]}


id: 60ac750d5db2f5d22859c4c0
pid: 60ab513d5db26b6db2c28a8c
name: 凭证附件移除
code: 凭证附件移除
namepath: /凭证数字化/归档相关
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c
fullname: /凭证数字化/归档相关/凭证附件移除
fullcode: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.凭证附件移除
nodetype: leaf
createdate: 2021.05.25 11:55:45.000
lastmodifieddate: 2023.12.06 10:50:21.952
value:
/*
凭证中的某个附件移除，并还原到待归档图片池中
  1 记录移除
  2 移到 待归档图片池中
  3  几个标记数据还愿

*/

function main(arg) {

    println( arg); 
    var p = JSON.parse(arg);
    var id = p.id;  // dzpz_pzfj.id 
    println( "id="+ id);

   
    //得到当前操作员待归档图片对应的GGUID
    var t = runTask("get_dzpz_imgpool_id_of_current_user", {});
    var gguid = JSON.parse(t).gguid;


    var dzpz_pzfj_ds = newDataStore("", "select * from dzpz_pzfj "); //凭证附件
    dzpz_pzfj_ds.setUpdateProperty("dzpz_pzfj", "id", "*", "id");
    dzpz_pzfj_ds.retrieve(" id='"+ id+"' ");
    var pzid = dzpz_pzfj_ds.getString(0,"gguid");
    println( "select  verifierid  from dzpz_pz  where id='"+pzid+"' ");
    if( getIntFromSQL("select  verifierid  from dzpz_pz  where id='"+pzid+"' ")>0)
    {
        println("已审核，禁止删除附件");
     return { success:false, message:'凭证已审核，禁止删除'};
    }
    

    //待归档的图片池
    var dzpz_imgpool_fileupload_ds = newDataStore("", "select * from dzpz_imgpool_fileupload");
    dzpz_imgpool_fileupload_ds.setUpdateProperty("dzpz_imgpool_fileupload", "id", "*", "id");


    var row = dzpz_imgpool_fileupload_ds.insertRow(9999);

    cloneRow(dzpz_pzfj_ds, dzpz_imgpool_fileupload_ds, row);

    //数据调整


    dzpz_imgpool_fileupload_ds.setValue(row, "groupname", '附件');  //把类型改成 凭证

    dzpz_imgpool_fileupload_ds.setValue(row, "gguid", gguid);
    dzpz_imgpool_fileupload_ds.setValue(row, "tablename", "dzpz_imgpool");
    

    //删除源
    //当 
    dzpz_pzfj_ds.deleteRow(0);

    //更新附件数量
    
    dzpz_pzfj_ds.executeAfterUpdate(" update dzpz_pz  set attachmentcount= (select count(*) from dzpz_pzfj where gguid='"+ pzid+"' ) , "+
     " fj = (select count(*) from dzpz_pzfj where gguid='"+ pzid+"' and groupname='附件' ) , "+
     " pz = (select count(*) from dzpz_pzfj where gguid='"+ pzid+"' and groupname='凭证'  )  "+
               "   where id='"+ pzid+"' ");

    var err = '' + updateAll(dzpz_pzfj_ds, dzpz_imgpool_fileupload_ds);

    if (err == '') return { success: true };
    println(err);
    return { success: false, message: err };

}

function cloneRow(dzpz_pzfj_ds, dzpz_imgpool_fileupload_ds, row) {
    for (var i = 0; i < dzpz_pzfj_ds.getColumnCount(); i++) {
        var col = dzpz_pzfj_ds.getColumnName(i);
        var value = dzpz_pzfj_ds.getValue(0, i);
        dzpz_imgpool_fileupload_ds.setValue(row, col, value);
    }
}


id: 60ac750d5db2f5d22859c511
pid: 60ac750d5db2f5d22859c4c0
name: functionGroup
code: 60ac750d5db2f5d22859c511
namepath: /凭证数字化/归档相关/凭证附件移除
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.凭证附件移除
fullname: /凭证数字化/归档相关/凭证附件移除/functionGroup
fullcode: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.凭证附件移除.60ac750d5db2f5d22859c511
nodetype: column
createdate: 2021.05.25 12:04:12.000
lastmodifieddate: 2023.12.06 10:50:22.306
value:
{"全局函数":[{"source":"function main(","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function main","index":0},{"source":"function cloneRow(","comment":"","group":"","caption":"","needRightControl":"","func":"cloneRow","funcTitle":"function cloneRow","index":1}]}


id: 60ac8be75db2f5d22859c588
pid: 60ab513d5db26b6db2c28a8c
name: 追加图片到凭证中
code: 追加图片到凭证中
namepath: /凭证数字化/归档相关
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c
fullname: /凭证数字化/归档相关/追加图片到凭证中
fullcode: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.追加图片到凭证中
nodetype: leaf
createdate: 2021.05.24 16:11:14.000
lastmodifieddate: 2023.12.06 10:50:22.306
value:
/*

   凭证主记录已存在 ， 向凭证中添加更多的附件
   

*/

function main(arg)
{
    println( arg);
    var p= JSON.parse(arg);
   
    var id= p.pzid;
    var images= p.images;


    var  dzpz_pz_ds = newDataStore("", "select * from dzpz_pz ");  //凭证主记录
    dzpz_pz_ds.retrieve(" id='"+  id+"' ");

    var  dzpz_pzfj_ds = newDataStore("", "select * from dzpz_pzfj "); //凭证附件
    dzpz_pzfj_ds.setUpdateProperty("dzpz_pzfj", "id","*" ,"id");

    //用来检索数据
    var  dzpz_imgpool_ds= newDataStore("","select * from dzpz_imgpool_fileupload");

    //用来更新数据
    var  dzpz_imgpool_fileupload_ds= newDataStore("","select * from dzpz_imgpool_fileupload");
    dzpz_imgpool_fileupload_ds.setUpdateProperty("dzpz_imgpool_fileupload", "id","*" ,"id");
    
 
    var corpid= dzpz_pz_ds.getValue(0,"corpid");
     
    // 附件清单
    for( var i=0;i< images.length;i++)
    {
        var fromID = images[i].id;
        
        dzpz_imgpool_ds.retrieve(" id='"+fromID+"'");
        if( dzpz_imgpool_ds.getRowCount()!=1)
        {
            println( config.fj[i]+" 对应的上传记录不存在")
            continue; 
        }

        var row= dzpz_pzfj_ds.insertRow(9999);

        cloneRow( dzpz_imgpool_ds , dzpz_pzfj_ds , row);

        //数据调整
  
        dzpz_pzfj_ds.setValue(row,"gguid", id);
        dzpz_pzfj_ds.setValue(row,"tablename", "dzpz_pz");
        dzpz_pzfj_ds.setValue(row,"corpid", corpid);

        //删除源
        //当 
        dzpz_imgpool_fileupload_ds.executeAfterUpdate( " delete from dzpz_imgpool_fileupload where id='"+fromID+"' ");

        
    }

    //更新凭证附件数量
    dzpz_pzfj_ds.executeAfterUpdate(" update dzpz_pz  set attachmentcount= (select count(*) from dzpz_pzfj where gguid='"+ id+"' ) , "+
     " fj = (select count(*) from dzpz_pzfj where gguid='"+ id+"' and groupname='附件' ) , "+
     " pz = (select count(*) from dzpz_pzfj where gguid='"+ id+"' and groupname='凭证'  )  "+
               "   where id='"+ id+"' ");

    var err =  ''+updateAll( dzpz_pzfj_ds ,dzpz_imgpool_fileupload_ds);

    if( err=='') return  {success:true};
    println( err);
    return {success:false, message:err}; 

}

function cloneRow( dzpz_imgpool_ds , dzpz_pzfj_ds , row)
{
    for( var i=0;i<dzpz_imgpool_ds.getColumnCount();i++)
    {
        var col= dzpz_imgpool_ds.getColumnName(i);
        var value= dzpz_imgpool_ds.getValue(0 , i);
        dzpz_pzfj_ds.setValue(row, col , value);  
    }
}


id: 60ac944d5db2f5d22859c6de
pid: 60ab513d5db26b6db2c28a8c
name: 删除凭证所有图片回归池中
code: 删除凭证所有图片回归池中
namepath: /凭证数字化/归档相关
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中
fullcode: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
nodetype: leaf
createdate: 2021.05.25 11:55:45.000
lastmodifieddate: 2023.12.06 10:50:22.306
value:
/*
凭证中的某个附件移除，并还原到待归档图片池中
  1 记录移除
  2 移到 待归档图片池中
  3  几个标记数据还愿

*/

function main(arg) {

    println(arg);
    var p = JSON.parse(arg);
    var id = p.id;  // dzpz_pz.id 
    println("id=" + id);


    if (getIntFromSQL( "select  verifierid  from dzpz_pz  where id='" + id + "' ") > 0) return { success: false, message: '凭证已审核，禁止删除' };
    if (getIntFromSQL( "select  userid  from dzpz_pz  where id='" + id + "' ") != toString(currentUserId())) return { success: false, message: '您不是该凭证归档人，禁止删除' };


    //得到当前操作员待归档图片对应的GGUID
    var t = runTask("get_dzpz_imgpool_id_of_current_user", {});
    var gguid = JSON.parse(t).gguid;


    var dzpz_pzfj_ds = newDataStore("", "select * from dzpz_pzfj "); //凭证附件
    dzpz_pzfj_ds.setUpdateProperty("dzpz_pzfj", "id", "*", "id");
    dzpz_pzfj_ds.retrieve(" gguid='" + id + "' "); //检索出所有图片


    //待归档的图片池
    var dzpz_imgpool_fileupload_ds = newDataStore("", "select * from dzpz_imgpool_fileupload");
    dzpz_imgpool_fileupload_ds.setUpdateProperty("dzpz_imgpool_fileupload", "id", "*", "id");

    var RC = dzpz_pzfj_ds.getRowCount();
    for (var i = RC - 1; i >= 0; i--) {

        var row = dzpz_imgpool_fileupload_ds.insertRow(9999);
        cloneRow(dzpz_pzfj_ds, i, dzpz_imgpool_fileupload_ds, row);

        //数据调整

        dzpz_imgpool_fileupload_ds.setValue(row, "groupname", '附件');  //把类型改成 凭证
        dzpz_imgpool_fileupload_ds.setValue(row, "gguid", gguid);
        dzpz_imgpool_fileupload_ds.setValue(row, "tablename", "dzpz_imgpool");
         
        //删除源
        dzpz_pzfj_ds.deleteRow(i);
    }

    //删除凭证
    dzpz_pzfj_ds.executeAfterUpdate(" delete from  dzpz_pz  where id='" + id + "' ");

    var err = '' + updateAll(dzpz_pzfj_ds, dzpz_imgpool_fileupload_ds);

    if (err == '') return { success: true };
    println(err);
    return { success: false, message: err };

}

function cloneRow(dzpz_pzfj_ds, sr, dzpz_imgpool_fileupload_ds, row) {
    for (var i = 0; i < dzpz_pzfj_ds.getColumnCount(); i++) {
        var col = dzpz_pzfj_ds.getColumnName(i);
        var value = dzpz_pzfj_ds.getValue(sr, i);
        dzpz_imgpool_fileupload_ds.setValue(row, col, value);
    }
}


id: 60ac944d5db2f5d22859c6e2
pid: 60ac944d5db2f5d22859c6de
name: anonymousRun
code: 60ac750d5db2f5d22859c4d020210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/anonymousRun
nodetype: column
value: true
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4d020210525145216


id: 60ac944d5db2f5d22859c6e6
pid: 60ac944d5db2f5d22859c6de
name: code
code: 60ac750d5db2f5d22859c4e720210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/code
nodetype: column
value: 删除凭证所有图片回归池中
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4e720210525145216


id: 60ac944d5db2f5d22859c6ea
pid: 60ac944d5db2f5d22859c6de
name: deletelogafter
code: 60ac750d5db2f5d22859c4cc20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/deletelogafter
nodetype: column
value: 7
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4cc20210525145216


id: 60ac944d5db2f5d22859c6ee
pid: 60ac944d5db2f5d22859c6de
name: depend
code: 60ac750d5db2f5d22859c51520210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/depend
nodetype: column
value: ,
createdate: 2021.05.25 12:04:12.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c51520210525145216


id: 60ac944d5db2f5d22859c6f2
pid: 60ac944d5db2f5d22859c6de
name: description
code: 60ac750d5db2f5d22859c4f020210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/description
nodetype: column
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4f020210525145216


id: 60ac944d5db2f5d22859c6f6
pid: 60ac944d5db2f5d22859c6de
name: enabled
code: 60ac750d5db2f5d22859c4c820210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/enabled
nodetype: column
value: true
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4c820210525145216


id: 60ac944d5db2f5d22859c6fa
pid: 60ac944d5db2f5d22859c6de
name: engine
code: 60ac750d5db2f5d22859c4ea20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/engine
nodetype: column
value: rhino
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4ea20210525145216


id: 60ac944d5db2f5d22859c6fe
pid: 60ac944d5db2f5d22859c6de
name: finalscript
code: 60ac750d5db2f5d22859c51420210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/finalscript
nodetype: column
createdate: 2021.05.25 12:04:12.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c51420210525145216

value:
/*
凭证中的某个附件移除，并还原到待归档图片池中
  1 记录移除
  2 移到 待归档图片池中
  3  几个标记数据还愿

*/

function main(arg) {

    println(arg);
    var p = JSON.parse(arg);
    var id = p.id;  // dzpz_pz.id 
    println("id=" + id);


    if (getIntFromSQL( "select  verifierid  from dzpz_pz  where id='" + id + "' ") > 0) return { success: false, message: '凭证已审核，禁止删除' };
    if (getIntFromSQL( "select  userid  from dzpz_pz  where id='" + id + "' ") != toString(currentUserId())) return { success: false, message: '您不是该凭证归档人，禁止删除' };


    //得到当前操作员待归档图片对应的GGUID
    var t = runTask("get_dzpz_imgpool_id_of_current_user", {});
    var gguid = JSON.parse(t).gguid;


    var dzpz_pzfj_ds = newDataStore("", "select * from dzpz_pzfj "); //凭证附件
    dzpz_pzfj_ds.setUpdateProperty("dzpz_pzfj", "id", "*", "id");
    dzpz_pzfj_ds.retrieve(" gguid='" + id + "' "); //检索出所有图片


    //待归档的图片池
    var dzpz_imgpool_fileupload_ds = newDataStore("", "select * from dzpz_imgpool_fileupload");
    dzpz_imgpool_fileupload_ds.setUpdateProperty("dzpz_imgpool_fileupload", "id", "*", "id");

    var RC = dzpz_pzfj_ds.getRowCount();
    for (var i = RC - 1; i >= 0; i--) {

        var row = dzpz_imgpool_fileupload_ds.insertRow(9999);
        cloneRow(dzpz_pzfj_ds, i, dzpz_imgpool_fileupload_ds, row);

        //数据调整

        dzpz_imgpool_fileupload_ds.setValue(row, "groupname", '附件');  //把类型改成 凭证
        dzpz_imgpool_fileupload_ds.setValue(row, "gguid", gguid);
        dzpz_imgpool_fileupload_ds.setValue(row, "tablename", "dzpz_imgpool");
         
        //删除源
        dzpz_pzfj_ds.deleteRow(i);
    }

    //删除凭证
    dzpz_pzfj_ds.executeAfterUpdate(" delete from  dzpz_pz  where id='" + id + "' ");

    var err = '' + updateAll(dzpz_pzfj_ds, dzpz_imgpool_fileupload_ds);

    if (err == '') return { success: true };
    println(err);
    return { success: false, message: err };

}

function cloneRow(dzpz_pzfj_ds, sr, dzpz_imgpool_fileupload_ds, row) {
    for (var i = 0; i < dzpz_pzfj_ds.getColumnCount(); i++) {
        var col = dzpz_pzfj_ds.getColumnName(i);
        var value = dzpz_pzfj_ds.getValue(sr, i);
        dzpz_imgpool_fileupload_ds.setValue(row, col, value);
    }
}


id: 60ac944d5db2f5d22859c702
pid: 60ac944d5db2f5d22859c6de
name: functioncheckpoint
code: 60ac6f255db2fe3a155053f720210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/functioncheckpoint
nodetype: column
value: {}
createdate: 2021.05.25 12:04:12.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac6f255db2fe3a155053f720210525145216


id: 60ac944d5db2f5d22859c706
pid: 60ac944d5db2f5d22859c6de
name: functionGroup
code: 60ac750d5db2f5d22859c51120210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/functionGroup
nodetype: column
createdate: 2021.05.25 12:04:12.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c51120210525145216

value:
{"全局函数":[{"source":"function main(","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function main","index":0},{"source":"function cloneRow(","comment":"","group":"","caption":"","needRightControl":"","func":"cloneRow","funcTitle":"function cloneRow","index":1}]}


id: 60ac944d5db2f5d22859c70a
pid: 60ac944d5db2f5d22859c6de
name: functionlist
code: 60ac6f255db2fe3a155053f620210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/functionlist
nodetype: column
value: ["cloneRow","main"]
createdate: 2021.05.25 12:04:12.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac6f255db2fe3a155053f620210525145216


id: 60ac944d5db2f5d22859c70e
pid: 60ac944d5db2f5d22859c6de
name: group_AAAAAAA=
code: 60ac750d5db2f5d22859c4ed20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/group_AAAAAAA=
nodetype: column
value: false
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4ed20210525145216


id: 60ac9ea05db2f5d22859c712
pid: 60ac944d5db2f5d22859c6de
name: maxactivethreadcount
code: 60ac750d5db2f5d22859c4ce20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/maxactivethreadcount
nodetype: column
value: 30
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.306
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4ce20210525145216


id: 60ac9ea05db2f5d22859c716
pid: 60ac944d5db2f5d22859c6de
name: maxlogsize
code: 60ac750d5db2f5d22859c4cd20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/maxlogsize
nodetype: column
value: 50
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4cd20210525145216


id: 60ac9ea05db2f5d22859c71a
pid: 60ac944d5db2f5d22859c6de
name: maxwaittime
code: 60ac750d5db2f5d22859c4cf20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/maxwaittime
nodetype: column
value: 30
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4cf20210525145216


id: 60ac9ea05db2f5d22859c71e
pid: 60ac944d5db2f5d22859c6de
name: role-60ab05595db2f37491f9937f
code: 60ac750d5db2f5d22859c4ef20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/role-60ab05595db2f37491f9937f
nodetype: column
value: false
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4ef20210525145216


id: 60ac9ea05db2f5d22859c722
pid: 60ac944d5db2f5d22859c6de
name: role-default
code: 60ac750d5db2f5d22859c4ee20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/role-default
nodetype: column
value: false
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4ee20210525145216


id: 60ac9ea05db2f5d22859c726
pid: 60ac944d5db2f5d22859c6de
name: roles
code: 60ac750d5db2f5d22859c4ec20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/roles
nodetype: column
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4ec20210525145216


id: 60ac9ea05db2f5d22859c72a
pid: 60ac944d5db2f5d22859c6de
name: runningLog
code: 60ac750d5db2f5d22859c4cb20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/runningLog
nodetype: column
value: true
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4cb20210525145216


id: 60ac9ea05db2f5d22859c72e
pid: 60ac944d5db2f5d22859c6de
name: sharding
code: 60ac750d5db2f5d22859c4e820210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/sharding
nodetype: column
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4e820210525145216


id: 60ac9ea05db2f5d22859c732
pid: 60ac944d5db2f5d22859c6de
name: timeout
code: 60ac750d5db2f5d22859c4c920210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/timeout
nodetype: column
value: 300
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4c920210525145216


id: 60ac9ea05db2f5d22859c736
pid: 60ac944d5db2f5d22859c6de
name: type_rhino
code: 60ac750d5db2f5d22859c4e920210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/type_rhino
nodetype: column
value: rhino
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4e920210525145216


id: 60ac9ea05db2f5d22859c73a
pid: 60ac944d5db2f5d22859c6de
name: type_v8
code: 60ac750d5db2f5d22859c4eb20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/type_v8
nodetype: column
value: v8
createdate: 2021.05.25 11:55:51.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4eb20210525145216


id: 60ac9ea05db2f5d22859c73e
pid: 60ac944d5db2f5d22859c6de
name: writeCallingLog
code: 60ac750d5db2f5d22859c4ca20210525145216
namepath: /凭证数字化/归档相关/删除凭证所有图片回归池中
codepath: 60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中
fullname: /凭证数字化/归档相关/删除凭证所有图片回归池中/writeCallingLog
nodetype: column
value: true
createdate: 2021.05.25 11:55:48.000
lastmodifieddate: 2023.12.06 10:50:22.307
fullcode:
60b71f5a5db22398a379d9ec.60ab513d5db26b6db2c28a8c.删除凭证所有图片回归池中.60ac750d5db2f5d22859c4ca20210525145216


id: 60c1739699322db85e0325ff
pid: 609d3cfc5db2b0a331d6bb4b
name: functionlist
code: 60c1739699322db85e0325ff
namepath: /templateScriptOnServer-609d3cfc5db2b0a331d6bb4b
codepath: 609d3cfc5db2b0a331d6bb4b
fullname: /templateScriptOnServer-609d3cfc5db2b0a331d6bb4b/functionlist
fullcode: 609d3cfc5db2b0a331d6bb4b.60c1739699322db85e0325ff
nodetype: column
createdate: 2021.06.10 10:35:41.000
lastmodifieddate: 2023.12.06 10:50:22.307
value:
["realDeleteImage","moveImageToNormal","moveImageToRecycle","getImageList","getImageList2","getImageList1"]


id: 60c176909932e1a17db2e141
pid: 609d3cfc5db2b0a331d6bb4b
name: functionGroup
code: 60c176909932e1a17db2e141
namepath: /templateScriptOnServer-609d3cfc5db2b0a331d6bb4b
codepath: 609d3cfc5db2b0a331d6bb4b
fullname: /templateScriptOnServer-609d3cfc5db2b0a331d6bb4b/functionGroup
fullcode: 609d3cfc5db2b0a331d6bb4b.60c176909932e1a17db2e141
nodetype: column
createdate: 2021.06.10 10:35:41.000
lastmodifieddate: 2023.12.06 10:50:22.307
value:
{"全局函数":[{"source":"function getImageList1(","comment":"","group":"","caption":"","needRightControl":"","func":"getImageList1","funcTitle":"function getImageList1","index":0},{"source":"function getImageList2(","comment":"","group":"","caption":"","needRightControl":"","func":"getImageList2","funcTitle":"function getImageList2","index":1},{"source":"//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)\nfunction getImageList(","comment":"//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)","group":"","caption":"得到待归档的图片清单","needRightControl":"true","func":"getImageList","funcTitle":"function getImageList","index":2},{"source":"function  moveImageToRecycle(","comment":"","group":"","caption":"","needRightControl":"","func":"moveImageToRecycle","funcTitle":"function  moveImageToRecycle","index":3},{"source":"function  moveImageToNormal(","comment":"","group":"","caption":"","needRightControl":"","func":"moveImageToNormal","funcTitle":"function  moveImageToNormal","index":4},{"source":"function  realDeleteImage(","comment":"","group":"","caption":"","needRightControl":"","func":"realDeleteImage","funcTitle":"function  realDeleteImage","index":5}]}


id: 60c1bec59932e1a17db2e3da
pid: 60c1bec59932e1a17db2e3ce
name: 打开当前人员的图片回收站
code: imgaeTrash
namepath: /凭证数字化/其它
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce
fullname: /凭证数字化/其它/打开当前人员的图片回收站
fullcode: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.imgaeTrash
nodetype: leaf
createdate: 2021.06.10 15:29:56.000
lastmodifieddate: 2023.12.06 10:50:22.307
value:
function main(arg)
{
    var ret = runTask("get_dzpz_imgpool_id_of_current_user", {});
    var gguid= JSON.parse(ret).gguid;
    var url= "billedit?id=toConfirm&limit=trash&gguid="+gguid+"&action=edit&editToolbarVisible=false";
    return "<script>window.location.href='"+url+"';</script>";
}


id: 60c1c2469932e1a17db2e49e
pid: 60a31c3c5db27838e0c0129e
name: functionGroup
code: 60c1c2469932e1a17db2e49e
namepath: /templateScriptOnServer-60a31c3c5db27838e0c0129e
codepath: 60a31c3c5db27838e0c0129e
fullname: /templateScriptOnServer-60a31c3c5db27838e0c0129e/functionGroup
fullcode: 60a31c3c5db27838e0c0129e.60c1c2469932e1a17db2e49e
nodetype: column
createdate: 2021.06.10 16:03:01.000
lastmodifieddate: 2023.12.06 10:50:22.667
value:
{"全局函数":[{"source":"function getImageList1()","comment":"","group":"","caption":"","needRightControl":"","func":"getImageList1","funcTitle":"function getImageList1","index":0},{"source":"function getImageList2()","comment":"","group":"","caption":"","needRightControl":"","func":"getImageList2","funcTitle":"function getImageList2","index":1},{"source":"//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)\nfunction getImageList(groupName)","comment":"//@comment (group=,caption=得到待归档的图片清单,needRightControl=true)","group":"","caption":"得到待归档的图片清单","needRightControl":"true","func":"getImageList","funcTitle":"function getImageList","index":2}],"单据":[{"source":"//@comment (group=单据,caption=单据删除语句执行后)\nfunction afterBillDeleteOnServer(gguid, session)","comment":"//@comment (group=单据,caption=单据删除语句执行后)","group":"单据","caption":"单据删除语句执行后","needRightControl":"","func":"afterBillDeleteOnServer","funcTitle":"function afterBillDeleteOnServer","index":3}]}


id: 60c1cb909932e1a17db2e4cd
pid: 60c1bec59932e1a17db2e3ce
name: 当前人员的图片回收站地址
code: urlForTrash
namepath: /凭证数字化/其它
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce
fullname: /凭证数字化/其它/当前人员的图片回收站地址
fullcode: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
nodetype: leaf
createdate: 2021.06.10 15:29:56.000
lastmodifieddate: 2023.12.06 10:50:22.667
value:
function main(arg)
{
    var ret = runTask("get_dzpz_imgpool_id_of_current_user", {});
    var gguid= JSON.parse(ret).gguid;
    var url= "/billedit?id=toConfirm&limit=trash&gguid="+gguid+"&action=edit&editToolbarVisible=false";
    return getServiceHomeURL("app") +url  ; 
}


id: 60c1cb909932e1a17db2e4d1
pid: 60c1cb909932e1a17db2e4cd
name: anonymousRun
code: 60c1bec59932e1a17db2e3e920210610162136
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/anonymousRun
nodetype: column
value: true
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e920210610162136


id: 60c1cb909932e1a17db2e4d5
pid: 60c1cb909932e1a17db2e4cd
name: code
code: 60c1bec59932e1a17db2e40020210610162136
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/code
nodetype: column
value: urlForTrash
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e40020210610162136


id: 60c1cb909932e1a17db2e4d9
pid: 60c1cb909932e1a17db2e4cd
name: deletelogafter
code: 60c1bec59932e1a17db2e3e520210610162136
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/deletelogafter
nodetype: column
value: 7
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e520210610162136


id: 60c1cb909932e1a17db2e4e1
pid: 60c1cb909932e1a17db2e4cd
name: description
code: 60c1bf8e9932e1a17db2e41620210610162136
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/description
nodetype: column
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e41620210610162136


id: 60c1cb909932e1a17db2e4e5
pid: 60c1cb909932e1a17db2e4cd
name: enabled
code: 60c1bec59932e1a17db2e3e120210610162136
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/enabled
nodetype: column
value: true
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e120210610162136


id: 60c1cb909932e1a17db2e4e9
pid: 60c1cb909932e1a17db2e4cd
name: engine
code: 60c1bec59932e1a17db2e40320210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/engine
nodetype: column
value: rhino
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e40320210610162137


id: 60c1cb909932e1a17db2e4fd
pid: 60c1cb909932e1a17db2e4cd
name: group_4S6ZH2ECWLSY3D7EXSNOLBUF5GB2R2FHSLUITMQ=
code: 60c1bf8e9932e1a17db2e40f20210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/group_4S6ZH2ECWLSY3D7EXSNOLBUF5GB2R2FHSLUITMQ=
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40f20210610162137


id: 60c1cb909932e1a17db2e501
pid: 60c1cb909932e1a17db2e4cd
name: group_4W6IBZMPSHUKPEXIRGZA====
code: 60c1bf8e9932e1a17db2e40c20210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/group_4W6IBZMPSHUKPEXIRGZA====
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40c20210610162137


id: 60c1cb909932e1a17db2e505
pid: 60c1cb909932e1a17db2e4cd
name: group_SKNABMQ=
code: 60c1bf8e9932e1a17db2e40620210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/group_SKNABMQ=
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40620210610162137


id: 60c1cb909932e1a17db2e509
pid: 60c1cb909932e1a17db2e4cd
name: maxactivethreadcount
code: 60c1bec59932e1a17db2e3e720210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/maxactivethreadcount
nodetype: column
value: 30
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e720210610162137


id: 60c1cb909932e1a17db2e50d
pid: 60c1cb909932e1a17db2e4cd
name: maxlogsize
code: 60c1bec59932e1a17db2e3e620210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/maxlogsize
nodetype: column
value: 50
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e620210610162137


id: 60c1cb909932e1a17db2e511
pid: 60c1cb909932e1a17db2e4cd
name: maxwaittime
code: 60c1bec59932e1a17db2e3e820210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/maxwaittime
nodetype: column
value: 30
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e820210610162137


id: 60c1cb909932e1a17db2e515
pid: 60c1cb909932e1a17db2e4cd
name: role-5fffc49c9932a2f576bbc87e
code: 60c1bf8e9932e1a17db2e40d20210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-5fffc49c9932a2f576bbc87e
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40d20210610162137


id: 60c1cb909932e1a17db2e519
pid: 60c1cb909932e1a17db2e4cd
name: role-5fffc49c9932a2f576bbc8ab
code: 60c1bf8e9932e1a17db2e40e20210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-5fffc49c9932a2f576bbc8ab
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40e20210610162137


id: 60c1cb909932e1a17db2e51d
pid: 60c1cb909932e1a17db2e4cd
name: role-601109b09932445fcc3950e7
code: 60c1bf8e9932e1a17db2e40920210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-601109b09932445fcc3950e7
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40920210610162137


id: 60c1cb909932e1a17db2e521
pid: 60c1cb909932e1a17db2e4cd
name: role-608682ac993231a6fef4f736
code: 60c1bf8e9932e1a17db2e40720210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-608682ac993231a6fef4f736
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40720210610162137


id: 60c1cb909932e1a17db2e525
pid: 60c1cb909932e1a17db2e4cd
name: role-60b727a299327aec523a283e
code: 60c1bf8e9932e1a17db2e40a20210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60b727a299327aec523a283e
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40a20210610162137


id: 60c1cb909932e1a17db2e529
pid: 60c1cb909932e1a17db2e4cd
name: role-60b7489699327aec523a2ce1
code: 60c1bf8e9932e1a17db2e41020210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60b7489699327aec523a2ce1
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e41020210610162137


id: 60c1cb909932e1a17db2e52d
pid: 60c1cb909932e1a17db2e4cd
name: role-60b7489699327aec523a2cf1
code: 60c1bf8e9932e1a17db2e41120210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60b7489699327aec523a2cf1
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e41120210610162137


id: 60c1cb919932e1a17db2e531
pid: 60c1cb909932e1a17db2e4cd
name: role-60b83c5999327aec523a2d01
code: 60c1bf8e9932e1a17db2e40b20210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60b83c5999327aec523a2d01
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40b20210610162137


id: 60c1cb919932e1a17db2e535
pid: 60c1cb909932e1a17db2e4cd
name: role-60bb95269932a3ac306d0316
code: 60c1bf8e9932e1a17db2e41220210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60bb95269932a3ac306d0316
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e41220210610162137


id: 60c1cb919932e1a17db2e539
pid: 60c1cb909932e1a17db2e4cd
name: role-60bb95269932a3ac306d0326
code: 60c1bf8e9932e1a17db2e41320210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60bb95269932a3ac306d0326
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e41320210610162137


id: 60c1cb919932e1a17db2e53d
pid: 60c1cb909932e1a17db2e4cd
name: role-60bb95269932a3ac306d0336
code: 60c1bf8e9932e1a17db2e41420210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60bb95269932a3ac306d0336
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e41420210610162137


id: 60c1cb919932e1a17db2e541
pid: 60c1cb909932e1a17db2e4cd
name: role-60bb95889932a3ac306d035a
code: 60c1bf8e9932e1a17db2e41520210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-60bb95889932a3ac306d035a
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e41520210610162137


id: 60c1cb919932e1a17db2e545
pid: 60c1cb909932e1a17db2e4cd
name: role-default
code: 60c1bf8e9932e1a17db2e40820210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/role-default
nodetype: column
value: false
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40820210610162137


id: 60c1cb919932e1a17db2e549
pid: 60c1cb909932e1a17db2e4cd
name: roles
code: 60c1bf8e9932e1a17db2e40520210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/roles
nodetype: column
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40520210610162137


id: 60c1cb919932e1a17db2e54d
pid: 60c1cb909932e1a17db2e4cd
name: runningLog
code: 60c1bec59932e1a17db2e3e420210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/runningLog
nodetype: column
value: true
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e420210610162137


id: 60c1cb919932e1a17db2e551
pid: 60c1cb909932e1a17db2e4cd
name: sharding
code: 60c1bec59932e1a17db2e40120210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/sharding
nodetype: column
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e40120210610162137


id: 60c1cb919932e1a17db2e555
pid: 60c1cb909932e1a17db2e4cd
name: timeout
code: 60c1bec59932e1a17db2e3e220210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/timeout
nodetype: column
value: 300
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e220210610162137


id: 60c1cb919932e1a17db2e559
pid: 60c1cb909932e1a17db2e4cd
name: type_rhino
code: 60c1bec59932e1a17db2e40220210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/type_rhino
nodetype: column
value: rhino
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e40220210610162137


id: 60c1cb919932e1a17db2e55d
pid: 60c1cb909932e1a17db2e4cd
name: type_v8
code: 60c1bf8e9932e1a17db2e40420210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/type_v8
nodetype: column
value: v8
createdate: 2021.06.10 15:30:23.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bf8e9932e1a17db2e40420210610162137


id: 60c1cb919932e1a17db2e561
pid: 60c1cb909932e1a17db2e4cd
name: writeCallingLog
code: 60c1bec59932e1a17db2e3e320210610162137
namepath: /凭证数字化/其它/当前人员的图片回收站地址
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash
fullname: /凭证数字化/其它/当前人员的图片回收站地址/writeCallingLog
nodetype: column
value: true
createdate: 2021.06.10 15:30:06.000
lastmodifieddate: 2023.12.06 10:50:22.667
fullcode:
60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.urlForTrash.60c1bec59932e1a17db2e3e320210610162137


id: 60c4bd735db2478f9c5a1118
pid: templateScriptOnServer
name: templateScriptOnServer-60c4bd735db2478f9c5a1118
code: 60c4bd735db2478f9c5a1118
fullname: /templateScriptOnServer-60c4bd735db2478f9c5a1118
fullcode: 60c4bd735db2478f9c5a1118
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:22.667
value:
//@comment (group=,caption=构建凭证附件清单,needRightControl=false)
function getPZFJ(id) {
    var ds = newDataStore("", "select id ,   url_img , url_thumbnail ,groupname , info1 from  dzpz_pzfj where  gguid='" + id + "'  order by info2 asc, groupname ,  info1 asc ");
    var n = ds.retrieve();
    println(ds.getSelectLastRetrieved());

    var ret = [];
    for (var i = 0; i < n; i++) {

        var one = JSON.parse(ds.getJSONRow(i, true));
        one.url_img = one.url_img + "&imageForceWatermark=false"
        ret.push(one);

    }
    return ret;

}


function get_PZ_PDF_URL(id) {
    return getStringFromSQL("select url_img from app_archive where gguid='" + id + "'");
}

//单独设置某张图片的序号
function back_setImageOrder(gguid, id, order) {
    var ds = newDataStore("", `select *  from  dzpz_pzfj where  gguid='${gguid}' order by info2 asc, groupname ,info1 asc `);
    ds.setUpdateProperty("dzpz_pzfj", "id", "*", "id");
    var n = ds.retrieve();
    println(ds.getSelectLastRetrieved());
    println(n);

    if( order>n)  order=n; 

    var old_xh = 0;
    for (var i = 0; i < n; i++) {

        var xh = right('0000' + (i + 1), 4);
        ds.setValue(i, "info2", xh);

        if (ds.getString(i, "id") == id) {

            old_xh = i + 1;
            xh = right('0000' + order, 4);
            ds.setValue(i, "info2", xh);
            println( "set   "+ i+" row , xh="+ xh );
        }
    }

//往后调
// 则把在此图片之后的图片到新位置之前的图片的序号减1
    if (order > old_xh) {
        for (var i = old_xh; i < order; i++) {
            var xh = right('0000' + (i), 4);
            ds.setValue(i, "info2", xh);
            println( "change  "+ i+" row , xh="+ xh );
        }

    } else {
        //往前调，则把新位置之后的图片到当前图片序号之间的图片的序号加1 
        //下面的 i , row  +1 , -1 是看着数据试验出来 的结果，不要凭空去想象
        for (var row = order -1    ; row < old_xh -1 ; row++) {
            var i= row+1; 
            var xh = right('0000' + (i + 1), 4);
            ds.setValue(row, "info2", xh);
            println( "change  "+ row +" row , xh="+ xh );
        }
    }




    if (!ds.update(true)) println(ds.getErrorMessage());
    return true;
}

function reOrderImage(ids) {
    var sqls = [];
    for (var i = 0; i < ids.length; i++) {
        var xh = right('0000' + (i + 1), 4);
        sqls.push("update dzpz_pzfj set info2 ='" + xh + "' where id='" + ids[i] + "' ");
    }
    runSQL("", sqls, true);
    println("调整顺序完成");

}


//@comment (group=,caption=凭证号前缀,needRightControl=false)
function getPZHPrefix(corpid, ym) {
    return runTask("getPZHPrefix", { corpid: corpid, ym: ym });

}
//@comment (group=,caption=凭证号长度,needRightControl=false)
function getPZHLen(corpid) {
    return parseInt(runTask("getPZHLen", { corpid: corpid }));
}



//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)
function do_sh(id, sh) {


    //if (!isRoleGrantedToUser(currentUserId(), "60c81b135db2d209d074b697")) return { success: false, message: "没有审核权限" };



    var dzpz_ds = newDataStore("", "select * from dzpz_pz where id='" + id + "'");
    dzpz_ds.setUpdateProperty("dzpz_pz", "id", "*", "id");
    dzpz_ds.retrieve();
    if (dzpz_ds.getRowCount() == 0) {
        return { success: false, message: "凭证不存在" };
    }
    if (sh) //做审核
    {
        var verifierid = dzpz_ds.getInt(0, "verifierid");
        if (verifierid != 0) return {
            success: true, verifierid: verifierid,
            verifiername: dzpz_ds.getString(0, "verifiername"),
            verifieddate: dzpz_ds.getString(0, "verifieddate"), message: "凭证已审核，不需要重复审核"
        };
        dzpz_ds.setValue(0, "verifierid", currentUserId());
        dzpz_ds.setValue(0, "verifiername", currentUserShowName());
        dzpz_ds.setValue(0, "verifieddate", newDate());

        if (!dzpz_ds.update(true)) return { success: false, message: dzpz_ds.getError().getMessage() };

        //审核后，归档
        runTask("pz_image2pdf", {
            id: id,
            overwrite: true  //如果已存在，删除并重新生成
        });

        return {
            success: true,
            verifierid: dzpz_ds.getString(0, "verifierid"),
            verifiername: dzpz_ds.getString(0, "verifiername"),
            verifieddate: dzpz_ds.getString(0, "verifieddate")
        };

    } else {
        var verifierid = dzpz_ds.getInt(0, "verifierid");
        println(verifierid);
        if (verifierid == 0) return { success: true, message: "凭证尚未审核，不需要取消审核" };
        if (verifierid != currentUserId()) {
            if (!isRoleGrantedToUser(currentUserId(), "60c81b135db2d209d074b6a7") && currentUserId() != 1) {

                return { success: false, message: "必须由审核人或超级审核员来取消审核" };
            }
        }
        dzpz_ds.setValue(0, "verifierid", null);
        dzpz_ds.setValue(0, "verifiername", null);
        dzpz_ds.setValue(0, "verifieddate", null);

        if (!dzpz_ds.update(true)) return { success: false, message: dzpz_ds.getError().getMessage() };
        return { success: true };
    }

}



//@comment (group=,caption=图片旋转,needRightControl=false)
function do_imageRotate(id, rt) {
    var ret = imageRotate("", "dzpz_pzfj", id, rt);
    println(JSON.stringify(ret));
    return ret;
}


id: 60c7e1005db2f19751803b53
pid: 60c4bd735db2478f9c5a1118
name: functionGroup
code: 60c7e1005db2f19751803b53
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118
codepath: 60c4bd735db2478f9c5a1118
fullname: /templateScriptOnServer-60c4bd735db2478f9c5a1118/functionGroup
fullcode: 60c4bd735db2478f9c5a1118.60c7e1005db2f19751803b53
nodetype: column
createdate: 2021.06.15 07:06:40.000
lastmodifieddate: 2023.12.06 10:50:22.668
value:
{"全局函数":[{"source":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)\nfunction getPZFJ(id)","comment":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)","group":"","caption":"构建凭证附件清单","needRightControl":"false","func":"getPZFJ","funcTitle":"function getPZFJ","index":0},{"source":"function get_PZ_PDF_URL(id)","comment":"","group":"","caption":"","needRightControl":"","func":"get_PZ_PDF_URL","funcTitle":"function get_PZ_PDF_URL","index":1},{"source":"function back_setImageOrder(gguid, id, order)","comment":"","group":"","caption":"","needRightControl":"","func":"back_setImageOrder","funcTitle":"function back_setImageOrder","index":2},{"source":"function reOrderImage(ids)","comment":"","group":"","caption":"","needRightControl":"","func":"reOrderImage","funcTitle":"function reOrderImage","index":3},{"source":"//@comment (group=,caption=凭证号前缀,needRightControl=false)\nfunction getPZHPrefix(corpid, ym)","comment":"//@comment (group=,caption=凭证号前缀,needRightControl=false)","group":"","caption":"凭证号前缀","needRightControl":"false","func":"getPZHPrefix","funcTitle":"function getPZHPrefix","index":4},{"source":"//@comment (group=,caption=凭证号长度,needRightControl=false)\nfunction getPZHLen(corpid)","comment":"//@comment (group=,caption=凭证号长度,needRightControl=false)","group":"","caption":"凭证号长度","needRightControl":"false","func":"getPZHLen","funcTitle":"function getPZHLen","index":5},{"source":"//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)\nfunction do_sh(id, sh)","comment":"//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)","group":"","caption":"凭证审核或取消审核","needRightControl":"false","func":"do_sh","funcTitle":"function do_sh","index":6},{"source":"//@comment (group=,caption=图片旋转,needRightControl=false)\nfunction do_imageRotate(id, rt)","comment":"//@comment (group=,caption=图片旋转,needRightControl=false)","group":"","caption":"图片旋转","needRightControl":"false","func":"do_imageRotate","funcTitle":"function do_imageRotate","index":7}]}


id: 60c7e1015db21cf830816006
pid: 60c4bd735db2478f9c5a1118
name: functionlist
code: 60c7e1015db21cf830816006
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118
codepath: 60c4bd735db2478f9c5a1118
fullname: /templateScriptOnServer-60c4bd735db2478f9c5a1118/functionlist
fullcode: 60c4bd735db2478f9c5a1118.60c7e1015db21cf830816006
nodetype: column
createdate: 2021.06.15 07:06:42.000
lastmodifieddate: 2023.12.06 10:50:22.668
value:
["do_imageRotate","do_sh","getPZHLen","getPZHPrefix","reOrderImage","back_setImageOrder","get_PZ_PDF_URL","getPZFJ"]


id: 60c8686948741fc1098ac05a
pid: 60a31c475db27838e0c01344
name: functionGroup
code: 60c8686948741fc1098ac05a
namepath: /templateScriptOnServer-60a31c475db27838e0c01344
codepath: 60a31c475db27838e0c01344
fullname: /templateScriptOnServer-60a31c475db27838e0c01344/functionGroup
fullcode: 60a31c475db27838e0c01344.60c8686948741fc1098ac05a
nodetype: column
createdate: 2021.06.15 17:13:08.000
lastmodifieddate: 2023.12.06 10:50:23.007
value:
{"全局函数":[{"source":"function saveLabel(","comment":"","group":"","caption":"","needRightControl":"","func":"saveLabel","funcTitle":"function saveLabel","index":0}]}


id: 60c9bce19932d177d8ac5e15
pid: 60c9bce19932d177d8ac5e09
name: 凭证号长度
code: getPZHLen
namepath: /凭证数字化/设置相关
codepath: 60b71f5a5db22398a379d9ec.60c9bce19932d177d8ac5e09
fullname: /凭证数字化/设置相关/凭证号长度
fullcode: 60b71f5a5db22398a379d9ec.60c9bce19932d177d8ac5e09.getPZHLen
nodetype: leaf
createdate: 2021.06.16 16:57:40.000
lastmodifieddate: 2023.12.06 10:50:23.007
value:
function main(arg)
{

    var p= JSON.parse(arg);
    var corpid= p.corpid;
    

    var t =  getStringFromSQL(" select pzh_length  from basic_corp where code='"+ corpid+"' ");

    return  t ;
}


id: 60c9e78c9932d177d8ac5f90
pid: 60c1bec59932e1a17db2e3ce
name: 保存标签名称
code: 保存标签名称
namepath: /凭证数字化/其它
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce
fullname: /凭证数字化/其它/保存标签名称
fullcode: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.保存标签名称
nodetype: leaf
createdate: 2021.06.16 19:59:09.000
lastmodifieddate: 2023.12.06 10:50:23.007
value:
function main(arg) {
    var p = JSON.parse(arg);
    var labels = p.labels;

    var sql = [];
    sql.push(" select  '' as name from dual  ");
    for (var i = 0; i < labels.length; i++) {
        var name = labels[i];
        if (['凭证号', '记帐期'].contains(name)) continue;
        sql.push(" select '" + name + "' from dual ");
    }

    sql = " select  name from (" + sql.join(" union all ") + " ) a  where a.name not in (select labelname from dzpz_dm_bq )";
    println(sql);
    var ds = newDataStore("", sql);
    var n = ds.retrieve();
    for (var i = 0; i < n; i++) {
        var gguid = newGUID();
        var t = " insert into dzpz_dm_bq (id, gguid, billno , billdate , userid, username , labelname) values ('${id}' , '${id}','${id}', '${billdate}',1,'管理员' ,'${labelname}' )";
        t = freemarker(t, { id: gguid, billdate: date2yyyymmdd(newDate()), labelname: ds.getString(i, "name") });
        println(t);
        runSQL("", t, true);
    }

}


id: 60c9fca09932d177d8ac61aa
pid: 60c9bce19932d177d8ac5e09
name: 凭证号前缀
code: getPZHPrefix
namepath: /凭证数字化/设置相关
codepath: 60b71f5a5db22398a379d9ec.60c9bce19932d177d8ac5e09
fullname: /凭证数字化/设置相关/凭证号前缀
fullcode: 60b71f5a5db22398a379d9ec.60c9bce19932d177d8ac5e09.getPZHPrefix
nodetype: leaf
createdate: 2021.06.16 22:00:23.000
lastmodifieddate: 2023.12.06 10:50:23.008
value:
function main(arg)
{
    var p= JSON.parse(arg);
    var corpid= p.corpid;
    var ym= ''+ p.ym;
    var y= ym.substring(0,4);
    var m= ym.substring(4,6);

    var t =  getStringFromSQL(" select pzh_prefix  from basic_corp where code='"+ corpid+"' ");
    if( t=='') return t; 
    if( t.indexOf("{yy}")>=0)  t=t.replace(/[{]yy[}]/g , y.substring(2,4) );
    if( t.indexOf("{yyyy}")>=0)  t=t.replace(/[{]yyyy[}]/g , y  );
    if( t.indexOf("{mm}")>=0)  t=t.replace(/[{]mm[}]/g , m  );

    var m2= ''+ parseInt(m); // 把 01 转成 1 
    if( t.indexOf("{m}")>=0)  t=t.replace(/[{]m[}]/g , m2  );  // 1-9月直接用数字 ，而不要补0 
    
    return t; 
}


id: 60d0840b0c749ebb22855746
pid: 6181e0bcc76eefddf45ea027
name: 单个凭证图片打包PDF
code: pz_image2pdf
namepath: /凭证数字化/打包下载
codepath: 60b71f5a5db22398a379d9ec.6181e0bcc76eefddf45ea027
fullname: /凭证数字化/打包下载/单个凭证图片打包PDF
fullcode: 60b71f5a5db22398a379d9ec.6181e0bcc76eefddf45ea027.pz_image2pdf
nodetype: leaf
createdate: 2021.06.21 20:34:35.000
lastmodifieddate: 2023.12.06 10:50:23.351
value:
function main(arg) {
    println(arg );
    var p = JSON.parse(arg);
    var id = p.id;
    var overwrite = p.overwrite;

    // info2 是手工调整顺序后的序号 ，如果没有手工调整顺序，那么info2应该都是null , 
    // 这样，如果手工调整了顺序，那么以手工调整后的顺序来排序，
    //否则以(groupname优先排序，它通常是“凭证”，“附件”) 凭证排在前，附件排在后 ，同类型（groupname）文件的按原始日期来排序，

    var tds = newDataStore("", "select pzh , corpid from dzpz_pz where id='" + id + "'");
    tds.retrieve();
    var pzh = tds.getString(0, "pzh");
    var corpid = tds.getString(0, "corpid");
    println("pzh="+ pzh);
    println("corpid="+ corpid);

    var url = getStringFromSQL("select url_img  from basic_corp_seal a , basic_corp b where a.gguid=b.gguid and a.groupname='电子印章' and b.code= '" + corpid + "' ");
    println( url);

    //把附件打包成一个PDF ,生成pdf不要加水印，水印是在下载时临时加上去的
    return createArchive("dzpz", 
         id,
        "info2 asc , groupname , info1 asc ",  //附件排序规则
        overwrite, //是否强行重新生成
        '', //水印 。生成pdf不要加水印，水印是在下载时临时加上去的
        {
            left: 20,
            top: 20,
            url:  url
        },  //左上角加一个印章图片
        pzh //右上角把凭证号打上，便于查看
    );


}


id: 60d095db993254220bd8519f
pid: templateScriptOnServer
name: templateScriptOnServer-60d095db993254220bd8519f
fullname: /templateScriptOnServer-60d095db993254220bd8519f
fullcode: 60d095db993254220bd8519f
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:23.352
value:
//后端导入excel数据包
function backend_importExcelData(excelData) {
    var ret = {
        'success': false,
        'message': ''
    }
    // return { success: false, message: excelData }
    var dsn = '';
    var masterTable = 'pzdj';
    var tableName = 'pzdjex';
    //ret.message="select id,userid,verifiername from pzdj where gguid='" + currentGUID() + "'";
    //return ret;

    println("1111");
    runSQL("", "alter table  pzdjex   modify  bz  varchar(4000) ");
    runSQL("", "alter table  pzdjex   modify  rkdh  varchar(1000) ");


    var ds = newDataStore(dsn, "select id,userid,verifiername ,corpid from pzdj where gguid='" + currentGUID() + "'");
    ds.setOnceRetrieveCount(1);
    ds.retrieve('');
    if (ds.getRowCount() == 0) {
        ret.message = '请保存单据后再操作此功能!';
        return ret;
    }

    var corpid = ds.getString(0, "corpid");

    // if (ds.getString(0, "userid") != currentUserId()) {
    //     ret.message = '由于您不是制单人，不允许对当前单据做导入操作!';
    //     return ret;
    // }
    if (ds.getString(0, "verifiername") != '') {
        ret.message = '单据已审核，不允许导入操作!';
        return ret;
    }

    runSQL(dsn, "delete from " + tableName + " where gguid='" + currentGUID() + "'");

    //**********************************************
    //导入的标准功能
    var colLabel2ColName = {
        "年度": "y",
        "调整期间": "m",
        "期间": "m",
        "凭证号": "pzh",
        "调整凭证号": "pzh",
        "会计凭证号": "pzh",
        "凭证日期": "pzrq",
        "会计科目代码": "kmdm",
        "会计科目名称": "kmmc",
        "核算账号编码": "code",
        "借方金额": "jfje",
        "贷方金额": "dfje",
        "财会支出明细编码": "ckzcmxdm",
        "财会支出明细名称": "ckzcmxmc",
        "预会支出明细编码": "ykzcmxdm",
        "预会支出明细名称": "ykzcmxmc",
        "入库单号": "rkdh",
        "是否已过账": "posted",
        "摘要": "bz",
        "制单人": "zdr",
        "经办人": "jbr"
    }

    "年度\t调整期间\t凭证号\t凭证日期\t会计科目代码\t会计科目名称\t财会支出明细编码\t财会支出明细名称\t预会支出明细编码\t预会支出明细名称\t核算账号编码\t入库单号\t是否已过账\t摘要\t制单人";


    //var excelSheet;
    //for (var p in excelData) {
    //    excelSheet = excelData[p];
    //}

    var excelSheet = excelData;

    //分析字段对应关系
    var excelColIndex2ColName = {}; //excel 中的列号对应的中文题头
    var excelColName2ColIndex = {}; //中文题头对应的excel中的列号
    // var colLabel2ColName = {}; //中文题头对应到表的字段名


    var duplicateLabelCount = {};
    var colCount = 50; //最多几个列

    var headRow = 0; //题头在第几行
    var dataStartRow = 1; // 数据行从第几行开始
    //有时可能表头有多行合并，所以要检测一下
    for (var i = 0; i < colCount; i++) {
        var v = trim(sys_excelSafeValue(excelSheet, headRow, i));
        if (v == '')
            continue;
        if (duplicateLabelCount[v] == undefined) {
            duplicateLabelCount[v] = 0;
        }
        duplicateLabelCount[v] = duplicateLabelCount[v] + 1;

        if (duplicateLabelCount[v] > 1)
            v = v + duplicateLabelCount[v];
        //拼上后缀

        excelColIndex2ColName['' + i] = v;
        excelColName2ColIndex[v] = '' + i;
    }

    println(JSON.toString(excelColName2ColIndex));
    println(JSON.toString(excelColIndex2ColName));




    var RC = excelSheet.length;

    println("excel数据行数：" + RC);
    var data = [];
    for (var row = dataStartRow; row < RC; row++) {
        // if (sys_excelSafeValue(excelSheet, row, 3) == null) break; //空行，直接结束
        var oneRowData = {};
        data.push(oneRowData);
        for (var label in excelColName2ColIndex) {
            var excelCol = excelColName2ColIndex[label];
            var dbCol = colLabel2ColName[label];
            if (dbCol != null) {
                oneRowData[dbCol] = sys_excelSafeValue(excelSheet, row, excelCol);
            }
        }

    }
    //println(JSON.toString(data));

    pushMessage("dr_info", "开始导入...", currentUserId());

    var gguid = currentGUID();
    var userid = currentUserId();
    var username = currentUserName();
    var lastmodifieddate = newDate();
    // println('import_ph:' + import_ph);



    var ds = newDataStore(dsn, "select * from " + tableName);
    ds.setUpdateProperty(tableName, "id", "*", "id");
    for (var i = 0; i < data.length; i++) {
        var row = ds.insertRow(9999999);
        pushMessage("dr_info", "导入进度：" + (i + 1) + "/" + data.length, currentUserId());

        var rowData = data[i];
        for (var col in rowData) {
            var value = rowData[col];
            ds.setValue(row, col, value);
        }
        ds.setValue(row, "id", newGuid());
        ds.setValue(row, "gguid", gguid);
        ds.setValue(row, "userid", userid);
        ds.setValue(row, "username", username);
        ds.setValue(row, "lastmodifieddate", lastmodifieddate);
        ds.setValue(row, "corpid", corpid);

        if (ds.getRowCount() == 1000) {
            if (!ds.update(true)) {
                var errInfo = ds.getError().getMessage();
                println(errInfo);
                pushMessage("dr_info", "异常：" + errInfo, currentUserId());
                return;
            }
            ds.reset();
        }
    }

    pushMessage("dr_info", "正在写入数据库...", currentUserId());

    ds.update(true);
    // $alert('导入完成');
    ret.success = true;
    ret.message = ds.getString(0, "userid");

    //更新起始记账期和截止记账期
    var master_ds = newDataStore(dsn, "select * from " + masterTable);
    master_ds.setUpdateProperty(masterTable, "id", "*", "id");
    master_ds.retrieve("gguid='" + currentGUID() + "'");
    master_ds.setValue(0, "jzq_start", getStringFromSQL2(dsn, "select min(y*100+m) as t from pzdjex where gguid='" + currentGUID() + "'"));
    master_ds.setValue(0, "jzq_end", getStringFromSQL2(dsn, "select max(y*100+m) as t from pzdjex where gguid='" + currentGUID() + "'"));
    master_ds.update(true)

    pushMessage('dr_info', 'over', currentUserId());

    return ret;
}

function sys_excelSafeValue(sheet, row, col) {
    if (row > sheet.length - 1) return null;
    var dataRow = sheet[row];
    if (dataRow == null) return null;
    if (col > dataRow.length - 1) return null;
    return dataRow[col];

}


id: 60d0a25f0c74a046decf1aaa
pid: 60c1bec59932e1a17db2e3ce
name: 测试多个文件压缩后下载
code: testZIPdownload
namepath: /凭证数字化/其它
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce
fullname: /凭证数字化/其它/测试多个文件压缩后下载
fullcode: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.testZIPdownload
nodetype: leaf
createdate: 2021.06.21 22:39:02.000
lastmodifieddate: 2023.12.06 10:50:23.352
value:
function main(arg)
{
    var t1=  createArchive("dzpz", '60c9b874993292baa316b7cc' , false);
    println( JSON.stringify(t1));

    var t2=  createArchive("dzpz", '60c9b874993292baa316b7c6' , false);
    println( JSON.stringify(t2));
    
    var source=[];
    source.push( t1.data);
    source.push(t2.data);

    println( JSON.stringify(source));

    return createZipFileWith("测试压缩.zip" ,source);

}


id: 60d0a2b8993254220bd859aa
pid: 60d095db993254220bd8519f
name: functionGroup
code: 60d0a2b8993254220bd859aa
namepath: /templateScriptOnServer-60d095db993254220bd8519f
codepath: 60d095db993254220bd8519f
fullname: /templateScriptOnServer-60d095db993254220bd8519f/functionGroup
fullcode: 60d095db993254220bd8519f.60d0a2b8993254220bd859aa
nodetype: column
createdate: 2021.06.21 22:47:04.000
lastmodifieddate: 2023.12.06 10:50:23.352
value:
{"全局函数":[{"source":"function backend_importExcelData(excelData)","comment":"","group":"","caption":"","needRightControl":"","func":"backend_importExcelData","funcTitle":"function backend_importExcelData","index":0},{"source":"function sys_excelSafeValue(sheet, row, col)","comment":"","group":"","caption":"","needRightControl":"","func":"sys_excelSafeValue","funcTitle":"function sys_excelSafeValue","index":1}]}


id: 60d1732d99326f9120345714
pid: 6181e0bcc76eefddf45ea027
name: 打包下载
code: 打包下载
namepath: /凭证数字化/打包下载
codepath: 60b71f5a5db22398a379d9ec.6181e0bcc76eefddf45ea027
fullname: /凭证数字化/打包下载/打包下载
fullcode: 60b71f5a5db22398a379d9ec.6181e0bcc76eefddf45ea027.打包下载
nodetype: leaf
createdate: 2021.06.21 22:39:02.000
lastmodifieddate: 2023.12.06 10:50:23.694
value:
function main(arg) {

    println(arg);
    var p = JSON.parse(arg);
    var watermark = p.watermark; //水印
    var ids = p.ids;
    var gguid=p.gguid;
    var topic = "打包下载" + gguid;

    var exists={};
    var source = [];
    for (var i = 0; i < ids.length; i++) {
        println((i + 1) + "  " + ids[i]);
        var t = "*完成" + ((i + 1) * 100.0 / ids.length) + "%";
        println(t);
        pushMessage( topic , {actoin:'info', info: t}, -1);
        delay(10);
        if( exists[ ids[i]]!=undefined) continue; // 凭证重复了，忽略
        exists[ ids[i]]=1;
        var t = createArchive("dzpz", ids[i], "",false);//把没有归档的归档一下，已经归档的不要重复归档
        println(JSON.stringify(t));
        source.push(t.data);
    }


    println(JSON.stringify(source));
    pushMessage( topic , {actoin:'info', info:  "*正在压缩"}, -1);
    
    var ret = createZipFileWith(p.fileName, source, watermark);

    pushMessage( topic , {actoin:'over' }, -1);
    println(JSON.stringify(ret));
    return ret;

}


id: 60fa600f9932563b7c99baff
pid: templateScriptOnServer
name: templateScriptOnServer-60fa600f9932563b7c99baff
code: 60fa600f9932563b7c99baff
fullname: /templateScriptOnServer-60fa600f9932563b7c99baff
fullcode: 60fa600f9932563b7c99baff
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:23.695
value:
/**
 * 单据点击保存，前端所有的操作被转译成3种操作:insert , delete , update ,
 *  并且可以在  beforeBillSaveOnServer 中返回一些SQL语句，可以在afterBillSaveOnServer中返回一些SQL语句
 *
 * 系统分别在需要的数据库连接中执行这些语句 ， 当所有语句执行成功后，事件被提交。一些细节如下 ：
 *
 * 1 如果单据中的表，属于不同的数据库连接，那么所有的SQL语句会以连接为单位，对语句进行批量执行
 * 2 这些语句的执行顺序是：对同一个数据库连接中的语句， 先执行 beforeBillSaveOnServer 中返回的SQL语句，再执行单据操作转译得到的SQL语句，
 *   再执行 afterBillSaveOnServer 中返回的SQL语句， 当多个（或一个）数据库连接执行完这些语句，且没有错误时，所有的数据库连接做提交，否则全部回滚
 * 3 不要在 beforeBillSaveOnServer 或 afterBillSaveOnServer 中直接执行数据库操作，而是返回SQL语句，让系统批量执行它们，并控制好事务
 * 4 当执行成功后，系统再执行事件函数  afterBillSaveSuccessfulOnServer 。 此事件中可以执行任意操作，它与单据保存事件结束后才被触发执行，
 *   与单据保存并不在一个事务中。
 *
 *
 * @param gguid  要删除记录的gguid ，等同于主表的id
 * @param session  一个JSON对象，用于在整个单据保存过程中的各个事件之间传递数据。本事件做为单据保存的最后一个事件，session对象在使用后将被丢弃
 *
 *
 * @return 本函数不需要返回值
 *
 */
function afterBillSaveSuccessfulOnServer(gguid, session) {

    var corpid = getStringFromSQL("select corpid from dzpz_dy where id='" + gguid + "'");
    //2022.08.11优化，理论上不应该存在重复号码的凭证，但是加上max肯定没错，避免数据异常导致更新失败
    var sqls = ["update dzpz_dymx  set bz=null,pz_id= (select max(id) from dzpz_pz where dzpz_pz.pzh= dzpz_dymx.pzh and dzpz_pz.corpid='" + corpid + "' ) where gguid='" + gguid + "' ",
    "update dzpz_dymx  set bz='凭证号不存在' where  gguid='" + gguid + "' and not exists (select dzpz_pz.id from dzpz_pz where  dzpz_pz.pzh= dzpz_dymx.pzh  and dzpz_pz.corpid='" + corpid + "')  "

    ];

    runSQL("", sqls, true);
    println("----检测凭证是否存在完成---------")
}


/**
 * 用户任务提交后
 * @param flow 流程定义
 * @param node 开始节点
 * @param gguid 单据的gguid

 */

//@comment (group=工作流事件,caption=用户任务提交后)
function onUserTaskSubmitted(flow, userTask, gguid) {
    // println( flow.id) ; //流程定义的ID
    // println( userTask.name);
    println(JSON.stringify(userTask));
    println(gguid);
    if (userTask.id == 'id_60b3b08f27644fc18af35ba20ecd2bac') {
        var ds = newDataStore("", "select * from dzpz_dy where id='" + gguid + "'");
        ds.retrieve();

        if (ds.getInt(0, 'pass') == 0) {
            println("拒绝调阅，强制结束");
            runTask("autoOverRejectedFlow" ,{gguid:gguid} , 3000);
        }


        var moreData = ds.getString(0, "moredata");
        try {
            moreData = JSON.parse(moreData);
            //起草后，递交后调用OA的接口回写数据
            if (moreData.form_id) {
                var pass = ds.getInt(0, "pass");
                var reason = ds.getString(0, "rejectreason");
                runTask('oa_callback', { requestid: moreData.form_id, pass: pass, reason: reason });
            }
        } catch (err) {

        }

    }

    if (userTask.id == 'id_6655df8bedc641aa9bacf1720d13ce2d') //领导审批通过后，就开始打包
    {
        //领导审批通过后，就开始打包
        //2023.07.13 不要自动打包，等oa调用接口在打包，不然，oa没有通知就打包并发送邮件就不对了
        //   do_package(gguid);
    }

    println(gguid + " " + userTask.name + " 提交完成")


}

//后台打包
function do_package(gguid) {
    if (getIntFromSQL("select pass from dzpz_dy where id='" + gguid + "' ") == 0) return { success: false, message: "调阅被拒绝，禁止下载" }
    var ret = JSON.parse(runTask("package", { gguid: gguid }));
    return ret;
}



function back_urlShare(url, d, t) {
    var ret = urlShare(url, d, "day", t);
    return ret.url;
}


id: 60fa608c9932563b7c99bba5
pid: templateScriptOnServer
name: templateScriptOnServer-60fa608c9932563b7c99bba5
code: 60fa608c9932563b7c99bba5
fullname: /templateScriptOnServer-60fa608c9932563b7c99bba5
fullcode: 60fa608c9932563b7c99bba5
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:23.695
value:
function back_flow_over(gguid)
{

    //自动递交给调阅步骤
    var moduleid = 'dy';//模块ID
    var t = taskInfoForWork('dy', gguid);

    if (t.taskList == null) return { success: false, message: 'id 对应的调阅申请不存在' };

    //递交结束
    while (true) {
        if (t.taskList.length == 0) break;
        //将任务递交下去，如果任务需要签收，则先签收     
        for (var i = 0; i < t.taskList.length; i++) {
            var task = t.taskList[i];

            //可以递交，那么递交下去
            if (task.canSubmit) println(submitWork(moduleid, gguid, task.taskId));
            //需要先签收 ，那么以第一个候选人签收它
            if (task.canClaim) claimWork(moduleid, gguid, task.taskId, task.candidateUserList[0].userId);

        }
        t = taskInfoForWork('dy', gguid);

    }

}


id: 60fe08039932563b7c99c33c
pid: 60fa600f9932563b7c99baff
name: functionGroup
code: 60fe08039932563b7c99c33c
namepath: /templateScriptOnServer-60fa600f9932563b7c99baff
codepath: 60fa600f9932563b7c99baff
fullname: /templateScriptOnServer-60fa600f9932563b7c99baff/functionGroup
fullcode: 60fa600f9932563b7c99baff.60fe08039932563b7c99c33c
nodetype: column
createdate: 2021.07.26 09:02:10.000
lastmodifieddate: 2023.12.06 10:50:23.695
value:
{"全局函数":[{"source":"function afterBillSaveSuccessfulOnServer(gguid, session)","comment":"","group":"","caption":"","needRightControl":"","func":"afterBillSaveSuccessfulOnServer","funcTitle":"function afterBillSaveSuccessfulOnServer","index":0},{"source":"function do_package(gguid)","comment":"","group":"","caption":"","needRightControl":"","func":"do_package","funcTitle":"function do_package","index":2},{"source":"function back_urlShare(url, d, t)","comment":"","group":"","caption":"","needRightControl":"","func":"back_urlShare","funcTitle":"function back_urlShare","index":3}],"工作流事件":[{"source":"//@comment (group=工作流事件,caption=用户任务提交后)\nfunction onUserTaskSubmitted(flow, userTask, gguid)","comment":"//@comment (group=工作流事件,caption=用户任务提交后)","group":"工作流事件","caption":"用户任务提交后","needRightControl":"","func":"onUserTaskSubmitted","funcTitle":"function onUserTaskSubmitted","index":1}]}


id: 6151765d99326278b943fb93
pid: 60aaff095db2f37491f99012
name: functionGroup
code: 6151765d99326278b943fb93
namepath: /templateScriptOnServer-60aaff095db2f37491f99012
codepath: 60aaff095db2f37491f99012
fullname: /templateScriptOnServer-60aaff095db2f37491f99012/functionGroup
fullcode: 60aaff095db2f37491f99012.6151765d99326278b943fb93
nodetype: column
createdate: 2021.09.27 15:49:26.000
lastmodifieddate: 2023.12.06 10:50:23.696
value:
{"全局函数":[{"source":"function afterBillVerified(","comment":"","group":"","caption":"","needRightControl":"","func":"afterBillVerified","funcTitle":"function afterBillVerified","index":0},{"source":"function afterBillUnVerified(","comment":"","group":"","caption":"","needRightControl":"","func":"afterBillUnVerified","funcTitle":"function afterBillUnVerified","index":1}]}


id: 6151765d99326278b943fbc5
pid: 60aaff145db2f37491f990b8
name: functionGroup
code: 6151765d99326278b943fbc5
namepath: /templateScriptOnServer-60aaff145db2f37491f990b8
codepath: 60aaff145db2f37491f990b8
fullname: /templateScriptOnServer-60aaff145db2f37491f990b8/functionGroup
fullcode: 60aaff145db2f37491f990b8.6151765d99326278b943fbc5
nodetype: column
createdate: 2021.09.27 16:25:08.000
lastmodifieddate: 2023.12.06 10:50:24.039
value:
{"全局函数":[{"source":"function backend_import_list(","comment":"","group":"","caption":"","needRightControl":"","func":"backend_import_list","funcTitle":"function backend_import_list","index":0}]}


id: 617cc6bb99328c3820c0b3a3
pid: templateScriptOnServer
name: templateScriptOnServer-617cc6bb99328c3820c0b3a3
code: 617cc6bb99328c3820c0b3a3
fullname: /templateScriptOnServer-617cc6bb99328c3820c0b3a3
fullcode: 617cc6bb99328c3820c0b3a3
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:24.040
value:
//@comment (group=,caption=构建凭证附件清单,needRightControl=false)
function getPZFJ(id) {
    var ds = newDataStore("", "select id , url_img , url_thumbnail ,groupname , info1 from  dzpz_pzfj where  gguid='" + id + "'  order by groupname , info1 asc ");
    var n = ds.retrieve();
    var ret = [];
    for (var i = 0; i < n; i++) {
        ret.push(JSON.parse(ds.getJSONRow(i, true)));
    }
    return ret;

}


function   corpid_sync()
{
    runSQL("","update  pzdjex set  corpid= (select corpid from pzdj where pzdj.gguid= pzdjex.gguid)  where corpid is null or corpid='' " ,true);
}


id: 617f55cd99328c3820c0bf5a
pid: 617cc6bb99328c3820c0b3a3
name: functionGroup
code: 617f55cd99328c3820c0bf5a
namepath: /templateScriptOnServer-617cc6bb99328c3820c0b3a3
codepath: 617cc6bb99328c3820c0b3a3
fullname: /templateScriptOnServer-617cc6bb99328c3820c0b3a3/functionGroup
fullcode: 617cc6bb99328c3820c0b3a3.617f55cd99328c3820c0bf5a
nodetype: column
createdate: 2021.11.01 11:03:43.000
lastmodifieddate: 2023.12.06 10:50:24.040
value:
{"全局函数":[{"source":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)\r\nfunction getPZFJ(","comment":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)","group":"","caption":"构建凭证附件清单","needRightControl":"false","func":"getPZFJ","funcTitle":"function getPZFJ","index":0},{"source":"function   corpid_sync(","comment":"","group":"","caption":"","needRightControl":"","func":"corpid_sync","funcTitle":"function   corpid_sync","index":1}]}


id: 617f9bba99328c3820c0c07e
pid: 617f9bba99328c3820c0c072
name: chat
code: chat
namepath: /凭证数字化/TEMP
codepath: 60b71f5a5db22398a379d9ec.617f9bba99328c3820c0c072
fullname: /凭证数字化/TEMP/chat
fullcode: 60b71f5a5db22398a379d9ec.617f9bba99328c3820c0c072.chat
nodetype: leaf
createdate: 2021.11.01 16:12:09.000
lastmodifieddate: 2023.12.06 10:50:24.040
value:
function main()
{

   // chatWith( 1 , "工工工工工工工工工" ) ;

  // var gguid='6181e1dac76ee5afc5389218';
 
 //var topic = "打包下载" + gguid;
     
   // pushMessage(topic,  {action:"info", info:  newDate()  }, -1);

   popupInfo( -1, "系统更新，请暂停使用，请在10分钟后再继续" ); 
}


id: 6181e49ac76eefddf45ea05a
pid: 6181e4b9c76eefddf45ea0b9
name: 后台打包
code: 后台打包
namepath: /后台打包
codepath: 6181e4b9c76eefddf45ea0b9
fullname: /后台打包/后台打包
fullcode: 6181e4b9c76eefddf45ea0b9.后台打包
nodetype: leaf
createdate: 2021.11.03 09:23:58.000
lastmodifieddate: 2023.12.06 10:50:24.041
value:
function main(arg) {

    println(arg);
    var p = JSON.parse(arg);
    var watermark = p.watermark; //水印
    var ids = p.ids;
    var gguid = p.gguid;
    var mergePDF = p.mergePDF;

    var topic = "打包下载" + gguid;


    var source = [];
    //封面
    var bf = runTask("createBookFace", { id: gguid });
     println("封面");
     println(bf);
 //   source.push(JSON.parse(bf));

    //针对 每一个凭证，检查一下归档是不是已经生成， 已经生成的，不要重复再生成，没有生成的，那么就先生成它
    for (var i = 0; i < ids.length; i++) {
        println((i + 1) + "  " + ids[i].id);
        var t = "*凭证归档检测。完成" + ((i + 1) * 100.0 / ids.length) + "%";
        println(t);
        pushMessage(topic, { action: "info", info: t }, -1);
        delay(10);

        var t = runTask("pz_image2pdf", {
            id: ids[i].id,
            overwrite: false  //如果已存在，不要重新生成
        });
        println(t);

        if (mergePDF) {
            var pzhfm = runTask("createNo", { pzh:  ids[i].filenameprefix + getStringFromSQL("select pzh from dzpz_pz where id='" + ids[i].id + "'") });

            //每个凭证号加一个小封面
  //          source.push(JSON.parse(pzhfm));
        }

        var oneSource= JSON.parse(t).data;
        oneSource.filenameprefix = ids[i].filenameprefix;  
        source.push( oneSource);
    }


    //source中存放的是每个归档pdf文件的下载地址。在服务器上直接下载，走的是文件服务器下载接口，不是FileServer的http
    // 接口，所以不会自动加上水印
    println(JSON.stringify(source));
    pushMessage(topic, { action: "info", info: "*正在压缩" }, -1);
    var ret = createZipFileTask(p.fileName,
        source,
        watermark,
        500, //每个压缩文件的源文件大小合计不超过 mb 数 
        3,  //放到第3个文件服务器下
        "调阅打包/" + formatDate(newDate(), "yyyy/MM/dd"),//存放子目录
        "后台打包中",
        "后台打包完成",
        "后台打包异常",
        mergePDF, //pdf是否合并 
        {
            table: "dzpz_dy",
            gguid: gguid,

        }
    );


    println(JSON.stringify(ret));
    return ret;

}


id: 6181e7a7c76eefddf45ea191
pid: 6181e4b9c76eefddf45ea0b9
name: 后台打包中
code: 后台打包中
namepath: /后台打包
codepath: 6181e4b9c76eefddf45ea0b9
fullname: /后台打包/后台打包中
fullcode: 6181e4b9c76eefddf45ea0b9.后台打包中
nodetype: leaf
createdate: 2021.11.03 09:46:41.000
lastmodifieddate: 2023.12.06 10:50:24.515
value:
function main(arg) {

    println(arg);
    var p = JSON.parse(arg);
   
    var gguid = p.gguid;
    var topic = "打包下载" + gguid;
     
   var pc= round( parseFloat(p.currentActionPercent),0);
   if( pc==null) pc=1;
    pushMessage(topic,  {action:"info", info: p.currentAction+":"+ pc +"%"}, -1);
}


id: 6181ea0bc76eefddf45ea1e5
pid: 6181e4b9c76eefddf45ea0b9
name: 后台打包完成
code: 后台打包完成
namepath: /后台打包
codepath: 6181e4b9c76eefddf45ea0b9
fullname: /后台打包/后台打包完成
fullcode: 6181e4b9c76eefddf45ea0b9.后台打包完成
nodetype: leaf
createdate: 2021.11.03 09:47:04.000
lastmodifieddate: 2023.12.06 10:50:24.515
value:
function main(arg) {

    println(arg);
    var p = JSON.parse(arg);

    var gguid = p.gguid;
    var topic = "打包下载" + gguid;

    var ds = newDataStore("", "select * from dzpz_dy");
    ds.setUpdateProperty("dzpz_dy", "id", "*", "id");
    ds.retrieve(" id='" + gguid + "'");
    ds.setValue(0, "ziptaskid", "");
    ds.setValue(0, "zipresult", JSON.stringify(p.zipFiles));
    if(!ds.update(true)) println( ds.getError().getMessage());

    pushMessage(topic, { action: "gameOver", result: p }, -1);

   println(ds.getJSONRow(0, true).replace(/,/g , '<br>'));
   var action_after_pack = ds.getString(0, "action_after_pack");
   var email = ds.getString(0, "email");
    println( "action_after_pack="+ action_after_pack);
    println("email="+ email);

    // 因为打包是异步的，所以打包后续动作放在这里处理
    if (action_after_pack !='' || email!='') {
        println('发送邮件');
        runTask("action_after_pack", { gguid: gguid });
    }else{
        println("打包完成，无需后续操作");

    }

    //发送消息给申请人
    var html = [];
    html.push("调阅申请已审批通过，点击链接下载：<br><ul>");
    for (var i = 0; i < p.zipFiles.length; i++) {
        var url = '' + p.zipFiles[i].url;
        url = url.replace(/&action=view/g, '&action=download');
        html.push('<li><a href="' + url + '" target="_blank">' + p.zipFiles[i].fileName + '</a></li>');
    }
    html.push('</ul>');
    var userid = ds.getInt(0, "userid");
    println(html.join(''));
    chatWith(userid, html.join(''));



}


id: 6181ea0bc76eefddf45ea231
pid: 6181e4b9c76eefddf45ea0b9
name: 后台打包异常
code: 后台打包异常
namepath: /后台打包
codepath: 6181e4b9c76eefddf45ea0b9
fullname: /后台打包/后台打包异常
fullcode: 6181e4b9c76eefddf45ea0b9.后台打包异常
nodetype: leaf
createdate: 2021.11.03 09:47:19.000
lastmodifieddate: 2023.12.06 10:50:24.516
value:
function main(arg) {

    println(arg);
    var p = JSON.parse(arg);
   
    var gguid = p.gguid;
    var topic = "打包下载" + gguid;
     
    pushMessage(topic,  {action:"error",  info: p.message }, -1);
    
}


id: 6183205499328c3820c0c8d9
pid: templateScriptOnServer
name: templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046
code: 6183205499328c3820c0c8d9
fullname: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046
fullcode: 6183205499328c3820c0c8d9
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:24.862
value:
//@comment (group=,caption=构建凭证附件清单,needRightControl=false)
function getPZFJ(id) {
    var ds = newDataStore("", "select id , url_img , url_thumbnail ,groupname , info1 from  dzpz_pzfj where  gguid='" + id + "'  order by info2 asc,groupname , info1 asc ");
    var n = ds.retrieve();
    println(ds.getSelectLastRetrieved());
    var ret = [];
    for (var i = 0; i < n; i++) {
        var one = JSON.parse(ds.getJSONRow(i, true));
        one.url_img = one.url_img + "&imageForceWatermark=false"
        ret.push(one);
    }
    return ret;

}




//@comment (group=,caption=凭证号前缀,needRightControl=false)
function getPZHPrefix(corpid, ym) {
    return runTask("getPZHPrefix", { corpid: corpid, ym: ym });

}
//@comment (group=,caption=凭证号长度,needRightControl=false)
function getPZHLen(corpid) {
    return parseInt(runTask("getPZHLen", { corpid: corpid }));
}



//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)
function do_sh(id, sh) {


    //if (!isRoleGrantedToUser(currentUserId(), "60c81b135db2d209d074b697")) return { success: false, message: "没有审核权限" };



    var dzpz_ds = newDataStore("", "select * from dzpz_pz where id='" + id + "'");
    dzpz_ds.setUpdateProperty("dzpz_pz", "id", "*", "id");
    dzpz_ds.retrieve();
    if (dzpz_ds.getRowCount() == 0) {
        return { success: false, message: "凭证不存在" };
    }
    if (sh) //做审核
    {
        var verifierid = dzpz_ds.getInt(0, "verifierid");
        if (verifierid != 0) return {
            success: true, verifierid: verifierid,
            verifiername: dzpz_ds.getString(0, "verifiername"),
            verifieddate: dzpz_ds.getString(0, "verifieddate"), message: "凭证已审核，不需要重复审核"
        };
        dzpz_ds.setValue(0, "verifierid", currentUserId());
        dzpz_ds.setValue(0, "verifiername", currentUserShowName());
        dzpz_ds.setValue(0, "verifieddate", newDate());

        if (!dzpz_ds.update(true)) return { success: false, message: dzpz_ds.getError().getMessage() };

        //审核后，归档
        runTask("pz_image2pdf", {
            id: id,
            overwrite: true  //如果已存在，删除并重新生成
        });

        return {
            success: true,
            verifierid: dzpz_ds.getString(0, "verifierid"),
            verifiername: dzpz_ds.getString(0, "verifiername"),
            verifieddate: dzpz_ds.getString(0, "verifieddate")
        };

    } else {
        var verifierid = dzpz_ds.getInt(0, "verifierid");
        println(verifierid);
        if (verifierid == 0) return { success: true, message: "凭证尚未审核，不需要取消审核" };
        if (verifierid != currentUserId()) {
            if (!isRoleGrantedToUser(currentUserId(), "60c81b135db2d209d074b6a7")) {

                return { success: false, message: "必须由审核人或超级审核员来取消审核" };
            }
        }
        dzpz_ds.setValue(0, "verifierid", null);
        dzpz_ds.setValue(0, "verifiername", null);
        dzpz_ds.setValue(0, "verifieddate", null);

        if (!dzpz_ds.update(true)) return { success: false, message: dzpz_ds.getError().getMessage() };
        return { success: true };
    }

}

function beWhere_code(st_code) {
    return "pzh in(select pzh from pzdjex where code='" + st_code + "')"
}


id: 6183205699328c3820c0cbef
pid: 6183205499328c3820c0c8d9
name: functionGroup
code: 60c7e1005db2f19751803b5320211104075046
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046
codepath: 6183205499328c3820c0c8d9
fullname: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046/functionGroup
fullcode: 6183205499328c3820c0c8d9.60c7e1005db2f19751803b5320211104075046
nodetype: column
createdate: 2021.06.15 07:06:40.000
lastmodifieddate: 2023.12.06 10:50:24.862
value:
{"全局函数":[{"source":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)\nfunction getPZFJ(","comment":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)","group":"","caption":"构建凭证附件清单","needRightControl":"false","func":"getPZFJ","funcTitle":"function getPZFJ","index":0},{"source":"//@comment (group=,caption=凭证号前缀,needRightControl=false)\nfunction getPZHPrefix(","comment":"//@comment (group=,caption=凭证号前缀,needRightControl=false)","group":"","caption":"凭证号前缀","needRightControl":"false","func":"getPZHPrefix","funcTitle":"function getPZHPrefix","index":1},{"source":"//@comment (group=,caption=凭证号长度,needRightControl=false)\nfunction getPZHLen(","comment":"//@comment (group=,caption=凭证号长度,needRightControl=false)","group":"","caption":"凭证号长度","needRightControl":"false","func":"getPZHLen","funcTitle":"function getPZHLen","index":2},{"source":"//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)\nfunction do_sh(","comment":"//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)","group":"","caption":"凭证审核或取消审核","needRightControl":"false","func":"do_sh","funcTitle":"function do_sh","index":3},{"source":"function beWhere_code(","comment":"","group":"","caption":"","needRightControl":"","func":"beWhere_code","funcTitle":"function beWhere_code","index":4}]}


id: 6183205699328c3820c0cbf7
pid: 6183205499328c3820c0c8d9
name: group_4S6ZH2ECWLSY3D7EXSNOLBUF5GB2R2FHSLUITMQ=
code: 60c815e85db2d209d074b66620211104075046
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046
codepath: 6183205499328c3820c0c8d9
fullcode: 6183205499328c3820c0c8d9.60c815e85db2d209d074b66620211104075046
nodetype: column
value: false
createdate: 2021.06.15 11:05:42.000
lastmodifieddate: 2023.12.06 10:50:24.862
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046/group_4S6ZH2ECWLSY3D7EXSNOLBUF5GB2R2FHSLUITMQ=


id: 61838c34f80e9a6b4ee38de3
pid: 6181e4b9c76eefddf45ea0b9
name: 终止打包
code: 终止打包
namepath: /后台打包
codepath: 6181e4b9c76eefddf45ea0b9
fullname: /后台打包/终止打包
fullcode: 6181e4b9c76eefddf45ea0b9.终止打包
nodetype: leaf
createdate: 2021.11.04 15:58:21.000
lastmodifieddate: 2023.12.06 10:50:24.863
value:
function main(arg)
{
    var p= JSON.parse(arg);
    var taskid= p.id;
    cancelCreateZipFileTask( taskid);
    return {success:true};
    
}


id: 6188ead59932f1a68ca6b9a3
pid: 6188ead59932f1a68ca6b997
name: 缩小图片大小
code: imageResize
namepath: /凭证数字化/调整尺寸
codepath: 60b71f5a5db22398a379d9ec.6188ead59932f1a68ca6b997
fullname: /凭证数字化/调整尺寸/缩小图片大小
fullcode: 60b71f5a5db22398a379d9ec.6188ead59932f1a68ca6b997.imageResize
nodetype: leaf
createdate: 2021.11.08 21:13:03.000
lastmodifieddate: 2023.12.06 10:50:24.863
value:
function main(arg)
{

    var targetSize =2538;

    var ym='202001';
    //注意， 不是宿主机的目录，是docker容器中的目录
    var root="D:/appFileRoot/FileServer/电子凭证/";

    //找出这个月，上传的图片在哪些目录中
    var ds1= newDataStore("","select    distinct    left ( objectname ,  LENGTH(objectname) - INSTR(REVERSE( objectname),'/')) as path  from dzpz_pzfj where gguid in ( select gguid from  dzpz_pz where ym="+ym+ " )   ");
    var n=ds1.retrieve();

    var ds2= newDataStore("", " select objectname from dzpz_pzfj where gguid in (select id from dzpz_pz where ym="+ym+" ) ");

    println( ym+"的文件分布在"+n+"个目录中");
    for( var i=0;i<n;i++)
    {
        var objectPath= ds1.getString(i,'path');
        
        var m= ds2.retrieve("  left ( objectname ,  LENGTH(objectname) - INSTR(REVERSE( objectname),'/'))  = '"+objectPath+"' ");
        println( (i+1)+": "+objectPath +" 中，"+ym+"月的有"+m+"张图片");

        var bakPath= root+ objectPath+"/bak";
        mkDirs( bakPath);
        println("创建备份目录："+ bakPath);
        for( j =0;j<m;j++)
        {
            println( (i+1)+"/"+ m ); 
            var objectName=  ''+ ds2.getString(j,"objectname");
            var sourceFile = root+objectName;
            var onlyName= objectName.substr( objectName.lastIndexOf("/")+1);
            var bakFileName= bakPath + '/'+ onlyName; 
            if( ! fileExists( bakFileName ) )
            {
                println("备份文件："+ onlyName+" 到 "+ bakFileName);
                fileCopy( sourceFile, bakFileName , false); 
            }else{
                println("备份文件"+ bakFileName+" 已存在，把备份文件复制回来，重新resize");
                fileCopy( bakFileName, sourceFile , true) ;
            }

            var err=imageResize( sourceFile , targetSize) ;
           //如果resize后文件还变大了，那么还是字节使用原来的文件吧
           var os= fileSize( bakFileName) ;
           var ns =  fileSize(sourceFile) ;
           println('原来文件大小为'+os +' , 缩放后大小为：'+ns);
           if( os <ns )
           {
               println(' resize 后文件变大，放弃，还原为原来的文件');
                fileCopy( bakFileName, sourceFile , true) ;
           }
          
            
        }
    }

    println( 'over');
    return 'over';

}


id: 618b531c9932fda9010e7047
pid: 618b531c9932fda9010e703a
name: 索引
code: createIndex
namepath: /系统管理
codepath: 618b531c9932fda9010e703a
fullname: /系统管理/索引
fullcode: 618b531c9932fda9010e703a.createIndex
nodetype: leaf
createdate: 2021.11.10 13:38:51.000
lastmodifieddate: 2023.12.06 10:50:25.246
value:
function main()
{
    runSQL(''," create index di_dzpz_pzfj_gguid_groupname_info1 on dzpz_pzfj ( gguid, groupname, info1) ","");
    runSQL(''," create index di_dzpz_pz_corpid_ym_pzh on dzpz_pz  ( corpid, ym,pzh  )",true);

}


id: 61987c6799324840d69f7f72
pid: 6197664a99324840d69f7f22
name: functionGroup
code: 61987c6799324840d69f7f72
namepath: /凭证数字化/其它/客户端日志
codepath: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.remoteLog
fullname: /凭证数字化/其它/客户端日志/functionGroup
fullcode: 60b71f5a5db22398a379d9ec.60c1bec59932e1a17db2e3ce.remoteLog.61987c6799324840d69f7f72
nodetype: column
createdate: 2021.11.20 12:41:53.000
lastmodifieddate: 2023.12.06 10:50:25.600
value:
{"全局函数":[{"source":"function  main(","comment":"","group":"","caption":"","needRightControl":"","func":"main","funcTitle":"function  main","index":0}]}


id: 619a5454993208680e522973
pid: templateScriptOnServer
name: templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
code: 619a5454993208680e522973
fullname: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
fullcode: 619a5454993208680e522973
nodetype: leaf
lastmodifieddate: 2023.12.06 10:50:25.601
value:
//@comment (group=,caption=构建凭证附件清单,needRightControl=false)
function getPZFJ(id) {
    var ds = newDataStore("", "select id , url_img , url_thumbnail ,groupname , info1 from  dzpz_pzfj where  gguid='" + id + "'  order by info2 asc,groupname , info1 asc ");
    var n = ds.retrieve();
    println( ds.getSelectLastRetrieved());
    var ret = [];
    for (var i = 0; i < n; i++) {
        var one= JSON.parse(ds.getJSONRow(i, true));
        one.url_img = one.url_img+"&imageForceWatermark=false"
        ret.push(one);
    }
    return ret;

}




//@comment (group=,caption=凭证号前缀,needRightControl=false)
function  getPZHPrefix(corpid,ym)
{
    return runTask("getPZHPrefix" ,{corpid:corpid, ym:ym});
    
}
//@comment (group=,caption=凭证号长度,needRightControl=false)
function getPZHLen(corpid)
{
    return  parseInt( runTask("getPZHLen",{corpid:corpid}));
}



//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)
function do_sh(id, sh) {


    //if (!isRoleGrantedToUser(currentUserId(), "60c81b135db2d209d074b697")) return { success: false, message: "没有审核权限" };



    var dzpz_ds = newDataStore("", "select * from dzpz_pz where id='" + id + "'");
    dzpz_ds.setUpdateProperty("dzpz_pz", "id", "*", "id");
    dzpz_ds.retrieve();
    if (dzpz_ds.getRowCount() == 0) {
        return { success: false, message: "凭证不存在" };
    }
    if (sh) //做审核
    {
        var verifierid = dzpz_ds.getInt(0, "verifierid");
        if (verifierid != 0) return {
            success: true, verifierid: verifierid,
            verifiername: dzpz_ds.getString(0, "verifiername"),
            verifieddate: dzpz_ds.getString(0, "verifieddate"), message: "凭证已审核，不需要重复审核"
        };
        dzpz_ds.setValue(0, "verifierid", currentUserId());
        dzpz_ds.setValue(0, "verifiername", currentUserShowName());
        dzpz_ds.setValue(0, "verifieddate", newDate());

        if (!dzpz_ds.update(true)) return { success: false, message: dzpz_ds.getError().getMessage() };

        //审核后，归档
        runTask("pz_image2pdf" ,{id:id , 
            overwrite:true  //如果已存在，删除并重新生成
            });
            
        return {
            success: true,
            verifierid: dzpz_ds.getString(0, "verifierid"),
            verifiername: dzpz_ds.getString(0, "verifiername"),
            verifieddate: dzpz_ds.getString(0, "verifieddate")
        };

    } else {
        var verifierid = dzpz_ds.getInt(0, "verifierid");
        println(verifierid);
        if (verifierid == 0) return { success: true, message: "凭证尚未审核，不需要取消审核" };
        if (verifierid != currentUserId()) {
            if (!isRoleGrantedToUser(currentUserId(), "60c81b135db2d209d074b6a7")) {

                return { success: false, message: "必须由审核人或超级审核员来取消审核" };
            }
        }
        dzpz_ds.setValue(0, "verifierid", null);
        dzpz_ds.setValue(0, "verifiername", null);
        dzpz_ds.setValue(0, "verifieddate", null);

        if (!dzpz_ds.update(true)) return { success: false, message: dzpz_ds.getError().getMessage() };
        return { success: true };
    }

}


id: 619a5456993208680e522c01
pid: 619a5454993208680e522973
name: deletelogafter
code: 60c7d6795db2f19751803b472021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c7d6795db2f19751803b472021110407504620211121221446
nodetype: column
value: 7
createdate: 2021.06.15 07:06:27.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/deletelogafter


id: 619a5456993208680e522c19
pid: 619a5454993208680e522973
name: functioncheckpoint
code: 60c7e1015db21cf8308160072021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c7e1015db21cf8308160072021110407504620211121221446
nodetype: column
value: {}
createdate: 2021.06.15 07:06:42.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/functioncheckpoint


id: 619a5456993208680e522c1d
pid: 619a5454993208680e522973
name: functionGroup
code: 60c7e1005db2f19751803b532021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c7e1005db2f19751803b532021110407504620211121221446
nodetype: column
createdate: 2021.06.15 07:06:40.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/functionGroup

value:
{"全局函数":[{"source":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)\nfunction getPZFJ(","comment":"//@comment (group=,caption=构建凭证附件清单,needRightControl=false)","group":"","caption":"构建凭证附件清单","needRightControl":"false","func":"getPZFJ","funcTitle":"function getPZFJ","index":0},{"source":"//@comment (group=,caption=凭证号前缀,needRightControl=false)\nfunction  getPZHPrefix(","comment":"//@comment (group=,caption=凭证号前缀,needRightControl=false)","group":"","caption":"凭证号前缀","needRightControl":"false","func":"getPZHPrefix","funcTitle":"function  getPZHPrefix","index":1},{"source":"//@comment (group=,caption=凭证号长度,needRightControl=false)\nfunction getPZHLen(","comment":"//@comment (group=,caption=凭证号长度,needRightControl=false)","group":"","caption":"凭证号长度","needRightControl":"false","func":"getPZHLen","funcTitle":"function getPZHLen","index":2},{"source":"//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)\nfunction do_sh(","comment":"//@comment (group=,caption=凭证审核或取消审核,needRightControl=false)","group":"","caption":"凭证审核或取消审核","needRightControl":"false","func":"do_sh","funcTitle":"function do_sh","index":3}]}


id: 619a5456993208680e522c25
pid: 619a5454993208680e522973
name: group_4S6ZH2ECWLSY3D7EXSNOLBUF5GB2R2FHSLUITMQ=
code: 60c815e85db2d209d074b6662021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6662021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:42.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/group_4S6ZH2ECWLSY3D7EXSNOLBUF5GB2R2FHSLUITMQ=


id: 619a5456993208680e522c29
pid: 619a5454993208680e522973
name: group_4W6IBZMPSHUKPEXIRGZA====
code: 60c815e85db2d209d074b6632021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6632021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:41.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/group_4W6IBZMPSHUKPEXIRGZA====


id: 619a5456993208680e522c2d
pid: 619a5454993208680e522973
name: group_AAAAAAA=
code: 60c815e85db2d209d074b65d2021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b65d2021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:40.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/group_AAAAAAA=


id: 619a5456993208680e522c31
pid: 619a5454993208680e522973
name: maxactivethreadcount
code: 60c7d6795db2f19751803b492021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c7d6795db2f19751803b492021110407504620211121221446
nodetype: column
value: 100
createdate: 2021.06.15 07:06:27.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/maxactivethreadcount


id: 619a5456993208680e522c3d
pid: 619a5454993208680e522973
name: role-5fffc49c9932a2f576bbc87e
code: 60c815e85db2d209d074b6642021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6642021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:42.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-5fffc49c9932a2f576bbc87e


id: 619a5456993208680e522c41
pid: 619a5454993208680e522973
name: role-5fffc49c9932a2f576bbc8ab
code: 60c815e85db2d209d074b6652021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6652021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:42.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-5fffc49c9932a2f576bbc8ab


id: 619a5456993208680e522c45
pid: 619a5454993208680e522973
name: role-601109b09932445fcc3950e7
code: 60c815e85db2d209d074b6602021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6602021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:41.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-601109b09932445fcc3950e7


id: 619a5456993208680e522c49
pid: 619a5454993208680e522973
name: role-608682ac993231a6fef4f736
code: 60c815e85db2d209d074b65e2021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b65e2021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:40.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-608682ac993231a6fef4f736


id: 619a5456993208680e522c4d
pid: 619a5454993208680e522973
name: role-60b727a299327aec523a283e
code: 60c815e85db2d209d074b6612021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6612021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:41.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60b727a299327aec523a283e


id: 619a5456993208680e522c51
pid: 619a5454993208680e522973
name: role-60b7489699327aec523a2ce1
code: 60c815e85db2d209d074b6672021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6672021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:42.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60b7489699327aec523a2ce1


id: 619a5456993208680e522c55
pid: 619a5454993208680e522973
name: role-60b7489699327aec523a2cf1
code: 60c815e85db2d209d074b6682021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6682021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:42.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60b7489699327aec523a2cf1


id: 619a5456993208680e522c59
pid: 619a5454993208680e522973
name: role-60b83c5999327aec523a2d01
code: 60c815e85db2d209d074b6622021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6622021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:41.000
lastmodifieddate: 2023.12.06 10:50:25.601
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60b83c5999327aec523a2d01


id: 619a5456993208680e522c5d
pid: 619a5454993208680e522973
name: role-60bb95269932a3ac306d0316
code: 60c815e85db2d209d074b6692021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b6692021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:43.000
lastmodifieddate: 2023.12.06 10:50:25.602
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60bb95269932a3ac306d0316


id: 619a5456993208680e522c61
pid: 619a5454993208680e522973
name: role-60bb95269932a3ac306d0326
code: 60c815e85db2d209d074b66a2021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b66a2021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:43.000
lastmodifieddate: 2023.12.06 10:50:25.602
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60bb95269932a3ac306d0326


id: 619a5456993208680e522c65
pid: 619a5454993208680e522973
name: role-60bb95269932a3ac306d0336
code: 60c815e85db2d209d074b66b2021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b66b2021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:43.000
lastmodifieddate: 2023.12.06 10:50:25.602
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60bb95269932a3ac306d0336


id: 619a5456993208680e522c69
pid: 619a5454993208680e522973
name: role-60bb95889932a3ac306d035a
code: 60c815e85db2d209d074b66c2021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c815e85db2d209d074b66c2021110407504620211121221446
nodetype: column
value: false
createdate: 2021.06.15 11:05:43.000
lastmodifieddate: 2023.12.06 10:50:25.602
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/role-60bb95889932a3ac306d035a


id: 619a5456993208680e522c89
pid: 619a5454993208680e522973
name: writeCallingLog
code: 60c7d6795db2f19751803b452021110407504620211121221446
namepath: /templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446
codepath: 619a5454993208680e522973
fullcode: 619a5454993208680e522973.60c7d6795db2f19751803b452021110407504620211121221446
nodetype: column
value: true
createdate: 2021.06.15 07:06:26.000
lastmodifieddate: 2023.12.06 10:50:25.602
fullname:
/templateScriptOnServer-60c4bd735db2478f9c5a1118clone20211104075046clone20211121221446/writeCallingLog


id: 619e193003748a0409f52e4d
pid: 617f9bba99328c3820c0c072
name: 测试生成pdf
code: test-createpdf
namepath: /凭证数字化/TEMP
codepath: 60b71f5a5db22398a379d9ec.617f9bba99328c3820c0c072
fullname: /凭证数字化/TEMP/测试生成pdf
fullcode: 60b71f5a5db22398a379d9ec.617f9bba99328c3820c0c072.test-createpdf
nodetype: leaf
createdate: 2021.11.24 18:51:29.000
lastmodifieddate: 2023.12.06 10:50:26.059
value:
function main()
{
     var  s=  getProperty( '/凭证调阅封面' ,'');

     return app.fo2pdf(s , "aaa.pdf", 1 , "fo2pdf");




}


id: 61a89a3f14106903676b97fa
pid: 6181e4b9c76eefddf45ea0b9
name: 生成调阅封面
code: createBookFace
namepath: /后台打包
codepath: 6181e4b9c76eefddf45ea0b9
fullname: /后台打包/生成调阅封面
fullcode: 6181e4b9c76eefddf45ea0b9.createBookFace
nodetype: leaf
createdate: 2021.12.02 18:19:31.000
lastmodifieddate: 2023.12.06 10:50:26.060
value:
function main(arg)
{

    var p=JSON.parse(arg);
    var id= p.id || '619da5140374348f72330eff--' ;

    var ds=newDataStore("","select billdate , billno , reader , leaderid , '' as leader, summary  from  dzpz_dy  where id='"+id+"'");
    ds.retrieve();
    if( ds.getRowCount()==0) ds.insertRow(0);
    
    var param= ds.getJSON(0,true,false,false,true).toString() ;
    param=JSON.parse(param);
    param.billdate=  (''+param.billdate).substring(0,10);
    param.leader =  getUserInfoById (  param.leaderid).showname;  

    var mb= getProperty( "/凭证调阅封面", '') ;
   
    var source=  freemarker( mb, param ) ;
   

    var url= getServiceHomeURL( "fop" )+"/fo2pdf?serverIndex=1&subPath=dzpz_dy_bookface&fileName=封面.pdf";
    url= safeURL(url) ;
    var ret= httpPost( url ,{body: source} );
    println(ret.response); 
    return  ret.response; 

}


id: 61a971b1db74f189cff63e41
pid: 6181e4b9c76eefddf45ea0b9
name: 生成凭证号页面
code: createNO
namepath: /后台打包
codepath: 6181e4b9c76eefddf45ea0b9
fullname: /后台打包/生成凭证号页面
fullcode: 6181e4b9c76eefddf45ea0b9.createNO
nodetype: leaf
createdate: 2021.12.02 18:19:31.000
lastmodifieddate: 2023.12.06 10:50:26.060
value:
function main(arg)
{

    var p=JSON.parse(arg);
    var pzh= p.pzh||'test0001'; 
 
    var mb= getProperty( "/凭证调阅凭证号页", '') ;
   
    var source=  freemarker( mb, {pzh:pzh} ) ;
    
    var url= getServiceHomeURL( "fop" )+"/fo2pdf?serverIndex=1&subPath=dzpz_dy_bookface&fileName="+pzh+".pdf";
    url= safeURL(url) ;
    var ret= httpPost( url ,{body: source} );
    println(ret.response); 
    return  ret.response; 

}


id: 631994449932f19609c86899
pid: 609d3f3f5db2b0a331d6bced
name: useinparam
code: 631994449932f19609c86899
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/useinparam
nodetype: column
value: false
createdate: 2022.09.08 15:11:25.000
lastmodifieddate: 2023.12.06 10:50:26.417
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.631994449932f19609c86899


id: 631994449932f19609c8689a
pid: 609d3f3f5db2b0a331d6bced
name: useoutparam
code: 631994449932f19609c8689a
namepath: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息
codepath: 60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf
fullname: /凭证数字化/由Electron调用的接口/Electron调用本接口向自已推送消息/useoutparam
nodetype: column
value: false
createdate: 2022.09.08 15:11:25.000
lastmodifieddate: 2023.12.06 10:50:26.417
fullcode:
60b71f5a5db22398a379d9ec.609d3f3f5db2b0a331d6bce1.electronPushMessageToSelf.631994449932f19609c8689a


id: 6371e8229932b5d98a4a2e1b
pid: 6371e8229932b5d98a4a2e0f
name: 导入凭证信息与归档信息的互更
code: updateForReport
namepath: /统计准备
codepath: 6371e8229932b5d98a4a2e0f
fullname: /统计准备/导入凭证信息与归档信息的互更
fullcode: 6371e8229932b5d98a4a2e0f.updateForReport
nodetype: leaf
createdate: 2022.11.14 15:39:43.000
lastmodifieddate: 2023.12.06 10:50:26.775
value:
/**
 *   导入凭证信息需要更新它有没有被影像化
 * 
 *    影像归档需要更新有没有对应的导入信息 
 *    这里直接更新到各自的字段中，便于统计分析 
 *
 */
function main(arg) {


    runSQL("", " alter table  pzdjex add  pzsl_pic int null ",false);  // 1 表示已经影像化
    runSQL("", " alter table  pzdjex add  pic_pz int null ",false);  // 对应的凭证图片张数
    runSQL("", " alter table  pzdjex add  pic_fj int null ",false);  //对应的附件图片张数
    runSQL("", " alter table  pzdjex add  dzpz_id  varchar(40)  null ",false);  //对应的影像化记录的ID
    runSQL("", "alter table dzpz_pz  add pzdj_exist int null ",false); //  1 表示有对应的导入的凭证信息， 0 表示没有
    println("=========================");
    runSQL("", "update pzdjex  set pic_pz=0 where pic_pz is null ",true);
    runSQL("", "update pzdjex  set pic_fj=0 where pic_fj is null ",true);

    runSQL("","create index  i_pzdjex_4 on pzdjex ( y,m,corpid,pzh) ",true);
    runSQL("","create index  i_pzdjex_pzh on pzdjex (pzh) ",true);
    

    var p= JSON.parse(arg);
    var y=0;
    var m=0;
    var ym='';
    if( p.y !=undefined) 
    {
        y=p.y;
        m=p.m;
        ym= ''+    (y*100  + m) ; 
    }
    println("y,m = "+ y+","+m );

    println("ym = "+ ym );

    runSQL("", " update pzdjex  set    dzpz_id= null,   pic_pz =0  ,   pic_fj= 0 where "+ 
         (( y==0)? "" : "  pzdjex.y ="+y+"  and  pzdjex.m = "+ m+ " and "   ) + 
         " not exists ( select id from  dzpz_pz c   where  (  pzdjex.corpid = c.corpid and pzdjex.pzh = c.pzh  ) ) " ,true);
  						
	runSQL("", "update pzdjex  join pzdj on ( pzdjex.corpid is null  and "+
                (( y==0)? "" : "  pzdjex.y ="+y+"  and  pzdjex.m = "+ m+ " and "   ) + 
                "  pzdjex.gguid= pzdj.gguid)   set  pzdjex.corpid = pzdj.corpid ",true);
						 

    runSQL("",  " update pzdjex  " + 
             " inner join  dzpz_pz c   on ( "+
              (( y==0)? "" : "  pzdjex.y ="+y+"  and  pzdjex.m = "+ m+ " and "   ) + 
             " pzdjex.corpid = c.corpid and pzdjex.pzh = c.pzh  ) "+
            " set   pzdjex.dzpz_id= c.id,  pzdjex.pic_pz =1 ,  pzdjex.pic_pz = c.pz , pzdjex.pic_fj= c.fj  " 
            , true);



   
    runSQL("", " update dzpz_pz set pzdj_exist=0  where  	pzdj_exist is null  ",true);

    runSQL(""," update dzpz_pz set pzdj_exist=0 where "+
         (( y==0)? "" : "  left( dzpz_pz.ym ,4)='"+ ym +"'  and "   ) + 
        " not exists(  select  b.id from  pzdjex b  where   dzpz_pz.corpid = b.corpid  and dzpz_pz.pzh = b.pzh  ) "
       , true);


    runSQL("",  "  update dzpz_pz set pzdj_exist=1 where "+
        (( y==0)? "" : "  left( dzpz_pz.ym ,4)='"+ ym +"'  and "   ) + 
        "  exists(  select   b.id  from  pzdjex b where   dzpz_pz.corpid = b.corpid  and dzpz_pz.pzh = b.pzh    )"   , true);

    

}


id: 649a906999329f5ca7253b6b
pid: 64dd8fe899328fedff349e8b
name: 课题号与凭证列表的合法性校验
code: check_vouchers
namepath: /接口
fullname: /接口/课题号与凭证列表的合法性校验
nodetype: leaf
createdate: 2023.06.27 15:36:54.000
lastmodifieddate: 2023.12.06 10:50:27.138
value:
/**
 * 脚本中心的脚本，以 main函数为执行入口，相关的参数放在arg中，它是一个JSON字符串化后的数据
 *
 */
function main(arg) {
    println(arg);
    var param = JSON.parse(arg);


    var ktbh = param.ktbh || '';
    ktbh= ktbh.split(',');
    ktbh="('" + ktbh.join("','")+"')" ;

    if (!param.pzh) return { success: false, message: '没有提供凭证号' };

    var tmpTableName = "t_" + newGUID();
    runSQL("", `drop table  ${tmpTableName}`);
    runSQL("", `create table  ${tmpTableName} ( pzh varchar(40) not null , primary key(pzh)) `);


    for (var i = 0; i < param.pzh.length; i++) {
        var pzh = param.pzh[i];
        runSQL("", `insert into  ${tmpTableName}  ( pzh)  values  ('${pzh}') `);
    }

    try {
        var ds = newDataStore("", `select pzh from ${tmpTableName} a  where not exists ( select b.pzh from pzdjex b  where b.pzh = a.pzh and b.code in  ${ktbh} ) `);
        ds.retrieve();
        if (ds.getRowCount() == 0) {
            ds = newDataStore("", `select pzh from ${tmpTableName} a  where not exists ( select b.pzh from  dzpz_pz b  where b.pzh = a.pzh  ) `);
            ds.retrieve();
            if (ds.getRowCount() == 0) {
                return { success: true, code:'0', messager: `所有凭证号合法，且已影像化` };
            } else {
                var pzhs = [];
                for (var i = 0; i < ds.getRowCount(); i++) {
                    pzhs.push(ds.getString(i, "pzh"));
                }
                runSQL("", `drop table  ${tmpTableName}`);
                return { success: false, code:'1', message: `凭证号合法，但系统中不存在如下凭证的影像资料：${pzhs.join(',')}` };

            }
        }


        var pzhs = [];
        for (var i = 0; i < ds.getRowCount(); i++) {
            pzhs.push(ds.getString(i, "pzh"));
        }
        runSQL("", `drop table  ${tmpTableName}`);
        return { success: false, code:'2'  , message: `系统中不存在课题号为 ${ktbh} 的凭证：${pzhs.join(',')}` };


    }
    catch (err) {

    } finally {
        runSQL("", `drop table  ${tmpTableName}`);
    }


}


id: 649aa52d99329f5ca7253c1c
pid: 64dd8fe899328fedff349e8b
name: 发起调阅流程
code: create_task
namepath: /接口
fullname: /接口/发起调阅流程
nodetype: leaf
createdate: 2023.06.27 17:15:39.000
lastmodifieddate: 2023.12.06 10:50:27.139
value:
/**
 * 脚本中心的脚本，以 main函数为执行入口，相关的参数放在arg中，它是一个JSON字符串化后的数据
 *
 */
function main(arg) {
    println(arg);
    var param = JSON.parse(arg);
    var gguid = newGUID();
    var moduleid = 'dy';//模块ID
    var username = getProperty( "/API创建调阅流程的起草人",  param.creator || "api");
    println( username);
    var userid = getIntFromSQL("select id from app_user where showname='"+username+"'");
    println(userid);
    var leaderid= 18; //审核人ID
    var billno = newBillNo('', 'dzpz_dy', 'billno', '{11111111}', 'billdate', newDate(), "");
    var dzpz_dy_ds = newDataStore("", "select * from  dzpz_dy");
    dzpz_dy_ds.setUpdateProperty("dzpz_dy", "id", "*", "id");
    dzpz_dy_ds.insertRow(0);
    dzpz_dy_ds.setValue(0, {
        id: gguid, gguid: gguid, userid: userid, username: username , 
        billdate: newDate(), billno: billno,
        reader: param.dyr, 
        leaderid: leaderid , 
        summary: param.dyyy, corpid: '00',
        needwatermark: 0,//不打水印 
        filetype: 'zip', // 
        email: param.email,
        moredata: JSON.stringify(param.callback_param),
        action_after_pack:'sendMail'
    });

    var dzpz_dymx_ds = newDataStore("", "select * from dzpz_dymx");
    dzpz_dymx_ds.setUpdateProperty('dzpz_dymx', 'id', '*', "id");
    var pzh = param.pzh  ;
    if( pzh==undefined) pzh =[];
    for (var i = 0; i < pzh.length; i++) {
        var row = dzpz_dymx_ds.insertRow(9999999);
       // var code= getStringFromSQL("select code from pzdjex b  where  pzh = '"+pzh[i]+"'");
        dzpz_dymx_ds.setValue(row, { id: newGUID(), gguid: gguid, inner_xh: i + 1, pzh: pzh[i]    });
    }

    var err = updateAll(dzpz_dy_ds, dzpz_dymx_ds);
    if (err != '') return { success: false, messager: err };


    var corpid = getStringFromSQL("select corpid from dzpz_dy where id='" + gguid + "'");
    
    runSQL(""," update dzpz_dymx  set   code= ( select min(b.code) as code  from pzdjex b  where  b.pzh =dzpz_dymx.pzh ) where  dzpz_dymx.gguid='" + gguid + "' ",true );
    var sqls = ["update dzpz_dymx  set bz=null,pz_id= (select max(id) from dzpz_pz where dzpz_pz.pzh= dzpz_dymx.pzh and dzpz_pz.corpid='" + corpid + "' ) where gguid='" + gguid + "' ",
                "update dzpz_dymx  set bz='凭证号不存在' where  gguid='" + gguid + "' and not exists (select dzpz_pz.id from dzpz_pz where  dzpz_pz.pzh= dzpz_dymx.pzh  and dzpz_pz.corpid='" + corpid + "')  " 
             
    ];
    runSQL("", sqls); 


    var config = {
        moduleid: moduleid,//凭证调阅模块代码或ID,
        gguid: gguid,
        flow: 'dy', //工作流的代码或ID
        userid: userid, //发起人ID
        subject: `${param.dyr || ''}因 [${param.dyyy || ''}] 调阅凭证`


    };

    var ret = newWork(config);

    if (!ret.success) return ret;

    //自动递交给初审
/*
    var t = taskInfoForWork('dy', gguid);

    //将任务递交下去，如果任务需要签收，则先签收     
    for (var i = 0; i < t.taskList.length; i++) {
        var task = t.taskList[i];

        //可以递交，那么递交下去
        if (task.canSubmit) println(submitWork(moduleid, gguid, task.taskId));
        //需要先签收 ，那么以第一个候选人签收它
        if (task.canClaim) claimWork(moduleid, gguid, task.taskId, task.candidateUserList[0].userId);

    }
*/

    ret.id = gguid;
    ret.billno= billno;
    return {success:true , id: gguid , content:{billno:billno}  };


}


id: 649bccb89932ee4d0f7f5577
pid: 6181e4b9c76eefddf45ea0b9
name: 后台打包入口
code: package
namepath: /后台打包
fullname: /后台打包/后台打包入口
nodetype: leaf
createdate: 2023.06.28 14:17:41.000
lastmodifieddate: 2023.12.06 10:50:27.492
value:
//后台打包
function main( arg) {
    var param=  JSON.parse(arg);
    var gguid= param.gguid; 
    

    var ids = [];
    //2022.08.11 优化， 有可能存在重复的，所能加上 distinct 去重
    var $dzpz_dymx_ds = newDataStore("", "select  pz_id ,pzh , max(filenameprefix) as filenameprefix from  dzpz_dymx where gguid='" + gguid + "' group by pz_id, pzh  order by pzh  ");
    $dzpz_dymx_ds.retrieve();
    println($dzpz_dymx_ds.getSelectLastRetrieved());

    for (var i = 0; i < $dzpz_dymx_ds.getRowCount(); i++) {
        var pz_id = '' + $dzpz_dymx_ds.getString(i, "pz_id");
        var filenameprefix = $dzpz_dymx_ds.getString(i, "filenameprefix");
        if (pz_id == '') continue;
        if (ids.contains(pz_id)) continue;
        ids.push({ id:pz_id , filenameprefix: filenameprefix} );
    }

    if (ids.length == 0) {
        println("没有凭证清单");
        return {success:false, message:"没有凭证清单"};
    }

    println(ids.length + "张凭证需要打包");

    var $dzpz_dy_ds = newDataStore("", "select * from  dzpz_dy where gguid='" + gguid + "'");
    $dzpz_dy_ds.setUpdateProperty("dzpz_dy", "id", "*", "id");
    $dzpz_dy_ds.retrieve();

    var fileName = $dzpz_dy_ds.getString(0, "reader") + formatDate(newDate(), "yyyy.MM.dd") + "因"+$dzpz_dy_ds.getString(0, "summary") + "调阅凭证.zip";

    var ret = runTask("后台打包", {
        gguid: gguid,
        fileName: fileName,
        ids: ids,
        watermark: $dzpz_dy_ds.getInt(0, "needwatermark") == 0 ? "" : (formatDate($dzpz_dy_ds.getValue(0, "billdate"), "yyyy.MM.dd HH:mm") + "\n" + $dzpz_dy_ds.getString(0, "watermark")+"    "),
        mergePDF: $dzpz_dy_ds.getString(0, "filetype") == 'pdf' //是否合并成一个pdf文件

    });

    println(ret);
    ret = JSON.parse(ret);

    if (ret.success) {
        $dzpz_dy_ds.setValue(0, "ziptaskid", ret.zipTaskId);
        $dzpz_dy_ds.update(true);
    }
    return ret;
}


