clothingOnhand.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //通用弹出式文件上传
  2. function commonUpload(callback){
  3. $.dialog({
  4. content: "url:systemController.do?commonUpload",
  5. lock : true,
  6. title:"文件上传",
  7. zIndex:2100,
  8. width:700,
  9. height: 200,
  10. parent:windowapi,
  11. cache:false,
  12. ok: function(){
  13. var iframe = this.iframe.contentWindow;
  14. iframe.uploadCallback(callback);
  15. return true;
  16. },
  17. cancelVal: '关闭',
  18. cancel: function(){
  19. }
  20. });
  21. }
  22. function browseImages(inputId, Img) {// 图片管理器,可多个上传共用
  23. }
  24. function browseFiles(inputId, file) {// 文件管理器,可多个上传共用
  25. }
  26. function decode(value, id) {//value传入值,id接受值
  27. var last = value.lastIndexOf("/");
  28. var filename = value.substring(last + 1, value.length);
  29. $("#" + id).text(decodeURIComponent(filename));
  30. }
  31. function openClothingSelect() {
  32. //$.dialog.setting.zIndex = getzIndex();
  33. var clothingidIds = $("#clothingid").val();
  34. /* var orgCode = $("#orgCode").val();*/
  35. $.dialog({
  36. content: 'url:publicpageController.do?clothingSelectAll&ids='+clothingidIds, zIndex: getzIndex(), title: '服装列表', lock: true, width: '600px', height: '550px', opacity: 0.4, button: [
  37. {name: '确定', callback: function (){
  38. var iframe = this.iframe.contentWindow;
  39. if(iframe.getReason().length>0){
  40. var strData=eval(iframe.getReason());
  41. for(var key in strData[0]){
  42. if(key=="strId"){
  43. $("#clothingid").val(strData[0][key]);
  44. }else if(key=="strName"){
  45. $("#clothingname").val(strData[0][key]);
  46. }else if(key=="strType"){
  47. $("[name='type']").val(strData[0][key]);
  48. }else if(key=="strUnit"){
  49. $("[name='unit']").val(strData[0][key]);
  50. }
  51. }
  52. $("#clothingname").focus();
  53. }
  54. }, focus: true},
  55. {name: '取消', callback: function (){}}
  56. ]}).zindex();
  57. }
  58. function callbackCleanClothing(){
  59. $('#clothingname').val('');
  60. $('#clothingid').val('');
  61. }
  62. function setEditable(){
  63. //移除不可用属性,才能在提交时传到服务器
  64. $("[name='type']").removeAttr("disabled");
  65. $("[name='unit']").removeAttr("disabled");
  66. return true;
  67. }
  68. function openWarehouseSelect() {
  69. //$.dialog.setting.zIndex = getzIndex();
  70. var warehouseidIds = $("#warehouseid").val();
  71. /* var orgCode = $("#orgCode").val();*/
  72. $.dialog({
  73. content: 'url:publicpageController.do?warehouseSelect&ids='+warehouseidIds, zIndex: getzIndex(), title: '领料点列表', lock: true, width: '850px', height: '650px', opacity: 0.4, button: [
  74. {name: '确定', callback: function (){
  75. var iframe = this.iframe.contentWindow;
  76. if(iframe.getReason().length>0){
  77. var strData=eval(iframe.getReason());
  78. for(var key in strData[0]){
  79. if(key=="strId"){
  80. $("#warehouseid").val(strData[0][key]);
  81. }else if(key=="strName"){
  82. $("#warehousename").val(strData[0][key]);
  83. }
  84. }
  85. $("#warehousename").focus();
  86. }
  87. }, focus: true},
  88. {name: '取消', callback: function (){}}
  89. ]}).zindex();
  90. }
  91. function callbackCleanWarehouse(){
  92. $('#warehousename').val('');
  93. $('#warehouseid').val('');
  94. }