今天修改代码调试当不良品统计表提交后数据同步到看板数据库,校验数据完成,开始进入测试阶段。
数据提交同步完整代码如下:
set rs=server.createobject("adodb.recordset")
sql="SELECT * FROM 验货报告每日记录明细 "
rs.open sql,conn,3,3
rs.addnew
rs("日期")=Request.Form("date")
rs("产品名称")=Request.Form("dm")
rs("供应商")=Request.Form("dmgys")
rs("周")=Request.Form("week")
rs("年")=year(Request.Form("date"))
rs("月")=month(Request.Form("date"))
rs("检查数")=Request.Form("jczs")
rs("目标数")=Request.Form("mbs")
rs("创建人")=own
rs("部门")=dept
rs("创建时间")=now()
rs("拉别")=Request.Form("q")
rs("时间段")=Request.Form("sjd")
rs("类别")=Request.Cookies("yhbg")
tqty=0
abcd=UBound (iid)
For I = 0 To UBound (iid)
t="h"&trim(iid(i))
tqty=tqty+blqty(I)
rs(t)=blqty(I)
next
rs("不良数")=tqty
rs("合格数")=rs("检查数")-tqty
rs("合格率")= formatnumber(rs("合格数")/rs("检查数")*100,2)
rs.update
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
rs.open "SELECT * FROM kanban where dept='"&dept&"' and laxian='"&Request.Form("q")&"' ",conn,3,3
'response.write "SELECT * FROM kanban where dept='"&dept&"' and laxian='"&Request.Form("q")&"' "
kh=int(Request.Form("sjd"))
if rs.eof or rs.pagecount = 0 then
rs.addnew
rs("date")=Request.Form("date")
rs("pn")=Request.Form("dm")
rs("own")=own
rs("laxian")=Request.Form("q")
rs("dept")=dept
rs("h"&kh&"s")=Request.Form("jczs")
rs("h"&kh&"m")=Request.Form("mbs")
rs("h"&kh&"n")=tqty
rs("n"&kh)=""
rs("p"&kh)=right(trim(Request.Form("dm")),3)
rs.update
else
rs("h"&kh&"s")=Request.Form("jczs")
rs("h"&kh&"m")=Request.Form("mbs")
rs("h"&kh&"n")=tqty
rs("n"&kh)=""
rs("p"&kh)=right(trim(Request.Form("dm")),3)
rs.update
end if
rs.close
set rs=nothing
end if