2.21-合成费用

合成费用

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/503739/1428577/221-%E5%90%88%E6%88%90%E8%B4%B9%E7%94%A8.js

  1. function 合成费用(src){
  2. console.log('新的合成费用界面')
  3. var local_不干胶式_备注带缺和不带缺=localStorage.getItem('不干胶式_备注带缺和不带缺');
  4. var html=$('iframe[src="'+src+'"]')//页面
  5. html=html.contents().find('body').eq(0)
  6. var toolbar=html.find('.toolbar').eq(0) // 找到了toolbar工具栏
  7. var sample_table=html.find('.ui-jqgrid-btable').eq(0) // 找到了样品的table
  8. //添加toolbar工具栏按钮
  9. 添加toolbar按钮(html)
  10. //添加toolbar工具栏按钮
  11. function 添加toolbar按钮(html){
  12. if (toolbar.find('.weiyiyici').length==0){
  13. //添加标记
  14. toolbar.addClass('weiyiyici')
  15. if(local_不干胶式_备注带缺和不带缺=='true'){
  16. 送货单按钮=toolbar.find('#a_orderToCustmer').eq(0)
  17. //点击送货单按钮
  18. 送货单按钮.click(function(){
  19. 不干胶式_备注带缺和不带缺(html)
  20. })
  21. }
  22. }
  23. }
  24. //不干胶式_备注带缺和不带缺
  25. function 不干胶式_备注带缺和不带缺(html){
  26. //弹框加个按钮
  27. $('#uiform').find('#print_synBDT').parent().append('<button id="button_buganjiaoshi_bubaohan_que" onclick="return false">不干胶式_备注不包含缺</button>')
  28. $('#uiform').find('#print_synBDT').parent().append('<button id="button_buganjiaoshi_baohan_que" onclick="return false">不干胶式_备注包含缺</button>')
  29. //点击不干胶式_备注不包含缺按钮
  30. $('#uiform').find('#button_buganjiaoshi_bubaohan_que').click(function(){
  31. 不干胶式_备注包不包含缺_详细代码(html,'不包含缺')
  32. })
  33. //点击不干胶式_备注包含缺按钮
  34. $('#uiform').find('#button_buganjiaoshi_baohan_que').click(function(){
  35. 不干胶式_备注包不包含缺_详细代码(html,'包含缺')
  36. })
  37. }
  38. function 不干胶式_备注包不包含缺_详细代码(html,tag){
  39. selecteds=sample_table.find('tbody').find("[aria-selected='true']")
  40. dingdanhao_arr_str=''
  41. selecteds.each(function(){
  42. dingdanhao=$(this).find('[aria-describedby=list_syno_id]').text() //订单号
  43. beizhu=$(this).find('[aria-describedby=list_syno_remark]').text() //备注
  44. if (tag == '不包含缺'){
  45. //如果备注没有找到缺
  46. if (beizhu.indexOf('缺')==-1){
  47. dingdanhao_arr_str=dingdanhao_arr_str+dingdanhao+','
  48. }
  49. }
  50. if (tag == '包含缺'){
  51. //如果备注找到缺
  52. if (beizhu.indexOf('缺')!==-1){
  53. dingdanhao_arr_str=dingdanhao_arr_str+dingdanhao+','
  54. }
  55. }
  56. })
  57. console.log(dingdanhao_arr_str)
  58. $.ajaxSettings.async = false; //get请求默认是异步的,在这里改为同步
  59. $.get('/syn/xmldata/xmlSynStoreOut.aspx?order='+dingdanhao_arr_str+'&style=buganjiao',function(data){
  60. console.log(data)
  61. if(tag == '不包含缺'){
  62. 保存文本到本地(data,'down.html','http://localhost/buganjiaoBiaoqian/print_bubaohanque.html')
  63. }
  64. if(tag == '包含缺'){
  65. //把缺全部改成补
  66. data=str_replaceAll(data,'缺','补')
  67. 保存文本到本地(data,'down.html','http://localhost/buganjiaoBiaoqian/print_baohanque.html')
  68. }
  69. // 客户名_arr=文本_取中间文本_批量(data,'"cust_name":"','","')
  70. });
  71. }
  72. //保存文本到本地
  73. function 保存文本到本地(text, filename,bendi_url){
  74. // 创建一个Blob实例,类型为纯文本
  75. var blob = new Blob([text], { type: 'text/plain' });
  76. // 创建一个指向Blob对象的URL
  77. var url = URL.createObjectURL(blob);
  78. // 创建一个a标签
  79. var a = document.createElement("a");
  80. // 设置a标签属性
  81. a.href = url;
  82. a.download =filename;
  83. // 模拟a标签点击,触发下载
  84. document.body.appendChild(a);
  85. a.click();
  86. // 清理临时DOM和对象URL
  87. document.body.removeChild(a);
  88. URL.revokeObjectURL(url);
  89. window.open(bendi_url)
  90. }
  91. //字符串全部替换部分文本
  92. function str_replaceAll(str, yuanwenben, xianwenben) {
  93. return str.replace(new RegExp(yuanwenben, 'g'), xianwenben);
  94. }
  95. }
  96.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址