<%@ Page Language="C#"%>
<%
	string FlowID = Request.QueryString["flowid"];
	string StepID = Request.QueryString["stepid"];
	string GroupID = Request.QueryString["groupid"];
	string TaskID = Request.QueryString["taskid"];
	string InstanceID = Request.QueryString["instanceid"];
	string DisplayModel = Request.QueryString["display"] ?? "0";
	string DBConnID = "06075250-30dc-4d32-bf97-e922cb30fac8";
	string DBTable = "TempTest_Purchase";
	string DBTablePK = "ID";
	string DBTableTitle = "Title";
if(InstanceID.IsNullOrEmpty()){InstanceID = Request.QueryString["instanceid1"];}	RoadFlow.Platform.Dictionary BDictionary = new RoadFlow.Platform.Dictionary();
	RoadFlow.Platform.WorkFlow BWorkFlow = new RoadFlow.Platform.WorkFlow();
	RoadFlow.Platform.WorkFlowTask BWorkFlowTask = new RoadFlow.Platform.WorkFlowTask();
	string fieldStatus = BWorkFlow.GetFieldStatus(FlowID, StepID);
	LitJson.JsonData initData = BWorkFlow.GetFormData(DBConnID, DBTable, DBTablePK, InstanceID, fieldStatus);
	string TaskTitle = BWorkFlow.GetFromFieldData(initData, DBTable, DBTableTitle);
%>
<link href="Scripts/Forms/flowform.css" rel="stylesheet" type="text/css" />
<script src="Scripts/Forms/common.js" type="text/javascript" ></script>
<input type="hidden" id="Form_ValidateAlertType" name="Form_ValidateAlertType" value="2" />
<input type="hidden" id="Form_TitleField" name="Form_TitleField" value="TempTest_Purchase.Title" />
<input type="hidden" id="Form_DBConnID" name="Form_DBConnID" value="06075250-30dc-4d32-bf97-e922cb30fac8" />
<input type="hidden" id="Form_DBTable" name="Form_DBTable" value="TempTest_Purchase" />
<input type="hidden" id="Form_DBTablePk" name="Form_DBTablePk" value="ID" />
<input type="hidden" id="Form_DBTableTitle" name="Form_DBTableTitle" value="Title" />
<input type="hidden" id="Form_AutoSaveData" name="Form_AutoSaveData" value="1" />
<script type="text/javascript">
	var initData = <%=BWorkFlow.GetFormDataJsonString(initData)%>;
	var fieldStatus = "1"=="<%=Request.QueryString["isreadonly"]%>"? {} : <%=fieldStatus%>;
	var displayModel = '<%=DisplayModel%>';
	$(window).load(function (){
		formrun.initData(initData, "TempTest_Purchase", fieldStatus, displayModel);
	});
