int 散货记录() { int i,rec_num,currow,blank10; string today,comuid,salmanresres,res1; string resname,resnum,resunit; today=get_cur_date();//读取当前日期,将当前日期作为散货记录的文件名 comuid=gui_get_text('combobox_ext_eba_id');//获取当前单据的客户名称 salman=gui_get_text('combobox_ext_emp_id');//获取业务员的名称,日期与业务员组合成记录文本文件的名称,每天一个文件名. comuid='echo ' " " comuid '有散货' ' >>"' get_home_path() '\散货记录情况\' today salman '的散货.txt"'; system(comuid); blank10=grid_seek("mg_item","res_id","");//定位这个单据有几行数据 //以下代码为判断表格中没有整件或者整箱 rec_num=grid_cur_row("mg_item")-1; for(i=1;i<=rec_num;i ) { resunit=grid_get_v('mg_item','inp_unit_type_name',i); if(resunit!="箱"||resunit!="件") { //以下代码把没有整件或者整箱的数据写入到指定文件中 resname=grid_get_v('mg_item','res_name',i); resnum=grid_get_v('mg_item','inp_num',i); resres=resname '--------------------------------------------------------------------------'; resres=str_get_sub(resres,0,60) resnum resunit; res1='echo ' resres ' >> "' get_home_path() '\散货记录情况\' today salman '的散货.txt"';//写入到指定目录的文件中 system(res1); } } return 1; } int func_before_check() { 散货记录(); return 1; } 补充说一下:可以在主窗口里写一个脚本用以建立“散货记录”这个目录。虽然会提示出错,但是不影响使用,并且是一闪而过。 int main() { string str; str='md ' get_home_path() '\散货记录情况\' system(str); return 1; }; 于 2014-05-16 22:35 被 xwb514 修改

官方认证第三方服务团队 徐文标(福建-流浪) qq:340298101
服务介绍:http://www.onlyit.cn/onlyit_service.html |