以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]网页生版数据更新进度的设计 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=164895) |
||
-- 作者:fczhaobo -- 发布时间:2021/5/8 10:04:00 -- [求助]网页生版数据更新进度的设计 场景介绍:1、A网页生成JOSN字符串数组(量大一些), 2、通过"var result = sendAjaxJSON(jays, "kqupdateok.htm", "", false);", 3、交给B网页进行后台数据的更新修改。并返回执行的结果。 由于量稍大一些,想在A网页产生一个进度条指示,通过研究显示上传进度文档, http://www.foxtable.com/mobilehelp/topics/0139.htm 能否实现呢?
|
||
-- 作者:fczhaobo -- 发布时间:2021/5/8 10:07:00 -- \'A网页内容 Dim e As RequestEventArgs = args(0) Dim wb As New weui Dim ja As New JArray Dim i As Integer Dim jays As String wb.AddPageTitle("","ph1",e.Cookies("username"),"点名时间:" & Format(Date.now, "f")) With wb.AddPreview("","pv2","点名列表清单","共" & e.PostValues.Count & "人") For Each key As String In e.Values.Keys Dim s As String = e.PostValues(key) \'重要提示,变量顺序不能改变,学员姓名,缴费编号,学员编号,分校编号,所报学科,剩余课时,性别,上课时间 Dim Values() As String Values = s.split(",") Dim xyxm As String = Values(0) \'学员姓名 Dim jfbh As String = Values(1) \'缴费编号 Dim xybh As String = Values(2) \'学员编号 Dim fxbh As String = Values(3) \'分校编号 Dim sbkc As String = Values(4) \'所报课程 Dim syks As String = Values(5) \'剩余课时 Dim xyxb As String = values(6) \'学员性别 Dim drsksj As String = values(7) \'学员上课时间 Dim xxlb As String = "课程:" & sbkc & ",剩余课时:" & syks & ",缴费编号:" & jfbh \'单学员的核实信息 学号:" & xybh & ", ja.Add(New JObject) ja(i)("xyxm") = xyxm ja(i)("jfbh") = jfbh ja(i)("xybh") = xybh ja(i)("fxbh") = fxbh ja(i)("sbkc") = sbkc ja(i)("syks") = syks ja(i)("xyxb") = xyxb ja(i)("drsksj") = drsksj i =i+1 .AddItem(xyxm & "(" & xyxb & ")",xxlb) Next jays = CompressJson(ja) \'对象变量 \'jays = ja.ToString() .Addbutton("已核实,提交", "", 1, "onclick=getUser(" & jays & ")") \' .Addbutton("重新点名", "", 0,"") End With With wb.AddDialog("","dlg2", "提示","") \'增加订单失败提示框 .AddButton("btnOK","确定","/dmtest.htm") End With wb.AppendHTML("<script> " & vars("js-json") & " </script>") \'引入脚本文件 e.WriteString(wb.Build) \'生成网页
|
||
-- 作者:fczhaobo -- 发布时间:2021/5/8 10:08:00 -- AJAX函数 function getUser(jays) {
if (confirm("确定提交考勤数据吗?", "逸飞书画课堂点名")) {
var result = sendAjaxJSON(jays, "kqupdateok.htm", "", false);
//document.getElementById("p1").innerHTML = result;
if (result == \'OK\') {
//alert("数据更新成功")
{
showDialog(\'dlg2\', \'成功\', "考勤数据已更新成功,请避免重复考勤!!")
}
} else {
showDialog(\'dlg2\',"提示",result)
}
} } |
||
-- 作者:fczhaobo -- 发布时间:2021/5/8 10:11:00 -- \'B网页代码 Dim e As RequestEventArgs = args(0) Dim sb As New StringBuilder Dim cstxt As String Dim zsi As Integer = 0 For Each ja As JToken In JArray.Parse(e.PlainText) Dim jfbh As String = ja("jfbh").ToString()\'缴费编号 Dim dmls As String = e.Cookies("Username") \'点名老师 Dim dmlsbh As String = e.Cookies("Userzhanghao") \'点名老师编号 Dim xybh As String = ja("xybh").ToString() \'学员编号 Dim fxbh As String = ja("fxbh").ToString() \'分校编号 Dim xyxm As String = ja("xyxm").ToString() \'学员姓名 Dim sbkc As String = ja("sbkc").ToString() \'所报课程 Dim drsksj As String= ja("drsksj").ToString() \'单人上课时间 If jfbh <> "" Then Dim kcssks As Integer Dim cmd9 As New SQLCommand cmd9.CSe lect 实上课时 From {报名缴费} Where 缴费编号=\'" & jfbh & "\'" kcssks = cmd9.ExecuteScalar() Dim cmd2 As New SQLCommand cmd2.C cmd2.CommandText = "UP DATE {报名缴费} SE T [实上课时] = ISNULL(实上课时,0) + 1,[剩余课时] = ISNULL(应上课时,0) - ISNULL(实上课时,0) - ISNULL(请假课时,0) - 1 WH ERE 缴费编号=\'" & jfbh & "\' and 课程状态=\'已开课\' And 剩余课时 > 0" Dim cgi As Integer = cmd2.ExecuteNonQuery() If cgi > 0 Then Dim cmd As new SQLCommand cmd.Connection Name = "" cmd.CommandText = "In sert Into 学员课时记录表 (缴费编号,分校编号,学员编号,所报学科,上课时间,点名时间,任课教师,任课教师编号,点名教师,点名教师编号,单科节次,备注) Values(?,?,?,?,?,?,?,?,?,?,?,?)" cmd.Parameters.Add("@缴费编号",jfbh) cmd.Parameters.Add("@分校编号",fxbh) cmd.Parameters.Add("@学员编号",xybh) cmd.Parameters.Add("@所报学科",sbkc) cmd.Parameters.Add("@上课时间",drsksj) cmd.Parameters.Add("@点名时间",Date.now) cmd.Parameters.Add("@任课教师",dmls) cmd.Parameters.Add("@任课教师编号",dmlsbh) cmd.Parameters.Add("@点名教师",dmls) cmd.Parameters.Add("@点名教师编号",dmlsbh) cmd.Parameters.Add("@单科节次",kcssks + 1) cmd.Parameters.Add("@备注","web点名") cmd.ExecuteNonQuery() End If zsi = zsi + 1 End If Next e.WriteString("共有" & zsi & "人次考勤记录更新成功")
|
||
-- 作者:有点蓝 -- 发布时间:2021/5/8 10:23:00 -- 改为异步回调(http://www.foxtable.com/mobilehelp/topics/0112.htm),然后显示一个正在运行的动画,比如:http://www.foxtable.com/mobilehelp/topics/0106.htm
|
||
-- 作者:fczhaobo -- 发布时间:2021/5/8 11:19:00 -- 成功使用,但是,回调成功后没有自动关闭 |
||
-- 作者:有点蓝 -- 发布时间:2021/5/8 11:21:00 -- hide(\'t1\'); |
||
-- 作者:fczhaobo -- 发布时间:2021/5/9 17:07:00 -- function getUser(jays) {
if (confirm("确定提交考勤数据吗?", "逸飞书画课堂点名")) {
show(\'tst1\');
sendAjaxJSON(jays, "kqupdateok.htm", "afterSendJson");
} } //显示服务器返回的数据 function afterSendJson(result) {
if (result == \'OK\') {
hide(\'tst1\');
//alert("数据更新成功")
{
showDialog(\'dlg2\', \'成功\', "考勤数据已更新成功,请避免重复考勤!!")
}
} else {
showDialog(\'dlg2\', "提示", result)
} }
|
||
-- 作者:fczhaobo -- 发布时间:2021/5/9 17:07:00 -- 一直加上了,就是不行呢? |
||
-- 作者:有点蓝 -- 发布时间:2021/5/9 22:27:00 -- function afterSendJson(result) { hide(\'tst1\');
if (result == \'OK\') {
//alert("数据更新成功")
{
|