mode_custract.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. function initbodys(){
  2. $(form('custid')).change(function(){
  3. var val = this.value,txt='';
  4. if(val!=''){
  5. txt = this.options[this.selectedIndex].text;
  6. }
  7. form('custname').value=txt;
  8. if(form('saleid'))form('saleid').value = '';
  9. });
  10. if(form('saleid'))$(form('saleid')).change(function(){
  11. salechange(this.value);
  12. });
  13. if(isinput==1){
  14. if(form('htfileid') && form('htfileid').value==''){
  15. $('#fileview_htfileid').after('<div><a href="javascript:;" onclick="xuanwenj(this)" class="blue">+选择模版文件</a></div>');
  16. }
  17. }
  18. }
  19. function salechange(v){
  20. if(v==''){
  21. form('custid').value='';
  22. form('custname').value='';
  23. return;
  24. }
  25. js.ajax(geturlact('salechange'),{saleid:v},function(a){
  26. form('custid').value=a.custid;
  27. form('custname').value=a.custname;
  28. form('money').value=a.money;
  29. },'get,json');
  30. }
  31. function xuanwenj(o1){
  32. var ne = form('custname').value;
  33. if(!ne){
  34. js.msg('msg','请先选择客户');
  35. return;
  36. }
  37. var bh = form('num').value;
  38. c.xuanfile('htfileid','客户合同',''+ne+'('+bh+')的合同',o1);
  39. }
  40. c.uploadfileibefore=function(sna){
  41. if(sna=='htfileid'){
  42. var val = form(sna).value;
  43. if(val)return '最多只能上传一个文件,其他文件可到相关文件添加';
  44. }
  45. }