contractSaleInvoice.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 calTotalAmount(){
  32. var saleamount = parseFloat($('#saleamount').val())|| 0;
  33. var taxamount = parseFloat($('#taxamount').val())|| 0;
  34. var amount = Math.round((saleamount+taxamount) * 100) / 100;
  35. $('#invoiceamount').val(amount);
  36. }
  37. //选择项目名称,列表================
  38. function openProjectSelect() {
  39. //$.dialog.setting.zIndex = getzIndex();
  40. var orgIds = $("#projectid").val();
  41. /* var orgCode = $("#orgCode").val();*/
  42. $.dialog({
  43. content: 'url:publicpageController.do?projectSelect&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  44. {name: '确定', callback: function (){
  45. var iframe = this.iframe.contentWindow;
  46. if(iframe.getReason().length>0){
  47. var strData=eval(iframe.getReason());
  48. for(var key in strData[0]){
  49. if(key=="strId"){
  50. $("#projectid").val(strData[0][key]);
  51. }else if(key=="strName"){
  52. $("#projectname").val(strData[0][key]);
  53. }
  54. }
  55. $("#projectname").focus();
  56. }
  57. }, focus: true},
  58. {name: '取消', callback: function (){}}
  59. ]}).zindex();
  60. }
  61. function callbackCleanProject(){
  62. $('#projectname').val('');
  63. $('#projectid').val('');
  64. }
  65. //选择客户
  66. function openCustomerSelect() {
  67. //$.dialog.setting.zIndex = getzIndex();
  68. var partnerIds = $("#customerid").val();
  69. /* var orgCode = $("#orgCode").val();*/
  70. $.dialog({
  71. content: 'url:publicpageController.do?customerSelect&ids='+partnerIds, zIndex: getzIndex(), title: '客户列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  72. {name: '确定', callback: function (){
  73. var iframe = this.iframe.contentWindow;
  74. if(iframe.getReason().length>0){
  75. var strData=eval(iframe.getReason());
  76. for(var key in strData[0]){
  77. if(key=="strId"){
  78. $("#customerid").val(strData[0][key]);
  79. }else if(key=="strPartnerName"){
  80. $("#customername").val(strData[0][key]);
  81. }
  82. }
  83. $("#customername").focus();
  84. }
  85. }, focus: true},
  86. {name: '取消', callback: function (){}}
  87. ]}).zindex();
  88. }
  89. function callbackCleanCustomer(){
  90. $('#customername').val('');
  91. $('#customerid').val('');
  92. }
  93. function changeToCHN(event) {
  94. var chn = convertCurrency(event.currentTarget.value);
  95. //event.currentTarget.validform_lastval
  96. var label = document.getElementById("totalamountCHN");
  97. label.innerText = chn;
  98. }
  99. function selectContract(){
  100. var url = 'contractSaleController.do?selectlist';
  101. $.dialog({
  102. title:'选取销售合同',
  103. content: 'url:'+ url,
  104. zIndex: getzIndex(),
  105. lock: true,
  106. width: window.top.document.body.offsetWidth-200 ,
  107. height: window.top.document.body.offsetHeight-200,
  108. cache:false,
  109. button: [
  110. {
  111. name: '确定',
  112. callback: function(){
  113. //获得子页面getReason()方法中的值
  114. var iframe = this.iframe.contentWindow;
  115. if(iframe.getReason().length>0){
  116. var strData=eval(iframe.getReason());
  117. var cID="";
  118. var cname="";
  119. for(var key in strData[0]){
  120. if(key=="id"){
  121. $("#contractid").val(strData[0][key]);
  122. }
  123. if(key=="code"){
  124. $("#contractname").val(strData[0][key]);
  125. }
  126. }
  127. $("#contractname").focus();
  128. }
  129. },
  130. focus: true
  131. },
  132. {
  133. name: '关闭',
  134. callback: function(){}
  135. }
  136. ]
  137. });
  138. }