</script>
<p><br/></p><p><br/></p><p style="text-align: center;"><span style="font-size: 20px;"><strong>物资采购申请</strong></span><br/></p><table class="flowformtable" cellspacing="1" cellpadding="0" uetable="null" data-sort="sortDisabled"><tbody><tr class="firstRow"><td width="102" valign="top" style="-ms-word-break: break-all;">申请人：<br/></td><td width="434" valign="top" style="word-break: break-all;"><input type="text" type1="flow_org" id="TempTest_Purchase.UserID" name="TempTest_Purchase.UserID" value="u_<%=new RoadFlow.Platform.WorkFlowTask().GetFirstSnderID(FlowID.ToGuid(), GroupID.ToGuid(), true)%>" more="0" isflow="1" class="mymember" title="" dept="0" station="0" user="1" workgroup="0" unit="0" rootid=""/></td><td width="97" valign="top" style="-ms-word-break: break-all;">部门：</td><td width="439" valign="top" style="-ms-word-break: break-all;"><input type="text" type1="flow_org" id="TempTest_Purchase.UserDept" name="TempTest_Purchase.UserDept" value="<%=new RoadFlow.Platform.WorkFlowTask().GetFirstSnderDeptID(FlowID.ToGuid(), GroupID.ToGuid())%>" more="0" isflow="1" class="mymember" title="" dept="1" station="0" user="0" workgroup="0" unit="0" rootid=""/></td></tr><tr><td width="102" valign="top" style="-ms-word-break: break-all;">申请日期：<br/></td><td width="434" valign="top" style="-ms-word-break: break-all;"><input type="text" type1="flow_datetime" id="TempTest_Purchase.SqDateTime" name="TempTest_Purchase.SqDateTime" value="<%=RoadFlow.Utility.DateTimeNew.ShortDate%>" defaultvalue="<%=RoadFlow.Utility.DateTimeNew.ShortDate%>" istime="0" daybefor="0" dayafter="0" currentmonth="0" isflow="1" class="mycalendar" title=""/></td><td width="97" valign="top" style="-ms-word-break: break-all;">备注：</td><td width="439" valign="top" style="-ms-word-break: break-all;"><input type="text" id="TempTest_Purchase.Note" type1="flow_text" name="TempTest_Purchase.Note" value="<%=Request["flowid"]%>" style="width:80%" valuetype="0" isflow="1" class="mytext" title=""/></td></tr><tr><td valign="top" style="word-break: break-all;" colspan="4">申请明细：  <input type="text" type1="flow_dict" id="TempTest_Purchase.Note" name="TempTest_Purchase.Note" value="" dialogtitle="" ismore="0" isroot="0" isparent="0" datasource="3" ds_url_gettitle="" class="mylrselect" title="" dbconn="06075250-30dc-4d32-bf97-e922cb30fac8" dbtable="Dictionary" valuefield="ID" titlefield="Title" parentfield="ParentID" where="id='2A2BBEE3-9883-4185-A64C-4430AA20E0CB'" isflow="1"/></td></tr><tr><td valign="top" style="-ms-word-break: break-all;" colspan="4"><div><script type="text/javascript">function subtable_addrow_TempTest_PurchaseList_ID_ID_PurchaseID(){var subtableid = "TempTest_PurchaseList_ID_ID_PurchaseID";var instanceid = "<%=InstanceID%>";var tabid = '<%=Request.QueryString["tabid"]%>';if($.trim(instanceid).length==0){alert("请先保存主表数据再添加!");return;}new RoadUI.Window().open({url:"/Platform/WorkFlowRun/SubTableEdit.aspx?flowid=<%=FlowID%>&stepid=<%=StepID%>&secondtableeditform=b334e5fd-e995-4d5b-bfd6-feb9ac14122a&primarytableid=" + instanceid + "&secondtablerelationfield=TempTest_PurchaseList.PurchaseID",openerid:tabid,title:"添加",height:370,width:700});}function subtable_editrow_TempTest_PurchaseList_ID_ID_PurchaseID(id){var subtableid="TempTest_PurchaseList_ID_ID_PurchaseID";var instanceid="<%=Request.QueryString["instanceid"]%>";var tabid='<%=Request.QueryString["tabid"]%>';new RoadUI.Window().open({url:"/Platform/WorkFlowRun/SubTableEdit.aspx?flowid=<%=FlowID%>&stepid=<%=StepID%>&secondtableeditform=b334e5fd-e995-4d5b-bfd6-feb9ac14122a&secondtable=TempTest_PurchaseList&secondtableconnid=<%=DBConnID%>&secondtableprimarykey=ID&instanceid="+id+"&primarytableid="+instanceid+"&secondtablerelationfield=TempTest_PurchaseList.PurchaseID",openerid:tabid,title:"编辑",height:370,width:700});}function subtable_deleterow_TempTest_PurchaseList_ID_ID_PurchaseID(id){var subtableid = "TempTest_PurchaseList_ID_ID_PurchaseID";var instanceid = "<%=InstanceID%>";var tabid = '<%=Request.QueryString["tabid"]%>';if(!confirm("您真的要删除该记录吗?")){return;}$.ajax({url:"/Platform/WorkFlowRun/SubTableDelete.aspx?secondtableeditform=b334e5fd-e995-4d5b-bfd6-feb9ac14122a&secondtableconnid=<%=DBConnID%>&secondtable=TempTest_PurchaseList&secondtableprimarykey=ID&secondtablepkvalue="+id,async:false,cache:false,success:function(txt){alert(txt);window.location=window.location;}});}</script><table class="flowformsubtable" style="width:99%;margin:0 auto;" cellPadding="0" cellspacing="1" issubflowtable="1" id="subtable_TempTest_PurchaseList_ID_ID_PurchaseID"><thead><tr><th style="text-align:left;">名称</th><th style="text-align:left;">型号</th><th style="text-align:left;">单位</th><th style="text-align:left;">数量</th><th style="text-align:left;">日期</th><th style="text-align:left;">类型</th><th style="text-align:left;">备注</th><th style="width:10%; text-align:left;"><input type="button" value="添加" onclick="subtable_addrow_TempTest_PurchaseList_ID_ID_PurchaseID();"/></th></tr></thead><tbody><%System.Data.DataTable Dt = new RoadFlow.Platform.DBConnection().GetDataTable(DBConnID, "TempTest_PurchaseList","PurchaseID", InstanceID);RoadFlow.Platform.WorkFlowForm bWorkFlowForm = new RoadFlow.Platform.WorkFlowForm();foreach(System.Data.DataRow dr in Dt.Rows){%><tr><td><%=bWorkFlowForm.GetDisplayString(dr["Name"].ToString(), "normal", "", DBConnID, "" ) %></td><td><%=bWorkFlowForm.GetDisplayString(dr["Model"].ToString(), "normal", "", DBConnID, "" ) %></td><td><%=bWorkFlowForm.GetDisplayString(dr["Unit"].ToString(), "normal", "", DBConnID, "" ) %></td><td><%=bWorkFlowForm.GetDisplayString(dr["Quantity"].ToString(), "number_format", "0,000.00", DBConnID, "" ) %></td><td><%=bWorkFlowForm.GetDisplayString(dr["Date"].ToString(), "datetime_format", "yyyy-MM-dd", DBConnID, "" ) %></td><td><%=bWorkFlowForm.GetDisplayString(dr["Type"].ToString(), "normal", "", DBConnID, "" ) %></td><td><%=bWorkFlowForm.GetDisplayString(dr["Note"].ToString(), "files_img", "", DBConnID, "" ) %></td><td><input type="button" value="编辑" onclick="subtable_editrow_TempTest_PurchaseList_ID_ID_PurchaseID('<%=dr["ID"]%>');" style="margin-right:4px;" name="flowsubtable_TempTest_PurchaseList_ID_ID_PurchaseID_editbutton" /><input type="button" value="删除" onclick="subtable_deleterow_TempTest_PurchaseList_ID_ID_PurchaseID('<%=dr["ID"]%>');" name="flowsubtable_TempTest_PurchaseList_ID_ID_PurchaseID_editbutton"/></td></tr><%}%></tbody></table></div></td></tr></tbody></table><p><br/></p>