FrmPurchSearch.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Forms>
  3. <Form Name="FrmPurchSearch">
  4. <Client>
  5. <Events>
  6. <Load><![CDATA[
  7. @Title="最新采购查询";
  8. GetSchema();
  9. ChangeMode("Search");
  10. ]]></Load>
  11. </Events>
  12. <Mode>
  13. <Search>
  14. <Lable name="Search"/>
  15. </Search>
  16. </Mode>
  17. <Controls>
  18. <IKTextButton name="tbProduct1">
  19. <Events>
  20. <Click>
  21. @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct1.CValue);
  22. if( @temp == "" )
  23. return;
  24. tbProduct1.CValue = @temp;
  25. </Click>
  26. <Enter>
  27. tbProduct2.CValue = tbProduct1.CValue;
  28. </Enter>
  29. <TextBoxButtonTextChanged>
  30. </TextBoxButtonTextChanged>
  31. </Events>
  32. </IKTextButton>
  33. <IKTextButton name="tbProduct2">
  34. <Events>
  35. <Click>
  36. @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct2.CValue);
  37. if( @temp == "" )
  38. return;
  39. tbProduct2.CValue = @temp;
  40. </Click>
  41. </Events>
  42. </IKTextButton>
  43. <IKTextButton name="tbPName1">
  44. <Events>
  45. <Click>
  46. @temp = ShowSearchBox("ProductSearch","INFOMATION",tbPName1.CValue);
  47. if( @temp == "" )
  48. return;
  49. tbPName1.CValue = @temp;
  50. </Click>
  51. <TextBoxButtonTextChanged>
  52. </TextBoxButtonTextChanged>
  53. </Events>
  54. </IKTextButton>
  55. <IKTextButton name="tbPName2">
  56. <Events>
  57. <Click>
  58. @temp = ShowSearchBox("ProductSearch","INFOMATION",tbPName2.CValue);
  59. if( @temp == "" )
  60. return;
  61. tbPName2.CValue = @temp;
  62. </Click>
  63. </Events>
  64. </IKTextButton>
  65. <IKComboBoxEx name="cbType1" DataSource="Type" DisplayMember="Type_Product" >
  66. <Events>
  67. <Reload>
  68. UpdateForm(false, "cbType1");
  69. Search("SearchType");
  70. UpdateForm(true, "cbType1");
  71. </Reload>
  72. <TextChanged>
  73. cbType2.Text = cbType1.Text;
  74. </TextChanged>
  75. </Events>
  76. </IKComboBoxEx>
  77. <IKComboBoxEx name="cbType2" DataSource="Type" DisplayMember="Type_Product" >
  78. <Events>
  79. <Reload>
  80. UpdateForm(false, "cbType2");
  81. Search("SearchType");
  82. UpdateForm(true, "cbType2");
  83. </Reload>
  84. </Events>
  85. </IKComboBoxEx>
  86. <IKCheckBox name = "ckDTStart">
  87. <Events>
  88. <Click>
  89. dtStart.Enabled = ckDTStart.Checked;
  90. </Click>
  91. </Events>
  92. </IKCheckBox>
  93. <IKCheckBox name = "ckDTEnd">
  94. <Events>
  95. <Click>
  96. dtEnd.Enabled = ckDTEnd.Checked;
  97. </Click>
  98. </Events>
  99. </IKCheckBox>
  100. <IKButton name="btnSearch">
  101. <Events>
  102. <Click>
  103. <Lable name="Action"/>
  104. </Click>
  105. </Events>
  106. </IKButton>
  107. <IKButton name="btnEmpty">
  108. <Events>
  109. <Click>
  110. ChangeMode("Search");
  111. </Click>
  112. </Events>
  113. </IKButton>
  114. <IKExtendGrid name="dgProduct" DataSource="PurchaseSearch" TableStyleIndex="0">
  115. <DataColumn Index="0" DataSource="PurchaseSearch.No_Product"/>
  116. <DataColumn Index="1" DataSource="PurchaseSearch.Name_Product"/>
  117. <DataColumn Index="2" DataSource="PurchaseSearch.Type_Product"/>
  118. <DataColumn Index="3" DataSource="PurchaseSearch.Quantity_PurchaseOrderBillProduct"/>
  119. <DataColumn Index="4" DataSource="PurchaseSearch.comment_PurchaseOrderBillProduct"/>
  120. <DataColumn Index="5" DataSource="PurchaseSearch.No_PurchaseOrderBill"/>
  121. <DataColumn Index="6" DataSource="PurchaseSearch.RefNo_PurchaseOrderBill"/>
  122. <DataColumn Index="7" DataSource="PurchaseSearch.Date_PurchaseOrderBill"/>
  123. <Events>
  124. <ClickPreview>
  125. PrintReport(dgProduct.CurrentView);
  126. </ClickPreview>
  127. <ClickFilter>
  128. ;
  129. </ClickFilter>
  130. <ClickNOFilter>
  131. ;
  132. </ClickNOFilter>
  133. <ClickRefresh>
  134. <Lable name="Action"/>
  135. </ClickRefresh>
  136. </Events>
  137. </IKExtendGrid>
  138. </Controls>
  139. <ChildForms>
  140. <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品">
  141. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  142. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  143. <DataColumn Index="2" MappingName="#Product.suspension" HeaderText="暂停使用" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  144. <DataColumn Index="3" MappingName="#Product.Price_Product" HeaderText="标准售价" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  145. <DataColumn Index="4" MappingName="#Product.Unit_Product" HeaderText="基本单位" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  146. <DataColumn Index="5" MappingName="#Product.Type_Product" HeaderText="产品大类" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  147. <DataColumn Index="6" MappingName="#Product.Property_Product" HeaderText="产品性质" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  148. </ChildForm>
  149. </ChildForms>
  150. </Client>
  151. <Server>
  152. <Tables>
  153. <Table name="PurchaseSearch" Type="Child">
  154. <GetSchema CmdType="Text" CmdText="
  155. Select Top 0 No_Product,Name_Product,Type_Product,Quantity_PurchaseOrderBillProduct,comment_PurchaseOrderBillProduct,A.No_PurchaseOrderBill,RefNo_PurchaseOrderBill,Date_PurchaseOrderBill From
  156. (
  157. Select ID_Product,Max(No_PurchaseOrderBill) As No_PurchaseOrderBill
  158. From PurchaseOrderBillProduct
  159. Join PurchaseOrderBill On PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill
  160. Group By ID_Product
  161. )A
  162. Join PurchaseOrderBill ON PurchaseOrderBill.No_PurchaseOrderBill=A.No_PurchaseOrderBill
  163. Join PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_Product=A.ID_Product And PurchaseOrderBillProduct.ID_PurchaseOrderBill=PurchaseOrderBill.ID_PurchaseOrderBill
  164. Left Join Product On Product.ID_Product=A.ID_Product
  165. "/>
  166. </Table>
  167. </Tables>
  168. <Search>
  169. <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product,suspension = Case isnull(SuspendDate_Product,0) when 0 then '否' else '是' end,convert(decimal(14,2),Price_Product) as Price_Product,Unit_Product,Type_Product,Product.Property_Product FROM Product">
  170. <Tables>
  171. <Table name="AllProduct" />
  172. </Tables>
  173. </SearchAllProduct>
  174. <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef as Type_Product FROM TypeDef WHERE (Type_TypeDef = 8) ORDER BY Name_TypeDef">
  175. <Tables>
  176. <Table name="Type"/>
  177. </Tables>
  178. </SearchType>
  179. <SearchPurch CmdType="Text" CmdText="
  180. Select No_Product,Name_Product,Type_Product,Quantity_PurchaseOrderBillProduct,comment_PurchaseOrderBillProduct,A.No_PurchaseOrderBill,RefNo_PurchaseOrderBill,Date_PurchaseOrderBill From
  181. (
  182. Select ID_Product,Max(No_PurchaseOrderBill) As No_PurchaseOrderBill
  183. From PurchaseOrderBillProduct
  184. Join PurchaseOrderBill On PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill
  185. Where PurchaseOrderBill.ID_Assessor Is Not Null
  186. And Date_PurchaseOrderBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date_PurchaseOrderBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date_PurchaseOrderBill)
  187. Group By ID_Product
  188. )A
  189. Join PurchaseOrderBill ON PurchaseOrderBill.No_PurchaseOrderBill=A.No_PurchaseOrderBill
  190. Join PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_Product=A.ID_Product And PurchaseOrderBillProduct.ID_PurchaseOrderBill=PurchaseOrderBill.ID_PurchaseOrderBill
  191. Left Join Product On Product.ID_Product=A.ID_Product
  192. Where No_Product between IsNull(@StartNo_Product,No_Product) And IsNull(@EndNo_Product,No_Product)
  193. And Name_Product between IsNull(@StartName_Product,Name_Product) And IsNull(@EndName_Product,Name_Product)
  194. And Type_Product between IsNull(@StartType_Product,Type_Product) And IsNull(@EndType_Product,Type_Product)
  195. Order By No_Product
  196. ">
  197. <Params>
  198. <Param name="@StartNo_Product" type="Product.No_Product" Index="0" />
  199. <Param name="@EndNo_Product" type="Product.No_Product" Index="1" />
  200. <Param name="@StartType_Product" type="Product.Type_Product" Index="2" />
  201. <Param name="@EndType_Product" type="Product.Type_Product" Index="3" />
  202. <Param name="@StartName_Product" type="Product.Name_Product" Index="4" />
  203. <Param name="@EndName_Product" type="Product.Name_Product" Index="5" />
  204. <Param name="@StartDate" type="PurchaseOrderBill.Date_PurchaseOrderBill" Index="6" />
  205. <Param name="@EndDate" type="PurchaseOrderBill.Date_PurchaseOrderBill" Index="7" />
  206. </Params>
  207. <Tables>
  208. <Table name="PurchaseSearch" />
  209. </Tables>
  210. </SearchPurch>
  211. </Search>
  212. </Server>
  213. <Lables>
  214. <Search>
  215. Empty();
  216. tbProduct1.CValue="";
  217. tbProduct2.CValue="";
  218. cbType1.Text="";
  219. cbType2.Text="";
  220. tbPName1.CValue="";
  221. tbPName2.CValue="";
  222. ckDTStart.Checked=false;
  223. ckDTEnd.Checked=false;
  224. dtStart.Enabled=false;
  225. dtEnd.Enabled=false;
  226. </Search>
  227. <Action>
  228. Empty();
  229. @StartNo_Product=DBNull();
  230. @EndNo_Product=DBNull();
  231. @StartType_Product=DBNull();
  232. @EndType_Product=DBNull();
  233. if(tbProduct1.CValue!="")
  234. @StartNo_Product=tbProduct1.CValue;
  235. if(tbProduct2.CValue!="")
  236. @EndNo_Product=tbProduct2.CValue;
  237. if(cbType1.Text!="")
  238. @StartType_Product=cbType1.Text;
  239. if(cbType2.Text!="")
  240. @EndType_Product=cbType2.Text;
  241. @StartName_Product=tbPName1.CValue==""?DBNull():tbPName1.CValue;
  242. @EndName_Product=tbPName2.CValue==""?DBNull():tbPName2.CValue;
  243. @StartDate=ckDTStart.Checked?dtStart.Value:DBNull();
  244. @EndDate=ckDTEnd.Checked?dtEnd.Value:DBNull();
  245. Search("SearchPurch",@StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,@StartName_Product,@EndName_Product,@StartDate,@EndDate);
  246. </Action>
  247. </Lables>
  248. </Form>
  249. </Forms>