################################################################################ # 版本号: Ver 1.0 研制时间:1999.12.15 # # 作 者: 大梦 # ################################################################################ database slif globals "glob.4gl" main options prompt line 24, error line 24, message line 24, form line 4, input wrap, accept key interrupt #### 使ESC键无效 defer interrupt set isolation to dirty read set lock mode to wait 5 call startlog("slif_err.log")
call public()
menu "理赔登记子系统" command "A.录入登记" "对本机构的理赔案件进行录入处理" call M_a_main() call clea(4)
command "B.查询修改" "对本机构登记的案件进行查询,修改,删除等处理" call M_b_main() call clea(4)
command "C.理赔统计" "对本机构给付的案件进行统计处理" call M_c_main() call clea(4)
command "D.打印流水" "对本机构给付的案件进行打印处理" call M_d_main() call clea(4)
command "E.退出系统" "退出理赔案件管理子系统" clear screen exit menu end menu end main
function M_a_main() define list_rec record like give_list.* define code_rec record like give_pol.* open form M_main from "./form/M_main" display form M_main while 1 display "^即Ctrl ^B:求 助 ^Z:存 盘 ^E:退 出" at 4,1 initialize list_rec.* to null let list_rec.log_date = today let list_rec.clerk_code = the_opr let list_rec.branch_no = cu_num let list_rec.check_flag = 1 display "" to s_pol display "" to s_sex display "已赔" to s_flag display by name list_rec.* input by name list_rec.* without defaults after field give_no if list_rec.give_no is null then call disp_msg("赔案编号不得为空???") next field give_no end if after field ins_no if list_rec.ins_no is null then call disp_msg("保险证号不得为空???") next field ins_no end if after field ins_amt if list_rec.ins_amt is null then call disp_msg("保险金额不得为空???") next field ins_amt end if if list_rec.ins_amt = 0 then call disp_msg("保险金额不得为零???") next field ins_amt end if if list_rec.ins_amt < 0 then call disp_msg("保险金额不得小于零???") next field ins_amt end if after field pol_code if list_rec.pol_code is null then call disp_msg("险种代码不得为空???") next field pol_code else select * into code_rec.* from give_pol where pol_code = list_rec.pol_code if status = NOTFOUND then call disp_msg("险种代码不存在???") next field pol_code else display code_rec.pol_name to s_pol end if end if after field beg_date if list_rec.beg_date is null then call disp_msg("责任开始时间不得为空???") next field beg_date end if if list_rec.beg_date > today then call disp_msg("责任开始时间不得大于系统时间???") next field beg_date end if if list_rec.beg_date < mdy(1,1,1985) then call disp_msg("责任开始时间不在规定范围内???") next field beg_date end if after field end_date if list_rec.end_date is not null then if list_rec.end_date < list_rec.beg_date then call disp_msg("终止时间不得小于起始时间???") next field end_date end if if list_rec.end_date < mdy(1,1,1985) then call disp_msg("责任终止时间不在规定范围内???") next field end_date end if end if after field ipsn_name if list_rec.ipsn_name is null then call disp_msg("被保险人姓名不得为空???") next field ipsn_name end if after field ipsn_sex if list_rec.ipsn_sex is null then call disp_msg("被保险人性别不得为空???") next field ipsn_sex end if case list_rec.ipsn_sex when "F" display "女" to s_sex when "M" display "男" to s_sex otherwise call disp_msg("被保险人性别错???") end case after field happ_date if list_rec.happ_date is null then call disp_msg("出险时间不得为空???") next field happ_date end if if list_rec.happ_date > today then call disp_msg("出险时间不得大于系统时间???") next field happ_date end if if list_rec.happ_date < list_rec.beg_date or list_rec.happ_date > list_rec.end_date then call disp_msg("出险时间不在保险期间内???") next field happ_date end if after field in_date if list_rec.in_date is not null then if list_rec.in_date < list_rec.happ_date then call disp_msg("入院时间不得小于出险时间???") next field in_date end if end if after field hosp_addr if list_rec.in_date is not null then if list_rec.hosp_addr is null then call disp_msg("住院地点不得为空???") next field hosp_addr end if end if after field out_date if list_rec.in_date is not null then if list_rec.out_date < list_rec.in_date then call disp_msg("出院时间不得小于入院时间???") next field out_date end if end if after field diag_tes1 if list_rec.diag_tes1 is null then call disp_msg("诊断证明不得为空???") next field diag_tes1 end if after field star_date if list_rec.star_date is null then call disp_msg("立案时间不得为空???") next field star_date end if if list_rec.star_date > today then call disp_msg("立案时间不得大于系统时间???") next field star_date end if if list_rec.star_date < list_rec.happ_date then call disp_msg("立案时间不得小于出险时间???") next field star_date end if after field give_amt1 if list_rec.give_amt1 is null then let list_rec.give_amt1 = 0 display by name list_rec.* end if after field give_amt2 if list_rec.give_amt2 is null then let list_rec.give_amt2 = 0 display by name list_rec.* end if after field give_amt3 if list_rec.give_amt3 is null then let list_rec.give_amt3 = 0 display by name list_rec.* end if after field give_amt4 if list_rec.give_amt4 is null then let list_rec.give_amt4 = 0 display by name list_rec.* end if after field give_amt5 if list_rec.give_amt5 is null then let list_rec.give_amt5 = 0 display by name list_rec.* end if after field give_amt6 if list_rec.give_amt6 is null then let list_rec.give_amt6 = 0 display by name list_rec.* end if let list_rec.count_amt = list_rec.give_amt1 + list_rec.give_amt2 + list_rec.give_amt3 + list_rec.give_amt4 + list_rec.give_amt5 + list_rec.give_amt6 display by name list_rec.* if list_rec.count_amt < 0.01 then call disp_msg("合计给付金额错???") next field give_amt1 end if after field check_date if list_rec.check_date is null then call disp_msg("审批时间不得为空???") next field check_date end if if list_rec.check_date > today then call disp_msg("审批时间不得大于系统时间???") next field check_date end if if list_rec.check_date < list_rec.star_date then call disp_msg("审批时间不应小于立案时间???") next field check_date end if after field check_flag if list_rec.check_flag is null then call disp_msg("理赔标志不得为空???") next field check_flag end if case list_rec.check_flag when "1" display "已赔" to s_flag when "0" display "拒赔" to s_flag otherwise call disp_msg("理赔标志错???") end case
on key(control-b) if infield(pol_code) then let list_rec.pol_code = disp_pol() display by name list_rec.* next field pol_code end if
on key(control-z) display by name list_rec.* call disp_msg("正在检测,请稍候...") if list_rec.give_no is null then call disp_msg("赔案编号不得为空???") next field give_no end if if list_rec.ins_no is null then call disp_msg("保险证号不得为空???") next field ins_no end if if list_rec.ins_amt is null then call disp_msg("保险金额不得为空???") next field ins_amt end if if list_rec.ins_amt = 0 then call disp_msg("保险金额不得为零???") next field ins_amt end if if list_rec.ins_amt < 0 then call disp_msg("保险金额不得小于零???") next field ins_amt end if if list_rec.pol_code is null then call disp_msg("险种代码不得为空???") next field pol_code else select * into code_rec.* from give_pol where pol_code = list_rec.pol_code if status = NOTFOUND then call disp_msg("险种代码不存在???") next field pol_code else display code_rec.pol_name to s_pol end if end if if list_rec.beg_date is null then call disp_msg("责任开始时间不得为空???") next field beg_date end if if list_rec.beg_date > today then call disp_msg("责任开始时间不得大于系统时间???") next field beg_date end if if list_rec.beg_date < mdy(1,1,1985) then call disp_msg("责任开始时间不在规定范围内???") next field beg_date end if if list_rec.end_date is not null then if list_rec.end_date < list_rec.beg_date then call disp_msg("终止时间不得小于起始时间???") next field end_date end if if list_rec.end_date < mdy(1,1,1985) then call disp_msg("责任终止时间不在规定范围内???") next field end_date end if end if if list_rec.ipsn_name is null then call disp_msg("被保险人姓名不得为空???") next field ipsn_name end if if list_rec.ipsn_sex is null then call disp_msg("被保险人性别不得为空???") next field ipsn_sex end if if list_rec.happ_date is null then call disp_msg("出险时间不得为空???") next field happ_date end if if list_rec.happ_date > today then call disp_msg("出险时间不得大于系统时间???") next field happ_date end if if list_rec.happ_date < list_rec.beg_date or list_rec.happ_date > list_rec.end_date then call disp_msg("出险时间不在保险期间内???") next field happ_date end if if list_rec.in_date is not null then if list_rec.in_date < list_rec.happ_date then call disp_msg("入院时间不得小于出险时间???") next field in_date end if end if if list_rec.in_date is not null then if list_rec.hosp_addr is null then call disp_msg("住院地点不得为空???") next field hosp_addr end if end if if list_rec.in_date is not null then if list_rec.out_date < list_rec.in_date then call disp_msg("出院时间不得小于入院时间???") next field out_date end if end if if list_rec.diag_tes1 is null then call disp_msg("诊断证明不得为空???") next field diag_tes1 end if if list_rec.star_date is null then call disp_msg("立案时间不得为空???") next field star_date end if if list_rec.star_date > today then call disp_msg("立案时间不得大于系统时间???") next field star_date end if if list_rec.star_date < list_rec.happ_date then call disp_msg("立案时间不得小于出险时间???") next field star_date end if if list_rec.give_amt1 is null then let list_rec.give_amt1 = 0 display by name list_rec.* end if if list_rec.give_amt2 is null then let list_rec.give_amt2 = 0 display by name list_rec.* end if if list_rec.give_amt3 is null then let list_rec.give_amt3 = 0 display by name list_rec.* end if if list_rec.give_amt4 is null then let list_rec.give_amt4 = 0 display by name list_rec.* end if if list_rec.give_amt5 is null then let list_rec.give_amt5 = 0 display by name list_rec.* end if if list_rec.give_amt6 is null then let list_rec.give_amt6 = 0 display by name list_rec.* end if let list_rec.count_amt = list_rec.give_amt1 + list_rec.give_amt2 + list_rec.give_amt3 + list_rec.give_amt4 + list_rec.give_amt5 + list_rec.give_amt6 display by name list_rec.* if list_rec.count_amt < 0.01 then call disp_msg("合计给付金额错???") next field give_amt1 end if if list_rec.check_date is null then call disp_msg("审批时间不得为空???") next field check_date end if if list_rec.check_date > today then call disp_msg("审批时间不得大于系统时间???") next field check_date end if if list_rec.check_date < list_rec.star_date then call disp_msg("审批时间不应小于立案时间???") next field check_date end if if list_rec.check_flag is null then call disp_msg("理赔标志不得为空???") next field check_flag end if error "";error "" open window z_win at 13,23 with 1 rows,35 columns attribute(reverse,border) prompt " 是否写入当前案件登记情况[Y/y]?" for char answ close window z_win if answ matches "[Yy]" then call disp_msg("正在存盘,请稍候...") insert into give_list values(list_rec.*) call disp_msg("存盘成功,OK!") exit input else call disp_msg("没有执行任何操作,放弃存盘!") end if
on key(control-e) error "";error "" open window e_win at 13,23 with 1 rows,35 columns attribute(reverse,border) prompt " 是否真的要放弃录入工作[Y/y]??? " for char answ close window e_win if answ matches "[Yy]" then exit while end if end input end while close form M_main end function
################################### ## 函数:M_b_main() ## ## 功能: ## ## 查询修改 ## ## 创建时间:1999.12.15 ## ################################### function M_b_main() define list_rec record like give_list.*, code_rec record like give_pol.*, que,str1,str2 char(1024), sum_row,cur_row decimal(12,0) options form line 4 open form M_main from "./form/M_main" display form M_main while 1 options accept key control-z display "^即Ctrl ^B:求 助 ^Z:确 认 ^E:退 出" at 4,1 construct que on give_list.* from give_list.* on key(control-e) let int_flag = 1 exit construct on key(control-b) if infield(pol_code) then let list_rec.pol_code = disp_pol() display by name list_rec.pol_code end if end construct options accept key control-w if int_flag != 0 then let int_flag = 0 return end if if cu_num matches "????00" then let str1 = " select rowid,give_list.* from give_list where ",que clipped let str2 = " select count(*) from give_list where ",que clipped else let str1 = " select rowid,give_list.* from give_list where ", que clipped," and branch_no = \"",cu_num,"\"" let str2 = " select count(*) from give_list where ", que clipped," and branch_no = \"",cu_num,"\"" end if let cur_row = 1 label beg: prepare see1 from str1 prepare see2 from str2 declare c1 scroll cursor for see1 open c1 declare c2 scroll cursor for see2 open c2 foreach c2 into sum_row end foreach fetch relative cur_row c1 into row_id,list_rec.* if sqlca.sqlcode = 0 then exit while else call disp_msg ("符合条件的记录没有找到???") return end if end while while 1 options previous key control-p options next key control-n options prompt line 24 display sum_row to row_sum display cur_row to row_id display by name list_rec.* select * into code_rec.* from give_pol where pol_code = list_rec.pol_code display code_rec.pol_name to s_pol case list_rec.ipsn_sex when "F" display "女" to s_sex when "M" display "男" to s_sex end case case list_rec.check_flag when "1" display "已赔" to s_flag when "0" display "拒赔" to s_flag end case prompt "^即Ctrl ^N:下一记录 ^P:上一记录 ^U:修 改 ^O:删 除 ^E:退 出" for answ on key(control-n,down,right) fetch next c1 into row_id,list_rec.* if status = NOTFOUND then call disp_msg("无后一条记录???") else let cur_row = cur_row + 1 end if
on key(control-p,up,left) fetch previous c1 into row_id,list_rec.* if status = NOTFOUND then call disp_msg("无前一条记录???") else let cur_row = cur_row - 1 end if
on key(control-o) error "";error "" open window o_win at 13,23 with 1 rows,35 columns attribute(reverse,border) prompt " 是否删除当前案件登记情况[Y/y]?" for char answ close window o_win if answ matches "[Yy]" then call disp_msg("正在删除,请稍候...") begin work delete from give_list where rowid = row_id commit work call disp_msg("删除成功!!!") if cur_row = sum_row then let cur_row = cur_row - 1 end if goto beg else call disp_msg("没有删除!!!") end if
on key(control-u) input by name list_rec.* without defaults after field give_no if list_rec.give_no is null then call disp_msg("赔案编号不得为空???") next field give_no end if after field ins_no if list_rec.ins_no is null then call disp_msg("保险证号不得为空???") next field ins_no end if after field ins_amt if list_rec.ins_amt is null then call disp_msg("保险金额不得为空???") next field ins_amt end if if list_rec.ins_amt = 0 then call disp_msg("保险金额不得为零???") next field ins_amt end if if list_rec.ins_amt < 0 then call disp_msg("保险金额不得小于零???") next field ins_amt end if after field pol_code if list_rec.pol_code is null then call disp_msg("险种代码不得为空???") next field pol_code else select * into code_rec.* from give_pol where pol_code = list_rec.pol_code if status = NOTFOUND then call disp_msg("险种代码不存在???") next field pol_code else display code_rec.pol_name to s_pol end if end if after field beg_date if list_rec.beg_date is null then call disp_msg("责任开始时间不得为空???") next field beg_date end if if list_rec.beg_date > today then call disp_msg("责任开始时间不得大于系统时间???") next field beg_date end if if list_rec.beg_date < mdy(1,1,1985) then call disp_msg("责任开始时间不在规定范围内???") next field beg_date end if after field end_date if list_rec.end_date is not null then if list_rec.end_date < list_rec.beg_date then call disp_msg("终止时间不得小于起始时间???") next field end_date end if if list_rec.end_date < mdy(1,1,1985) then call disp_msg("责任终止时间不在规定范围内???") next field end_date end if end if after field ipsn_name if list_rec.ipsn_name is null then call disp_msg("被保险人姓名不得为空???") next field ipsn_name end if after field ipsn_sex if list_rec.ipsn_sex is null then call disp_msg("被保险人性别不得为空???") next field ipsn_sex end if case list_rec.ipsn_sex when "F" display "女" to s_sex when "M" display "男" to s_sex otherwise call disp_msg("被保险人性别错???") end case after field happ_date if list_rec.happ_date is null then call disp_msg("出险时间不得为空???") next field happ_date end if if list_rec.happ_date > today then call disp_msg("出险时间不得大于系统时间???") next field happ_date end if if list_rec.happ_date < list_rec.beg_date or list_rec.happ_date > list_rec.end_date then call disp_msg("出险时间不在保险期间内???") next field happ_date end if after field in_date if list_rec.in_date is not null then if list_rec.in_date < list_rec.happ_date then call disp_msg("入院时间不得小于出险时间???") next field in_date end if end if after field hosp_addr if list_rec.in_date is not null then if list_rec.hosp_addr is null then call disp_msg("住院地点不得为空???") next field hosp_addr end if end if after field out_date if list_rec.in_date is not null then if list_rec.out_date < list_rec.in_date then call disp_msg("出院时间不得小于入院时间???") next field out_date end if end if after field diag_tes1 if list_rec.diag_tes1 is null then call disp_msg("诊断证明不得为空???") next field diag_tes1 end if after field star_date if list_rec.star_date is null then call disp_msg("立案时间不得为空???") next field star_date end if if list_rec.star_date > today then call disp_msg("立案时间不得大于系统时间???") next field star_date end if if list_rec.star_date < list_rec.happ_date then call disp_msg("立案时间不得小于出险时间???") next field star_date end if after field give_amt1 if list_rec.give_amt1 is null then let list_rec.give_amt1 = 0 display by name list_rec.* end if after field give_amt2 if list_rec.give_amt2 is null then let list_rec.give_amt2 = 0 display by name list_rec.* end if after field give_amt3 if list_rec.give_amt3 is null then let list_rec.give_amt3 = 0 display by name list_rec.* end if after field give_amt4 if list_rec.give_amt4 is null then let list_rec.give_amt4 = 0 display by name list_rec.* end if after field give_amt5 if list_rec.give_amt5 is null then let list_rec.give_amt5 = 0 display by name list_rec.* end if after field give_amt6 if list_rec.give_amt6 is null then let list_rec.give_amt6 = 0 display by name list_rec.* end if let list_rec.count_amt=list_rec.give_amt1+list_rec.give_amt2 +list_rec.give_amt3+list_rec.give_amt4 +list_rec.give_amt5+list_rec.give_amt6 display by name list_rec.* if list_rec.count_amt < 0.01 then call disp_msg("合计给付金额错???") next field give_amt1 end if after field check_date if list_rec.check_date is null then call disp_msg("审批时间不得为空???") next field check_date end if if list_rec.check_date > today then call disp_msg("审批时间不得大于系统时间???") next field check_date end if if list_rec.check_date < list_rec.star_date then call disp_msg("审批时间不应小于立案时间???") next field check_date end if after field check_flag if list_rec.check_flag is null then call disp_msg("理赔标志不得为空???") next field check_flag end if case list_rec.check_flag when "1" display "已赔" to s_flag when "0" display "拒赔" to s_flag otherwise call disp_msg("理赔标志错???") end case on key(control-b) if infield(pol_code) then let list_rec.pol_code = disp_pol() display by name list_rec.* next field pol_code end if
on key(control-z) display by name list_rec.* call disp_msg("正在检测,请稍候...") if list_rec.give_no is null then call disp_msg("赔案编号不得为空???") next field give_no end if if list_rec.ins_no is null then call disp_msg("保险证号不得为空???") next field ins_no end if if list_rec.ins_amt is null then call disp_msg("保险金额不得为空???") next field ins_amt end if if list_rec.ins_amt = 0 then call disp_msg("保险金额不得为零???") next field ins_amt end if if list_rec.ins_amt < 0 then call disp_msg("保险金额不得小于零???") next field ins_amt end if if list_rec.pol_code is null then call disp_msg("险种代码不得为空???") next field pol_code else select * into code_rec.* from give_pol where pol_code = list_rec.pol_code if status = NOTFOUND then call disp_msg("险种代码不存在???") next field pol_code end if end if if list_rec.beg_date is null then call disp_msg("责任开始时间不得为空???") next field beg_date end if if list_rec.beg_date > today then call disp_msg("责任开始时间不得大于系统时间???") next field beg_date end if if list_rec.beg_date < mdy(1,1,1985) then call disp_msg("责任开始时间不在规定范围内???") next field beg_date end if if list_rec.end_date is not null then if list_rec.end_date < list_rec.beg_date then call disp_msg("终止时间不得小于起始时间???") next field end_date end if if list_rec.end_date < mdy(1,1,1985) then call disp_msg("责任终止时间不在规定范围内???") next field end_date end if end if if list_rec.ipsn_name is null then call disp_msg("被保险人姓名不得为空???") next field ipsn_name end if if list_rec.ipsn_sex is null then call disp_msg("被保险人性别不得为空???") next field ipsn_sex end if if list_rec.happ_date is null then call disp_msg("出险时间不得为空???") next field happ_date end if if list_rec.happ_date > today then call disp_msg("出险时间不得大于系统时间???") next field happ_date end if if list_rec.happ_date < list_rec.beg_date or list_rec.happ_date > list_rec.end_date then call disp_msg("出险时间不在保险期间内???") next field happ_date end if if list_rec.in_date is not null then if list_rec.in_date < list_rec.happ_date then call disp_msg("入院时间不得小于出险时间???") next field in_date end if end if if list_rec.in_date is not null then if list_rec.hosp_addr is null then call disp_msg("住院地点不得为空???") next field hosp_addr end if end if if list_rec.in_date is not null then if list_rec.out_date < list_rec.in_date then call disp_msg("出院时间不得小于入院时间???") next field out_date end if end if if list_rec.diag_tes1 is null then call disp_msg("诊断证明不得为空???") next field diag_tes1 end if if list_rec.star_date is null then call disp_msg("立案时间不得为空???") next field star_date end if if list_rec.star_date > today then call disp_msg("立案时间不得大于系统时间???") next field star_date end if if list_rec.star_date < list_rec.happ_date then call disp_msg("立案时间不得小于出险时间???") next field star_date end if if list_rec.give_amt1 is null then let list_rec.give_amt1 = 0 display by name list_rec.* end if if list_rec.give_amt2 is null then let list_rec.give_amt2 = 0 display by name list_rec.* end if if list_rec.give_amt3 is null then let list_rec.give_amt3 = 0 display by name list_rec.* end if if list_rec.give_amt4 is null then let list_rec.give_amt4 = 0 display by name list_rec.* end if if list_rec.give_amt5 is null then let list_rec.give_amt5 = 0 display by name list_rec.* end if if list_rec.give_amt6 is null then let list_rec.give_amt6 = 0 display by name list_rec.* end if let list_rec.count_amt=list_rec.give_amt1+list_rec.give_amt2 +list_rec.give_amt3+list_rec.give_amt4 +list_rec.give_amt5+list_rec.give_amt6 display by name list_rec.* if list_rec.count_amt < 0.01 then call disp_msg("合计给付金额错???") next field give_amt1 end if if list_rec.check_date is null then call disp_msg("审批时间不得为空???") next field check_date end if if list_rec.check_date > today then call disp_msg("审批时间不得大于系统时间???") next field check_date end if if list_rec.check_date < list_rec.star_date then call disp_msg("审批时间不应小于立案时间???") next field check_date end if if list_rec.check_flag is null then call disp_msg("理赔标志不得为空???") next field check_flag end if error "";error "" open window u_win at 13,23 with 1 rows,35 columns attribute(reverse,border) prompt " 是否修改当前案件登记情况[Y/y]?" for char answ close window u_win if answ matches "[Yy]" then call disp_msg("正在修改,请稍候...") begin work update give_list set give_list.*=list_rec.* where rowid=row_id commit work call disp_msg("修改成功,OK!") goto beg exit input else call disp_msg("没有执行任何操作,放弃修改!") end if
on key(control-e) error "";error "" open window e1_win at 13,23 with 1 rows,35 columns attribute(reverse,border) prompt " 是否真的要放弃修改工作[Y/y]??? " for char answ close window e1_win if answ matches "[Yy]" then exit input end if end input
on key(control-e) error "";error "" open window e2_win at 13,23 with 1 rows,35 columns attribute(reverse,border) prompt " 是否真的要放弃查询工作[Y/y]??? " for char answ close window e2_win if answ matches "[Yy]" then exit while end if end prompt end while close form M_main end function
################################### ## 函数:M_c_main() ## ## 功能: ## ## 理赔统计 ## ## Create: 2000.2.22 ## ################################### function M_c_main() define input_rec record bran_no char(6), tj_flag char(1), s_clerk_code char(10), beg_date date, end_date date end record define bran_name,tj_name char(20) define i,j,m,n,a,b,c,d,e integer define str,str0,str1,str2,str3 char(512) define sum_amnt decimal(12,2) define p_tj array[300] of record pol_code char(4), pol_name char(40), pay_cou integer, pay_amt decimal(12,2) end record define tj_rec record pol_code char(4), pol_name char(40), pay_cou integer, pay_amt decimal(12,2) end record open form M_c_main from "M_c_main" while true display form M_c_main #call clea(17) initialize input_rec.* to null let bran_name = " " let tj_name = " " display bran_name at 8,45 display tj_name at 10,40 let input_rec.bran_no = cu_num let input_rec.tj_flag = 1 let input_rec.beg_date = today let input_rec.end_date = today display by name input_rec.* input by name input_rec.* without defaults after field bran_no if input_rec.bran_no is null then call disp_msg("Sorry,机构代码不得为空???") next field bran_no end if if cu_num not matches "????00" then let input_rec.bran_no = cu_num end if display by name input_rec.* select branch_name into bran_name from branch where branch_no = input_rec.bran_no if status = 100 then call disp_msg("Sorry,机构代码不存在???") let input_rec.bran_no = cu_num display by name input_rec.* next field bran_no end if display bran_name at 8,45 attribute(reverse) after field tj_flag if input_rec.tj_flag is null then call disp_msg("Sorry,统计口径不得为空???") next field tj_flag end if case input_rec.tj_flag when '1' let tj_name = "开户时间" when '2' let tj_name = "出险时间" when '3' let tj_name = "立案时间" when '4' let tj_name = "审批时间" otherwise error "" next field tj_flag end case display tj_name clipped at 10,40 attribute(reverse) after field s_clerk_code if input_rec.s_clerk_code is not null then select * from opr where opr_num = input_rec.s_clerk_code if sqlca.sqlcode = 100 then call disp_msg("Sorry,操作员代码不正确???") next field s_clerk_code else call disp_msg("只对当前操作员做统计处理!!!") end if end if after field beg_date if input_rec.beg_date > today or input_rec.beg_date is null or input_rec.beg_date < mdy(1,1,1986) then call disp_msg("Sorry,统计开始日期不在规定内???") next field beg_date end if after field end_date if input_rec.end_date > today or input_rec.end_date is null or input_rec.end_date < input_rec.beg_date or input_rec.end_date < mdy(1,1,1986) then call disp_msg("Sorry,统计终止日期不在规定内???") next field end_date end if
on key(control-z) display by name input_rec.* if input_rec.bran_no is null then call disp_msg("Sorry,机构代码不得为空???") next field bran_no end if if cu_num not matches "????00" then let input_rec.bran_no = cu_num end if display by name input_rec.* select * from branch where branch_no = input_rec.bran_no if status = 100 then call disp_msg("Sorry,机构代码不存在???") let input_rec.bran_no = cu_num display by name input_rec.* next field bran_no end if if input_rec.tj_flag is null then call disp_msg("Sorry,统计口径不得为空???") next field tj_flag end if if input_rec.beg_date > today or input_rec.beg_date is null or input_rec.beg_date < mdy(1,1,1986) then call disp_msg("Sorry,统计开始日期不在规定内???") next field beg_date end if if input_rec.end_date > today or input_rec.end_date is null or input_rec.end_date < input_rec.beg_date or input_rec.end_date < mdy(1,1,1986) then call disp_msg("Sorry,统计终止日期不在规定内???") next field end_date end if exit input
on key(control-e) exit while end input display "正在搜索数据,请稍候..." at 18,29 attribute(reverse) let str0 = "select a.pol_code,b.pol_name,count(*),sum(count_amt) from give_list a,give_pol b where a.pol_code = b.pol_code and a.branch_no = \"",input_rec.bran_no,"\"" case input_rec.tj_flag when '1' let str1 = " and a.log_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" when '2' let str1 = " and a.happ_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" when '3' let str1 = " and a.star_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" when '4' let str1 = " and a.check_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" otherwise continue while end case if input_rec.s_clerk_code is null then let str2 = "" else let str2 = " and a.clerk_code = \"",input_rec.s_clerk_code,"\"" end if let str3 = " group by 1,2 order by 1" let str = str0 clipped,str1 clipped,str2 clipped,str3 clipped let str = str clipped prepare tj_see from str declare tj_cur scroll cursor with hold for tj_see open tj_cur fetch first tj_cur into p_tj[1].* if status = 100 then call disp_msg("Sorry,符合条件的记录未找到?") continue while end if for i = 1 to 300 step 1 initialize p_tj.* to null end for let i = 1 let sum_amnt = 0 foreach tj_cur into p_tj.* if i > 300 then call disp_msg("Sorry,统计数组溢出?") exit foreach end if let sum_amnt = p_tj.pay_amt + sum_amnt let i = i + 1 end foreach open form M_tj from "M_tj" display form M_tj display input_rec.bran_no to bran_no display bran_name to bran_name display input_rec.beg_date to beg_date display input_rec.end_date to end_date let m = i - 1 let n = 1 let b = 1 let c = 1 let a = i - 1 display n,m,sum_amnt to row_id,sum_row,sum_amt call set_count(i-1) display array p_tj to s_tj.* on key (return,down,right)--- 下移一行 display p_tj.* to s_tj[c].* if b = a then error "往下无可选记录" else if c = 10 then scroll s_tj.* up else let c = c + 1 end if let b = b + 1 end if display b to row_id display p_tj.* to s_tj[c].* attribute(reverse)
on key (up,left)--- 上移一行 display p_tj.* to s_tj[c].* if b = 1 then error "往上无可选记录" else if c = 1 then scroll s_tj.* down else let c = c - 1 end if let b = b - 1 end if display b to row_id display p_tj.* to s_tj[c].* attribute(reverse)
on key (control-z) error "正在打印,请稍候..." start report tj_rep foreach tj_cur into tj_rec.* output to report tj_rep(tj_rec.*,bran_name, input_rec.beg_date, input_rec.end_date) end foreach finish report tj_rep error "打印完毕!OK..."
on key (control-e) close form M_tj exit display end display end while close form M_c_main end function
#*********************** # tj_rep() 统计报表 * #*********************** report tj_rep(tj_rec,bran_name,beg_date,end_date) define tj_rec record pol_code char(4), pol_name char(40), pay_cou integer, pay_amt decimal(12,2) end record define bran_name char(20) define beg_date,end_date date format first page header print ascii 27,"[5i" print ascii 27,"W",ascii 1,ascii 27,"w",ascii 1 skip 1 line print column 10,"人身保险业务理赔情况统计表" print ascii 27,"w",ascii 0,ascii 27,"W",ascii 0 skip 1 line print column 2,"报表单位:",bran_name clipped,column 40,"统计日期:从",beg_date using "yyyy年mm月dd日"," 到 ",end_date using "yyyy年mm月dd日"," ",pageno using "第<<页" print column 1,"=============================================================================================" print column 1,"险种代码 险 种 名 称 赔案件数 给 付 金 额" print column 1,"=============================================================================================" on every row print column 3,tj_rec.pol_code, column 17,tj_rec.pol_name, column 40,tj_rec.pay_cou using "#####", column 68,tj_rec.pay_amt using "¥<<<<<<<<<<.<<" on last row print column 1,"=============================================================================================" print column 2,"制 表: 大梦", column 20,"记录合计:",count(*) using "<<<", column 40,"案件合计:",sum(tj_rec.pay_cou) using "<<<<<", column 60,"金额合计:",sum(tj_rec.pay_amt) using "<<<<<<<<<<<.<<" print ascii 12; print ascii 27,"@"; print ascii 27,"[4i" end report
################################### ## 函数:M_d_main() ## ## 功能: ## ## 打印流水 ## ## Create Time: 2000.2.23 ## ################################### function M_d_main() define input_rec record bran_no char(6), tj_flag char(1), s_clerk_code char(10), beg_date date, end_date date end record define bran_name,tj_name char(20) define str,str0,str1,str2,str3 char(512) define tj_rec record pol_code char(4), pol_name char(40), ipsn_name char(10), ipsn_addr char(40), ipsn_tel char(20), ins_ext char(10), pay_amt decimal(12,2), check_date date end record open form M_c_main from "M_c_main" while true display form M_c_main #call clea(17) initialize input_rec.* to null let bran_name = " " let tj_name = " " display bran_name at 8,45 display tj_name at 10,40 let input_rec.bran_no = cu_num let input_rec.tj_flag = 1 let input_rec.beg_date = today let input_rec.end_date = today display by name input_rec.* input by name input_rec.* without defaults after field bran_no if input_rec.bran_no is null then call disp_msg("Sorry,机构代码不得为空???") next field bran_no end if if cu_num not matches "????00" then let input_rec.bran_no = cu_num end if display by name input_rec.* select branch_name into bran_name from branch where branch_no = input_rec.bran_no if status = 100 then call disp_msg("Sorry,机构代码不存在???") let input_rec.bran_no = cu_num display by name input_rec.* next field bran_no end if display bran_name at 8,45 attribute(reverse) after field tj_flag if input_rec.tj_flag is null then call disp_msg("Sorry,统计口径不得为空???") next field tj_flag end if case input_rec.tj_flag when '1' let tj_name = "开户时间" when '2' let tj_name = "出险时间" when '3' let tj_name = "立案时间" when '4' let tj_name = "审批时间" otherwise error "" next field tj_flag end case display tj_name clipped at 10,40 attribute(reverse) after field s_clerk_code if input_rec.s_clerk_code is not null then select * from opr where opr_num = input_rec.s_clerk_code if sqlca.sqlcode = 100 then call disp_msg("Sorry,操作员代码不正确???") next field s_clerk_code else call disp_msg("只对当前操作员做统计处理!!!") end if end if after field beg_date if input_rec.beg_date > today or input_rec.beg_date is null or input_rec.beg_date < mdy(1,1,1986) then call disp_msg("Sorry,统计开始日期不在规定内???") next field beg_date end if after field end_date if input_rec.end_date > today or input_rec.end_date is null or input_rec.end_date < input_rec.beg_date or input_rec.end_date < mdy(1,1,1986) then call disp_msg("Sorry,统计终止日期不在规定内???") next field end_date end if
on key(control-z) display by name input_rec.* if input_rec.bran_no is null then call disp_msg("Sorry,机构代码不得为空???") next field bran_no end if if cu_num not matches "????00" then let input_rec.bran_no = cu_num end if display by name input_rec.* select * from branch where branch_no = input_rec.bran_no if status = 100 then call disp_msg("Sorry,机构代码不存在???") let input_rec.bran_no = cu_num display by name input_rec.* next field bran_no end if if input_rec.tj_flag is null then call disp_msg("Sorry,统计口径不得为空???") next field tj_flag end if if input_rec.beg_date > today or input_rec.beg_date is null or input_rec.beg_date < mdy(1,1,1986) then call disp_msg("Sorry,统计开始日期不在规定内???") next field beg_date end if if input_rec.end_date > today or input_rec.end_date is null or input_rec.end_date < input_rec.beg_date or input_rec.end_date < mdy(1,1,1986) then call disp_msg("Sorry,统计终止日期不在规定内???") next field end_date end if exit input
on key(control-e) exit while end input display "正在搜索数据,请稍候..." at 18,29 attribute(reverse) let str0 = " select a.pol_code,b.pol_name,a.ipsn_name,a.ipsn_addr,a.ipsn_tel,a.ins_ext,a.count_amt,a.check_date from give_list a,give_pol b where a.pol_code = b.pol_code and a.branch_no = \"",input_rec.bran_no,"\"" case input_rec.tj_flag when '1' let str1 = " and a.log_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" when '2' let str1 = " and a.happ_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" when '3' let str1 = " and a.star_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" when '4' let str1 = " and a.check_date between \"",input_rec.beg_date,"\""," and \"",input_rec.end_date,"\"" otherwise continue while end case if input_rec.s_clerk_code is null then let str2 = "" else let str2 = " and a.clerk_code = \"",input_rec.s_clerk_code,"\"" end if let str3 = " order by 8" let str = str0 clipped,str1 clipped,str2 clipped,str3 clipped let str = str clipped prepare tj_see1 from str declare tj_cur1 scroll cursor with hold for tj_see1 open tj_cur1 fetch first tj_cur1 into tj_rec.* if status = 100 then call disp_msg("Sorry,符合条件的记录未找到?") continue while end if call disp_msg("正在打印,请稍候...") initialize tj_rec.* to null start report tj_rep1 foreach tj_cur1 into tj_rec.* output to report tj_rep1(tj_rec.*,bran_name,input_rec.beg_date,input_rec.end_date) end foreach finish report tj_rep1 call disp_msg("打印完毕!OK...") end while close form M_c_main end function
#*********************** # tj_rep1() 流水报表 * #*********************** report tj_rep1(tj_rec,bran_name,beg_date,end_date) define tj_rec record pol_code char(4), pol_name char(40), ipsn_name char(10), ipsn_addr char(40), ipsn_tel char(20), ins_ext char(10), pay_amt decimal(12,2), check_date date end record define bran_name char(20) define beg_date,end_date date output left margin 1 right margin 1 top margin 0 bottom margin 5 page length 67 format page header print ascii 27,"[5i" print ascii 27,"W",ascii 1,ascii 27,"w",ascii 1 skip 1 line print column 14,"人身保险业务理赔情况流水表" print ascii 27,"w",ascii 0,ascii 27,"W",ascii 0 skip 1 line print column 2,"报表单位:",bran_name clipped,column 40,"统计日期:从",beg_date using "yyyy年mm月dd日"," 到 ",end_date using "yyyy年mm月dd日"," ",pageno using "第<<<页" print column 1,"=====================================================================================================" print column 1,"险种代码 险 种 名 称 被保险人 通 讯 地 址 联系电话 业务员 给付金额 审批时间" print column 1,"=====================================================================================================" on every row print column 3,tj_rec.pol_code, column 11,tj_rec.pol_name clipped, column 34,tj_rec.ipsn_name clipped, column 43,tj_rec.ipsn_addr clipped, column 64,tj_rec.ipsn_tel clipped, column 74,tj_rec.ins_ext clipped, column 81,tj_rec.pay_amt using "¥<<<<<<.<<", column 92,tj_rec.check_date on last row print column 1,"=====================================================================================================" print column 2,"制 表: 蒋 华", column 43,"记录合计:",count(*) using "<<<<<", column 74,"金额合计:",sum(tj_rec.pay_amt) using "¥<<<<<<<<.<<" print ascii 12; print ascii 27,"@"; print ascii 27,"[4i" end report
################################### ## 函数:disp_msg() ## ## 功能:显示提示信息 ## ## 创建时间:1999.12.15 ## ################################### function disp_msg(msg) define msg char(35), m smallint let m = length(msg clipped) let m = (35 - m)/2 let m = m + 1 error "";error "" open window m_win at 13,23 with 1 rows,35 columns attribute(reverse,border) display " " at 1,1 display msg at 1,m;sleep 2 close window m_win end function
################################### ## 函数:disp_pol() ## ## 功能:显示险种信息 ## ## 创建时间:1999.12.15 ## ################################### function disp_pol() define pcode char(1), pol_list array[100] of record pol_code char(4), pol_name char(20) end record, str char(4), t_name char(20), i,x,z1_bl1,z1_bl2smallint
options form line 1 initialize pcode to null open window w31 at 7,14 with form "./form/M_pol" attribute(border) input pcode from f_pol_code after field f_pol_code if pcode is null then next field f_pol_code else select main_pol_name into t_name from give_main where main_pol_code=pcode if status==NOTFOUND then call disp_msg("大类代码不存在???") next field f_pol_code else exit input end if end if end input display t_name to f_pol_name let str=pcode,"???" declare pp_cur cursor for select pol_code,pol_name from give_pol where pol_code matches str open pp_cur let x=1 foreach pp_cur into pol_list[x].* let x=x+1 end foreach if x=1 then call disp_msg("无此类明细险种???") let str=null close window w31 options form line 4 return str end if for i=x+1 to 100 initialize pol_list[x].* to null end for
let x=x-1 let z1_bl1 = 1 let z1_bl2 = 1 call set_count(x) display array pol_list to rev_1.* on key (down,right)--- 下移一行 display pol_list[z1_bl1].* to rev_1[z1_bl2].* if z1_bl1 = x then call disp_msg("往下不再有记录???") else if z1_bl2 = 11 then scroll rev_1.* up else let z1_bl2 = z1_bl2+1 end if let z1_bl1 = z1_bl1+1 end if display pol_list[z1_bl1].* to rev_1[z1_bl2].* attribute(reverse) on key (up,left)--- 上移一行 display pol_list[z1_bl1].* to rev_1[z1_bl2].* if z1_bl1 = 1 then call disp_msg("往上不再有记录???") else if z1_bl2 = 1 then scroll rev_1.* down else let z1_bl2 = z1_bl2-1 end if let z1_bl1 = z1_bl1-1 end if display pol_list[z1_bl1].* to rev_1[z1_bl2].* attribute(reverse) on key (control-z,return) let x=arr_curr() exit display end display close window w31 options form line 4 return pol_list[z1_bl1].pol_code end function
| | |