clothingUser.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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?clothingSelectByUser&userid='+$("#userid").val(), zIndex: getzIndex(), title: '服装列表', lock: true, width: '850px', height: '650px', 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. }else if(key=="strStartdate"){
  51. $("[name='startdate']").val(strData[0][key].substring(0,10));
  52. }else if(key=="strWid"){
  53. $("#warehouseid").val(strData[0][key]);
  54. }else if(key=="strWname"){
  55. $("#warehousename").val(strData[0][key]);
  56. }
  57. }
  58. $("#clothingname").focus();
  59. }
  60. }, focus: true},
  61. {name: '取消', callback: function (){}}
  62. ]}).zindex();
  63. }
  64. function callbackCleanClothing(){
  65. $('#clothingname').val('');
  66. $('#clothingid').val('');
  67. }
  68. function setEditable(){
  69. //移除不可用属性,才能在提交时传到服务器
  70. $("[name='type']").removeAttr("disabled");
  71. $("[name='unit']").removeAttr("disabled");
  72. return true;
  73. }