1fcc002ffef775cff31c2f64606b4f2b64fc044f.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/css" href="../../css/body.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>
  6. <![CDATA[ 发货管理 >> 发货处理 >> 日下车计划表(UIJ010090)]]>
  7. </xhtml:title>
  8. <model id="model1">
  9. <instance id="instance1">
  10. <root xmlns="">
  11. <formData>
  12. <DATE/>
  13. <TRANS_TYPE>T</TRANS_TYPE>
  14. <ORD_NO/>
  15. </formData>
  16. <resData/>
  17. <reqData/>
  18. <grid1/>
  19. <datagrid1/>
  20. <DLIV_DIRNO/>
  21. <sumData>
  22. <SUM_COILRST_CNT/>
  23. <SUM_COILRST_WGT/>
  24. </sumData>
  25. </root>
  26. </instance>
  27. </model>
  28. <script type="javascript">
  29. <![CDATA[
  30. function Init(node) {
  31. InitParams(node);
  32. }
  33. //调用公共的初始化方法获得登录用户名
  34. function InitParams(node) {
  35. if (typeof node == "undefined" && typeof node != "object") return;
  36. model.removenode("/root/initData/rcvInfo");
  37. model.makeNode("/root/initData/rcvInfo");
  38. var nodeList = node.childNodes;
  39. node = model.instances(0).selectSingleNode("/root/initData/rcvInfo");
  40. for (var i = 0; i < nodeList.length; i++)
  41. node.appendChild(nodeList.item(i));
  42. }
  43. function excelExport(){
  44. return datagrid2;
  45. }
  46. function find(){
  47. commSendReq("/root/formData");
  48. commSubmit("UIJ010090-service","find","glueAction.do");
  49. commAppendData("/root/grid1/FAHUO_RESULT_VO","/root/resData/FAHUO_RESULT_VO");
  50. datagrid1.refresh();
  51. var COIL_CNT = null;
  52. var COIL_WGT = null;
  53. var CUR_LOAD_LOC = null;
  54. var nodeSet1 = datagrid1.nodeset;
  55. for(var i = datagrid1.fixedRows ; i < datagrid1.rows ; i++){
  56. datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) = i-1;
  57. var CNT = datagrid1.valueMatrix(i,datagrid1.colRef("CNT"));
  58. var ACT_WGT = datagrid1.valueMatrix(i,datagrid1.colRef("ACT_WGT"));
  59. //求和
  60. COIL_CNT =Number(COIL_CNT) + Number(CNT);
  61. COIL_WGT =Number(COIL_WGT) + Number(ACT_WGT);
  62. }
  63. //没有值的情况下,不能赋值
  64. if(COIL_CNT == null || COIL_WGT == null){
  65. model.setValue("/root/sumData/SUM_COILRST_CNT",0);
  66. model.setValue("/root/sumData/SUM_COILRST_WGT",0);
  67. model.refresh();
  68. }else{
  69. model.setValue("/root/sumData/SUM_COILRST_CNT",COIL_CNT);
  70. model.setValue("/root/sumData/SUM_COILRST_WGT",COIL_WGT/1000);
  71. model.refresh();
  72. }
  73. for(j=0;j<datagrid1.rows;j++){
  74. CUR_LOAD_LOC = model.getValue(nodeSet1+"["+j+"]/CUR_LOAD_LOC");
  75. if(CUR_LOAD_LOC == "YZ"){
  76. datagrid1.rowStyle((j+1), "data", "background-color") = "#ffff99";
  77. }else{
  78. datagrid1.rowStyle((j+1), "data", "background-color") = "#ffffff";
  79. }
  80. }
  81. datagrid1.refresh();
  82. }
  83. function saveExcelScript(sDGridName, sExcelSheetName, saveType) {
  84. var sExcelName = window.fileDialog("save", ",", false, "", "xls", "Excel File(*.xls)|*.xls");
  85. if ( sExcelName == "" ) {
  86. return;
  87. }
  88. //var sCSVName = "C:\\TFSmartUpdater\\" + sExcelName.lastIndexOf(".") +".csv";
  89. var sCSVName = sExcelName +".csv";
  90. //alert("sExcelName = ["+ sExcelName +"]\nsCSVName = ["+ sCSVName + "]");
  91. eval(sDGridName).saveText(sCSVName, "\n", ",", '\:', true); //DataGrid? ??? CSV??? ??
  92. ObjTFExcel.launchNewInstance(0); //Execute EXCEL
  93. ObjTFExcel.createWorkbook(); //Create new Workbook(for example:Sheet1,Sheet2,Sheet3) -- createWorkBook(Excel-TemplateFile)
  94. ObjTFExcel.loadCSV(sCSVName); //Loading Contents, from CSV to Excel
  95. //Setting up EXCEL Layout.
  96. var nRows = sDGridName.rows - sDGridName.fixedRows + 1; //Keep Careful !!!
  97. var nCols = sDGridName.cols;
  98. //Header
  99. //Line 1 : Sheet Title
  100. //行高的设置
  101. //All of the range
  102. ObjTFExcel.fontcolor ( 01, 01, nRows, nCols ) = "#000000" ;
  103. ObjTFExcel.font ( 01, 01, nRows, nCols ) = "SimSun" ;
  104. //取消边框
  105. ObjTFExcel.setBorderColor( 01, 01, nRows, nCols, "#000000") ;
  106. ObjTFExcel.bold ( 01, 01, nRows, nCols ) = true ;
  107. //改变字体大小
  108. ObjTFExcel.fontsize ( 01, 01, nRows, nCols ) = 12 ;
  109. ObjTFExcel.underline ( 01, 01, nRows, nCols ) = 0 ;
  110. ObjTFExcel.valign ( 01, 01, nRows, nCols ) ="middle" ;
  111. //字体居中
  112. ObjTFExcel.halign ( 01, 01, nRows, nCols ) ="center" ;
  113. //Query-Results Data
  114. var iRow = 1; // iRow = HeaderLine + 1;
  115. //这里设置字体的行宽
  116. // for(var i = iRow; i <= nRows; i++ ) {
  117. // if( (i%5) == 1 ) {
  118. // ObjTFExcel.rowHeight( i ) = 60;
  119. // ObjTFExcel.mergeCell( i, 01, i, nCols );
  120. // } else if( (i%5) == 0 ) {
  121. // ObjTFExcel.rowHeight( i ) = 45;
  122. // ObjTFExcel.mergeCell( i, 01, i, nCols );
  123. // } else {
  124. // ObjTFExcel.rowHeight( i ) = 40;
  125. // }
  126. // }
  127. //改变文本格式的方法,未知
  128. //ObjTFExcel.setformat(02,02,02,03,'@');
  129. //设置列的宽度
  130. ObjTFExcel.colwidth ( 01 ) = 5 ;
  131. ObjTFExcel.colwidth ( 02 ) = 10 ;
  132. ObjTFExcel.colwidth ( 03 ) = 20 ;
  133. ObjTFExcel.colwidth ( 04 ) = 10 ;
  134. ObjTFExcel.colwidth ( 05 ) = 15 ;
  135. ObjTFExcel.colwidth ( 06 ) = 10 ;
  136. ObjTFExcel.colwidth ( 07 ) = 10 ;
  137. ObjTFExcel.colwidth ( 08 ) = 5 ;
  138. ObjTFExcel.colwidth ( 09 ) = 5 ;
  139. ObjTFExcel.colwidth ( 10 ) = 10 ;
  140. // ObjTFExcel.setFormat(iRow, 14, nRows, 14, "yyyy\"-\"mm\"-\"dd\"\" hh\":\"mm\":\"ss\"\";@");
  141. ObjTFExcel.sheetName(1) = sExcelSheetName;
  142. ObjTFExcel.save(sExcelName); //Saving EXCEL
  143. ObjTFExcel.close(); //Closing EXCEL. (You must be closed EXCEL !!!)
  144. window.exec("EXCEL.EXE", sExcelName); //Openning EXCEL
  145. }
  146. ]]>
  147. </script>
  148. <script type="javascript" src="../../js/boaCommon.js"/>
  149. <script type="javascript" src="../../js/bCommon.js"/>
  150. <script type="javascript" src="../../js/boaMsg.js"/>
  151. </xhtml:head>
  152. <xhtml:body style="font-family:宋体; ">
  153. <select1 id="combo1" ref="/root/formData/TRANS_TYPE" appearance="minimal" style="left:220px; top:10px; width:65px; height:20px; ">
  154. <choices>
  155. <item>
  156. <label>火运</label>
  157. <value>T</value>
  158. </item>
  159. <item>
  160. <label>汽运</label>
  161. <value>C</value>
  162. </item>
  163. </choices>
  164. <script type="javascript" ev:event="xforms-value-changed">
  165. <![CDATA[
  166. //find();
  167. ]]>
  168. </script>
  169. </select1>
  170. <input id="input2" ref="/root/formData/DATE" class="input" inputtype="date" style="left:65px; top:10px; width:90px; height:20px; ">
  171. <script type="javascript" ev:event="xforms-value-changed">
  172. <![CDATA[
  173. // if(model.getValue("/root/formData/fromDate") == null || model.getValue("/root/formData/fromDate") == ""){
  174. // model.setValue("/root/formData/fromDate",model.getValue("/root/formData/toDate"));
  175. // input1.refresh();
  176. // }
  177. ]]>
  178. </script>
  179. </input>
  180. <datagrid id="datagrid1" nodeset="/root/grid1/FAHUO_RESULT_VO/FAHUO_RESULT_Row" caption="选择^计划时间^车牌号^到站^收货单位^客户名称^钢种^产品类型^订单厚度^订单宽度^发货数量^重量^发货计划状态^合同号^计划号^是否出口^产线^实际发货时间^出库指示号^合同性质^装车点^承运单位^是否水运^垛位|选择^计划时间^车牌号^到站^收货单位^客户名称^钢种^产品类型^订单厚度^订单宽度^发货数量^重量^发货计划状态^合同号^计划号^是否出口^产线^实际发货时间^出库指示号^合同性质^装车点^承运单位^是否水运^垛位" colsep="^" colwidth="50, 100, 68, 129, 113, 169, 52, 100, 62, 62, 62, 100, 100, 76, 60, 50, 50, 50, 50, 50, 50, 50, 50, 100" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:0px; top:45px; width:980px; height:355px; ">
  181. <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
  182. <col ref="PLANDATE" format="yyyy-mm-dd"/>
  183. <col ref="TRANS_CAR_NO"/>
  184. <col ref="STATIONCODE"/>
  185. <col ref="INCEPTCORPCODE"/>
  186. <col ref="BUYERCODE"/>
  187. <col ref="SPEC_STL_GRD"/>
  188. <col ref="PRODNM_CD"/>
  189. <col ref="INSTR_COIL_THK"/>
  190. <col ref="INSTR_COIL_WTH"/>
  191. <col ref="CNT"/>
  192. <col ref="ACT_WGT"/>
  193. <col ref="SHIP_PROG_CD"/>
  194. <col editable="false" ref="PACTNO" type="input"/>
  195. <col editable="false" ref="ORDERNO" type="input"/>
  196. <col editable="false" ref="ISOUT" type="input"/>
  197. <col editable="false" ref="PL" type="input"/>
  198. <col editable="false" ref="REALSENDTIME" type="input"/>
  199. <col editable="false" ref="DLIV_DIRNO" type="input"/>
  200. <col editable="false" ref="TRANSTYPE" type="input"/>
  201. <col editable="false" ref="LOADPOSITION" type="input"/>
  202. <col editable="false" ref="MOTORMANNAME" type="input"/>
  203. <col editable="false" ref="BY_SEA_YN" type="input"/>
  204. <col editable="false" ref="CUR_LOAD_LOC" type="input"/>
  205. <script type="javascript" ev:event="ondblclick">
  206. <![CDATA[
  207. if(combo1.value == "T")return;
  208. //双击事件获取具体计划下面的钢卷信息
  209. model.removenode("/root/reqData");
  210. model.makeNode("/root/reqData");
  211. var row = datagrid1.row;
  212. var DLIV_DIRNO = datagrid1.valueMatrix(row , datagrid1.colRef("DLIV_DIRNO"));//位置
  213. // var nodeSet1 = datagrid1.nodeset
  214. // var rw ;
  215. // for(var i=0;i<datagrid1.selectedRows;i++){
  216. // rw = datagrid1.selectedRow(i);
  217. // //把选中行的数字正确的显示
  218. // rw = parseInt(rw-1);
  219. // }
  220. //
  221. // var DLIV_DIRNO = model.getValue(nodeSet1+"["+rw+"]/DLIV_DIRNO");
  222. model.setValue("/root/DLIV_DIRNO",DLIV_DIRNO);
  223. model.duplicate("/root/reqData","/root/DLIV_DIRNO");
  224. commSubmit("UIJ010090-service","DLIV_COIL","glueAction.do");
  225. commAppendData("/root/datagrid1/DLIV_COIL_VO","/root/resData/DLIV_COIL_VO");
  226. model.refresh();
  227. ]]>
  228. </script>
  229. </datagrid>
  230. <caption id="caption1" class="cell" style="left:0px; top:10px; width:65px; height:20px; ">发货日期</caption>
  231. <caption id="caption2" class="cell" style="left:160px; top:10px; width:60px; height:20px; ">发货方式</caption>
  232. <button id="button1" style="left:910px; top:25px; width:70px; height:20px; background-image:../../images/btn_excel.gif; ">
  233. <caption>打印</caption>
  234. <script type="javascript" ev:event="DOMActivate">
  235. <![CDATA[
  236. window.print();
  237. ]]>
  238. </script>
  239. </button>
  240. <datagrid id="datagrid2" nodeset="/root/datagrid1/DLIV_COIL_VO/DLIV_COIL_Row" caption="选择^钢卷号^牌号^成品规格^订单规格^卷重(磅重)^合同号^订单号^垛位^到站^收货单位^合同单位^综合判定等级^发货进程状态^发运指示号^炉号^冶炼时间^轧制时间^钢卷颜色备注^标准^ 产品类型^运输方式" colsep="^" colwidth="100, 100, 90, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 87, 100, 100, 100, 100, 100, 200, 100, 100" frozencols="1" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:400px; width:980px; height:205px; ">
  241. <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
  242. <col ref="OLD_SAMPL_NO" style="text-align:left; "/>
  243. <col ref="SPEC_STL_GRD" style="text-align:left; "/>
  244. <col ref="T_W" style="text-align:right; "/>
  245. <col ref="IT_IW" style="text-align:right; "/>
  246. <col ref="ACT_WGT" style="text-align:right; "/>
  247. <col ref="ORD_NO" style="text-align:left; "/>
  248. <col ref="ORD_SEQ" style="text-align:left; "/>
  249. <col ref="CUR_LOAD_LOC" style="text-align:left; background-color:#ffffff; "/>
  250. <col ref="DEST_PCD_DESC" style="text-align:left; "/>
  251. <col ref="ORD_NM" style="text-align:left; "/>
  252. <col ref="CUST_NM" style="text-align:left; "/>
  253. <col ref="TOT_DEC_GRD" style="text-align:left; "/>
  254. <col ref="CUR_PROG_CD" style="text-align:left; "/>
  255. <col ref="DLIV_DIRNO" style="text-align:left; "/>
  256. <col ref="CHARGE_NO" style="text-align:left; "/>
  257. <col ref="CAS_END_DTIME" style="text-align:left; "/>
  258. <col ref="MILL_DTIME" format="yyyy-mm-dd hh:nn:ss" style="text-align:left; "/>
  259. <col ref="HCOLOUR_REM" style="text-align:left; "/>
  260. <col disabled="false" ref="SPEC_ABBSYM" type="input" style="text-align:left; "/>
  261. <col ref="PRODNM_CD" style="text-align:left; "/>
  262. <col ref="DLIV_TP"/>
  263. </datagrid>
  264. <caption id="caption10" class="cell" style="left:730px; top:25px; width:70px; height:20px; font-weight:bold; background-color:#ffcc00; border-color:#000000; ">重量合计</caption>
  265. <caption id="caption11" style="left:710px; top:26px; width:30px; height:20px; font-weight:bold; ">卷</caption>
  266. <caption id="caption12" style="left:880px; top:25px; width:20px; height:20px; font-weight:bold; ">吨</caption>
  267. <output id="output1" ref="/root/sumData/SUM_COILRST_CNT" style="left:650px; top:25px; width:60px; height:20px; text-align:center; "/>
  268. <caption id="caption9" class="cell" style="left:580px; top:25px; width:70px; height:20px; font-weight:bold; background-color:#ffcc00; border-color:#000000; ">卷数合计</caption>
  269. <output id="output2" ref="/root/sumData/SUM_COILRST_WGT" style="left:800px; top:25px; width:80px; height:20px; text-align:center; "/>
  270. <button id="button2" style="left:515px; top:25px; width:60px; height:20px; background-color:#c0c0c0; ">
  271. <caption>预装车</caption>
  272. <script type="javascript" ev:event="DOMActivate">
  273. <![CDATA[
  274. //双击事件获取具体计划下面的钢卷信息
  275. model.removenode("/root/reqData");
  276. model.makeNode("/root/reqData");
  277. //判断,没有选择的情况不能进行保存
  278. var nodeSet2 = datagrid2.nodeset;
  279. var mark = "N";
  280. var DLIV_TP = null;
  281. for(var i=0;i<datagrid2.rows;i++){
  282. var chk = model.getValue(nodeSet2+"["+i+"]/CHK");
  283. DLIV_TP = model.getValue(nodeSet2+"["+i+"]/DLIV_TP");
  284. if(chk != null && chk == "Y"){
  285. if(DLIV_TP == "T"){
  286. //存在一个没有选择的都不能进行预装车
  287. mark = "Y";
  288. }else{
  289. mark = "C";
  290. }
  291. }
  292. }
  293. if(mark == "Y"){
  294. commMultiUpdate(datagrid2,"/root/reqData","A",true,"rowStatus");
  295. //这里加入登录用户名,会不会与已有的initData冲突
  296. model.makeValue("/root/reqData/REG_ID",model.getValue("/root/initData/rcvInfo/REG_ID"));
  297. commSubmit("UIJ010090-service","YZ","glueAction.do");
  298. commAppendData("/root/datagrid1/DLIV_COIL_VO","/root/resData/DLIV_COIL_VO");
  299. model.refresh();
  300. find();
  301. }else if(mark == "C"){
  302. alert(" 汽车运输的情况不能进行预装操作,请确认后再进行预装车操作! ");
  303. return;
  304. }else{
  305. alert(" 存在整车没有选择的计划,请确认后再进行预装车操作! ");
  306. return;
  307. }
  308. ]]>
  309. </script>
  310. </button>
  311. <object id="ObjTFExcel" clsid="{fe8d1001-6a9d-424d-ae2a-301493bb12da}" style="left:820px; top:0px; width:155px; height:19px; "/>
  312. <caption id="caption14" class="cell" style="left:290px; top:10px; width:55px; height:20px; font-weight:bold; border-color:#000000; ">合同号</caption>
  313. <input id="input1" ref="/root/formData/ORD_NO" maxlength="12" style="left:345px; top:10px; width:100px; height:20px; "/>
  314. <button id="button3" style="left:450px; top:25px; width:60px; height:20px; background-color:#c0c0c0; ">
  315. <caption>导出上</caption>
  316. <script type="javascript" ev:event="DOMActivate">
  317. <![CDATA[
  318. //导出EXCEL方法
  319. saveExcelScript(datagrid1,"Sheet1");
  320. ]]>
  321. </script>
  322. </button>
  323. <button id="button4" style="left:745px; top:0px; width:70px; height:20px; background-image:../../images/btn_excel.gif; ">
  324. <caption>确认</caption>
  325. <script type="javascript" ev:event="DOMActivate">
  326. <![CDATA[
  327. //双击事件获取具体计划下面的钢卷信息
  328. model.removenode("/root/reqData");
  329. model.makeNode("/root/reqData");
  330. for( var i = datagrid1.fixedRows ; i <= nCnt ; i++ ) {
  331. if( datagrid1.valueMatrix(i, datagrid1.colRef("CHK")) == "Y" ) {
  332. //如果行选中,并且钢卷公共表中体现行车命令执行完
  333. //状态改变时间
  334. model.makeValue("/root/reqData/ReqResult_1_Row["+ nRows +"]OLD_SAMPL_NO" , datagrid1.valueMatrix(i, datagrid1.colRef("OLD_SAMPL_NO")) );
  335. nRows++;
  336. }
  337. }
  338. commSubmit("UIJ010091-service","save","glueAction.do");
  339. commAppendData("/root/datagrid1/DLIV_COIL_VO","/root/resData/DLIV_COIL_VO");
  340. model.refresh();
  341. ]]>
  342. </script>
  343. </button>
  344. <button id="button5" visibility="hidden" style="left:430px; top:145px; width:100px; height:20px; ">
  345. <caption>button5</caption>
  346. <script type="javascript" ev:event="onclick">
  347. <![CDATA[
  348. find();
  349. ]]>
  350. </script>
  351. </button>
  352. <button id="button6" visibility="hidden" style="left:485px; top:5px; width:85px; height:20px; ">
  353. <caption>button6</caption>
  354. <script type="javascript" ev:event="onclick">
  355. <![CDATA[
  356. find();
  357. ]]>
  358. </script>
  359. </button>
  360. <button id="button7" visibility="hidden" style="left:625px; top:5px; width:70px; height:20px; ">
  361. <caption>导出EXCEL</caption>
  362. <script type="javascript" ev:event="DOMActivate">
  363. <![CDATA[
  364. //saveExcelScript(datagrid1, "Sheet1");
  365. if(datagrid1.rows<=2){
  366. window.alert("无数据源,请先查询.", "提示");
  367. return;
  368. }
  369. //var jsonMerges="[{'name':'y','x':0,'y':0,'cnt':2},{'name':'x','x':2,'y':0,'cnt':4},{'name':'x','x':6,'y':0,'cnt':4},{'name':'x','x':10,'y':0,'cnt':4},{'name':'x','x':14,'y':0,'cnt':4},{'name':'x','x':18,'y':0,'cnt':4}]";
  370. var jsonMerges="[{'name':'y','x':0,'y':0,'cnt':1}]";
  371. var _cnt = datagrid1.selectedRows;
  372. commonOutExcel('fayun',datagrid1.caption,'/root/grid1/FAHUO_RESULT_VO','UIH090060-service',jsonMerges,'xls');
  373. ]]>
  374. </script>
  375. </button>
  376. </xhtml:body>
  377. </xhtml:html>