contractSaleInvoiceList.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  4. <div class="easyui-layout" fit="true">
  5. <input id="documentTitle" type="hidden" name="documentTitle" value="blank"/>
  6. <input id="fileUrl" type="hidden"/>
  7. <input id="fileName" type="hidden"/>
  8. <div region="center" style="padding:0px;border:0px">
  9. <t:datagrid name="contractSaleInvoiceList" checkbox="false" pageSize="20" sortName="createDate" sortOrder="desc" pagination="true" fitColumns="true" title="销售开票" actionUrl="contractSaleInvoiceController.do?datagrid" idField="id" fit="true" queryMode="group">
  10. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  11. <t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol>
  12. <t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol>
  13. <t:dgCol title="创建日期" field="createDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single" width="120"></t:dgCol>
  14. <t:dgCol title="更新人名称" field="updateName" hidden="true" queryMode="single" width="120"></t:dgCol>
  15. <t:dgCol title="更新人登录名称" field="updateBy" hidden="true" queryMode="single" width="120"></t:dgCol>
  16. <t:dgCol title="更新日期" field="updateDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single" width="120"></t:dgCol>
  17. <t:dgCol title="所属部门" field="sysOrgCode" hidden="true" queryMode="single" width="120"></t:dgCol>
  18. <t:dgCol title="所属公司" field="sysCompanyCode" hidden="true" queryMode="single" width="120"></t:dgCol>
  19. <t:dgCol title="流程实例" field="procInstId" hidden="true" queryMode="single" width="120"></t:dgCol>
  20. <t:dgCol title="流程当前阶段" field="stepName" hidden="true" queryMode="single" width="120"></t:dgCol>
  21. <t:dgCol title="合同" field="contractid" hidden="true" queryMode="single" width="120"></t:dgCol>
  22. <t:dgCol title="合同名" field="contractname" queryMode="single" width="120"></t:dgCol>
  23. <t:dgCol title="开票金额" field="invoiceamount" formatterjs="formatterNum" queryMode="single" align="right" width="80"></t:dgCol>
  24. <t:dgCol title="开票日期" field="invoicedate" formatter="yyyy-MM-dd" align="center" queryMode="group" width="80"></t:dgCol>
  25. <t:dgCol title="收款金额" field="incomeamount" formatterjs="formatterNum" align="right" queryMode="single" width="80"></t:dgCol>
  26. <t:dgCol title="最新收款日期" field="incomedate" align="center" formatter="yyyy-MM-dd" queryMode="single" width="80"></t:dgCol>
  27. <t:dgCol title="开票操作人" field="invoiceopt" hidden="true" queryMode="single" width="120"></t:dgCol>
  28. <t:dgCol title="开票操作人" field="invoiceoptname" hidden="true" queryMode="single" width="120"></t:dgCol>
  29. <t:dgCol title="收款操作人" field="incomeopt" hidden="true" queryMode="single" width="120"></t:dgCol>
  30. <t:dgCol title="收款操作人" field="incomeoptname" hidden="true" queryMode="single" width="120"></t:dgCol>
  31. <t:dgCol title="开票抬头" field="customername" queryMode="single" width="120"></t:dgCol>
  32. <t:dgCol title="项目" field="projectid" hidden="true" queryMode="single" width="180"></t:dgCol>
  33. <t:dgCol title="项目名" field="projectname" queryMode="single" width="120"></t:dgCol>
  34. <t:dgCol title="客户名" field="customerid" hidden="true" queryMode="single" width="120"></t:dgCol>
  35. <t:dgCol title="流程状态" field="bpmStatus" hidden="true" queryMode="single" dictionary="bpm_status" width="120"></t:dgCol>
  36. <t:dgCol title="业务状态" field="busstatus" queryMode="single" dictionary="contractstatus" align="center" width="80"></t:dgCol>
  37. <t:dgCol title="操作" field="opt"></t:dgCol>
  38. <t:dgDelOpt exp="contractid#empty#true" title="删除" url="contractSaleInvoiceController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>
  39. <t:dgFunOpt exp="busstatus#eq#21&&contractid#empty#false" title="收款" funname="doIncome(id)" urlclass="ace_button" urlfont="fa-rmb"/>
  40. <t:dgFunOpt exp="incomedate#empty#true&&contractid#empty#false&&busstatus#ne#23" title="作废发票" funname="doCancel(id)" urlclass="ace_button" urlStyle="background-color:#FF6347" urlfont="fa-bitbucket"/>
  41. <t:dgOpenOpt exp="incomedate#empty#false&&contractid#empty#false" title="收款明细" url="contractSaleIncomeController.do?list&invoiceid={id}" urlclass="ace_button" urlfont="fa-trash-o" width="400" height="300"/>
  42. <t:dgFunOpt exp="incomedate#empty#false" title="取消收款" funname="doCancelIncome(id)" urlclass="ace_button" urlStyle="background-color:#FF6347" urlfont="fa-trash-o"/>
  43. <t:dgToolBar title="选取合同开票" icon="icon-add" operationCode="add" url="contractSaleController.do?selectlist" funname="selectContract"></t:dgToolBar>
  44. <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit" url="contractSaleInvoiceController.do?goUpdate" funname="update" height="100%" width="1000"></t:dgToolBar>
  45. <t:dgToolBar title="查看" icon="icon-search" url="contractSaleInvoiceController.do?goUpdate" funname="detail" height="100%" width="1000"></t:dgToolBar>
  46. <t:dgToolBar title="导入发票信息" icon="icon-put" operationCode="put" funname="commonUpload"></t:dgToolBar>
  47. <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar>
  48. </t:datagrid>
  49. </div>
  50. </div>
  51. <script src = "webpage/cn/com/lzt/contractsaleinvoice/contractSaleInvoiceList.js"></script>
  52. <script src = "webpage/cn/com/lzt/contractsale/contractSaleList.js"></script>
  53. <script type="text/javascript" src="plug-in/tools/money.js"></script>
  54. <script>
  55. $(function() {
  56. var datagrid = $("#contractSaleInvoiceListtb");
  57. datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
  58. $("#pinjie1").html('');
  59. datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
  60. $("#pinjiechaxun1").html('');
  61. });
  62. </script>
  63. <div id="pinjie1">
  64. <div name="pinjie2" style="padding:3px; height: auto" class="datagrid-toolbar">
  65. <div name="searchColums" style="margin:23px 0 18px 0;margin-top: 15px;margin-bottom: 8px;">
  66. <%-- <input type="hidden" id="orgCode" name="orgCode" value="${orgCode}"> --%>
  67. <table style="padding:0px" cellpadding="0" cellspacing="1" >
  68. <tbody>
  69. <tr>
  70. <td align="right" style="width: 74px;">
  71. <label class="Validform_label">
  72. 项目:
  73. </label>
  74. </td>
  75. <td class="value" colspan="3">
  76. <input readonly="true" type="text" id="projectname" name=""projectname"" style="width: 157px" placeholder="请选择项目名称" onclick="openProjectSelect()">
  77. <input id="projectid" name="projectid" type="hidden" value="">
  78. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openProjectSelect()">选择</a>
  79. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackCleanProject()">清空</a>
  80. </td>
  81. <td align="right" style="width: 74px;">
  82. <label class="Validform_label">
  83. 客户:
  84. </label>
  85. </td>
  86. <td class="value" colspan="3">
  87. <input readonly="true" type="text" id="customername" name="customername" style="width: 157px" placeholder="请选择客户" onclick="openCustomerSelect()">
  88. <input id="customerid" name="customerid" type="hidden" value="">
  89. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="customerSearch" onclick="openCustomerSelect()">选择</a>
  90. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="customerRedo" onclick="callbackCleanCustomer()">清空</a>
  91. </td>
  92. <td align="right" style="width: 74px;">
  93. <label class="Validform_label">
  94. 开票金额:
  95. </label>
  96. </td>
  97. <td class="value" colspan="3">
  98. <input id="invoiceamount" name="invoiceamount" type="text" style="width: 157px" class="inputxt" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/"
  99. onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" ignore="checked" placeholder="请输入金额"/>
  100. <span class="Validform_checktip"></span>
  101. <label class="Validform_label" style="display: none;">销售额(价税合计)</label>
  102. </td>
  103. </tr>
  104. <!-- <tr height="50px">
  105. <td align="right" style="width: 74px;">
  106. <label class="Validform_label">
  107. 合同号:
  108. </label>
  109. </td>
  110. <td class="value">
  111. <input id="code" name="code" type="text" style="width: 157px; " class="inputxt" placeholder="合同编码">
  112. </td>
  113. <td align="right" style="width: 74px;">
  114. <label class="Validform_label">
  115. 合同名称:
  116. </label>
  117. </td>
  118. <td class="value">
  119. <input id="name" name="name" type="text" style="width: 157px; " class="inputxt" placeholder="合同名称">
  120. </td>
  121. <td align="right" style="width: 74px;">
  122. <label class="Validform_label">
  123. 合同描述:
  124. </label>
  125. </td>
  126. <td class="value">
  127. <input id="description" name="description" type="text" style="width: 157px; " class="inputxt" placeholder="合同描述">
  128. </td>
  129. <td>
  130. <span style="display:-moz-inline-box;display:inline-block;">
  131. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; "
  132. title="起始日期">合同生效日期:</span><input type="text" name="startdate_begin" style="width: 94px" class="Wdate" onclick="WdatePicker()">
  133. <span style="display:-moz-inline-box;display:inline-block;width: 8px !important;text-align:right;">~
  134. </span><input type="text" name="startdate_end" style="width: 94px" class="Wdate" onclick="WdatePicker()"></span>
  135. </td>
  136. </tr>-->
  137. </tbody>
  138. </table>
  139. </div>
  140. </div>
  141. </div>
  142. <div id="pinjiechaxun1">
  143. <div name="pinjiechaxun2" style="padding:3px; height: auto" class="datagrid-toolbar">
  144. <span style="float:right;margin-bottom:4px;">
  145. <span>
  146. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="contractSaleInvoiceListSearch" onclick="contractSaleInvoiceListsearch()">查询</a>
  147. </span>
  148. <span>
  149. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-reload " id="contractSaleInvoiceListRedo" onclick="searchReset('contractSaleInvoiceList')">重置</a>
  150. </span>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <script type="text/javascript">
  156. $(document).ready(function(){
  157. });
  158. //导入
  159. function ImportXls() {
  160. openuploadwin('Excel导入', 'contractSaleInvoiceController.do?upload', "contractSaleInvoiceList");
  161. }
  162. //导出
  163. function ExportXls() {
  164. JeecgExcelExport("contractSaleInvoiceController.do?exportXls","contractSaleInvoiceList");
  165. }
  166. //模板下载
  167. function ExportXlsByT() {
  168. JeecgExcelExport("contractSaleInvoiceController.do?exportXlsByT","contractSaleInvoiceList");
  169. }
  170. function selectContract(){
  171. var url = 'contractSaleController.do?selectlist';
  172. $.dialog({
  173. title:'选取销售合同',
  174. content: 'url:'+ url,
  175. zIndex: getzIndex(),
  176. lock: true,
  177. width: window.top.document.body.offsetWidth-200 ,
  178. height: window.top.document.body.offsetHeight-200,
  179. cache:false,
  180. button: [
  181. {
  182. name: '<t:mutiLang langKey="common.confirm"/>',
  183. callback: function(){
  184. //获得子页面getReason()方法中的值
  185. var iframe = this.iframe.contentWindow;
  186. if(iframe.getReason().length>0){
  187. var strData=eval(iframe.getReason());
  188. var cID="";
  189. for(var key in strData[0]){
  190. if(key=="id"){
  191. cID=strData[0][key];
  192. }
  193. }
  194. if(cID.length > 0)
  195. {
  196. addByContractID(cID);
  197. }
  198. }
  199. },
  200. focus: true
  201. },
  202. {
  203. name: '<t:mutiLang langKey="common.cancel"/>',
  204. callback: function(){
  205. refresh();
  206. }
  207. }
  208. ]
  209. });
  210. }
  211. function addByContractID(cid)
  212. {
  213. var width = window.top.document.body.offsetWidth-400 ;
  214. var height= window.top.document.body.offsetHeight-200;
  215. add('销售开票','contractSaleInvoiceController.do?goAdd&contractid='+cid,'contractSaleInvoiceList',width,height)
  216. }
  217. //修改
  218. function update(title,url, id,width,height){
  219. gridname=id;
  220. var rowsData = $('#'+id).datagrid('getSelections');
  221. url +="&id="+rowsData[0].id;
  222. if(rowsData[0].busstatus != null && rowsData[0].busstatus =='21'){
  223. createwindow("开票申请修改",url, width,height);
  224. }else{
  225. $.messager.alert('提示信息',"已支付或作废的发票不能进行修改");
  226. return;
  227. }
  228. }
  229. function doIncome(id) {
  230. /* var url = "contractSaleInvoiceController.do?doIncome&id="+id;
  231. $.dialog.setting.zIndex = getzIndex(true);
  232. $.dialog.confirm('确定已收款吗', function(){
  233. doAction(url);
  234. }, function(){
  235. }); */
  236. var url="contractSaleIncomeController.do?goAdd&invoiceid="+id;
  237. createwindow("销售收款", url,"500px","200px");
  238. }
  239. function doCancelIncome(id){
  240. var url="contractSaleIncomeController.do?doDel&invoiceid="+id;
  241. $.dialog.setting.zIndex = getzIndex(true);
  242. $.dialog.confirm('确定取消收款吗', function(){
  243. doAction(url);
  244. }, function(){
  245. });
  246. }
  247. function doCancel(id) {
  248. var url = "contractSaleInvoiceController.do?doCancel&id="+id;
  249. $.dialog.setting.zIndex = getzIndex(true);
  250. $.dialog.confirm('确定作废发票吗', function(){
  251. doAction(url);
  252. }, function(){
  253. });
  254. }
  255. /**
  256. * 执行
  257. *
  258. * @param url
  259. * @param index
  260. */
  261. function doAction(url) {
  262. $.ajax({
  263. async : false,
  264. cache : false,
  265. type : 'POST',
  266. url : url,// 请求的action路径
  267. error : function() {// 请求失败处理函数
  268. },
  269. success : function(data) {
  270. var d = data; // ------ $.parseJSON(data);
  271. if (d.success) {
  272. var msg = d.msg;
  273. tip(msg);
  274. reloadTable();
  275. }
  276. else{
  277. var msg = d.msg;
  278. tip(msg);
  279. }
  280. }
  281. });
  282. }
  283. function xmlupload(){
  284. $.dialog({
  285. content: 'url:publicpageController.do?fileUploader&busiId=111&busiTable=t_b_contract_sale_invoice&extensions=xml&bizType=contractsaleinvoice', zIndex: getzIndex(), title: '上传发票xml文件', lock: true, width: '800px', height: '600px', opacity: 0.4, button: [
  286. {name: '<t:mutiLang langKey="common.close"/>', callback: function (){}}
  287. ]}).zindex();
  288. }
  289. </script>
  290. <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  291. <script type="text/javascript" src="plug-in/tools/Map.js"></script>
  292. <script type="text/javascript">
  293. var flag = false;
  294. var fileitem = "";
  295. var fileKey = "";
  296. var serverMsg = "";
  297. var uploadsuccessflag = false;
  298. var m = new Map();
  299. $(function() {
  300. $('#instruction')
  301. .uploadify(
  302. {
  303. buttonText : '导入发票xml文件',
  304. auto : true,
  305. progressData : 'speed',
  306. multi : false,
  307. height : 25,
  308. overrideEvents : [ 'onDialogClose' ],
  309. fileTypeDesc : '文件格式:',
  310. queueID : 'instructionfile',
  311. fileTypeExts : 'xml',
  312. fileSizeLimit : '1MB',
  313. swf : 'plug-in/uploadify/uploadify.swf',
  314. uploader : 'contractSaleInvoiceController.do?importExcel',//'cgUploadController.do?ajaxSaveFile',
  315. onUploadStart : function(file) {
  316. var documentTitle = $('#documentTitle').val();
  317. $('#instruction').uploadify("settings",
  318. "formData", {
  319. 'documentTitle' : documentTitle
  320. });
  321. },
  322. onQueueComplete : function(queueData) {
  323. },
  324. onUploadSuccess : function(file, data, response) {
  325. var d = data; // ------ $.parseJSON(data);
  326. uploadSuccess(d, file, response);
  327. uploadsuccessflag = d.success;
  328. serverMsg = d.msg;
  329. if (d.success) {
  330. var win = frameElement.api.opener;
  331. }
  332. },
  333. onFallback : function() {
  334. tip("您未安装FLASH控件,无法上传图片!请安装FLASH控件后再试")
  335. },
  336. onSelectError : function(file, errorCode, errorMsg) {
  337. switch (errorCode) {
  338. case -100:
  339. tip("上传的文件数量已经超出系统限制的"
  340. + $('#instruction').uploadify(
  341. 'settings',
  342. 'queueSizeLimit') + "个文件!");
  343. break;
  344. case -110:
  345. tip("文件 ["
  346. + file.name
  347. + "] 大小超出系统限制的"
  348. + $('#instruction')
  349. .uploadify('settings',
  350. 'fileSizeLimit')
  351. + "大小!");
  352. break;
  353. case -120:
  354. tip("文件 [" + file.name + "] 大小异常!");
  355. break;
  356. case -130:
  357. tip("文件 [" + file.name + "] 类型不正确!");
  358. break;
  359. }
  360. },
  361. onUploadProgress : function(file, bytesUploaded,
  362. bytesTotal, totalBytesUploaded,
  363. totalBytesTotal) {
  364. }
  365. });
  366. });
  367. function upload() {
  368. $('#instruction').uploadify('upload', '*');
  369. return flag;
  370. }
  371. function cancel() {
  372. $('#instruction').uploadify('cancel', '*');
  373. }
  374. function uploadSuccess(d,file,response){
  375. $("#fileUrl").val(d.attributes.url);
  376. $("#fileName").val(d.attributes.name);
  377. var url = $("#fileUrl").val();
  378. var html="";
  379. if(url.indexOf(".gif")!=-1 ||
  380. url.indexOf(".jpg")!=-1 ||
  381. url.indexOf(".png")!=-1 ||
  382. url.indexOf(".bmp")!=-1){
  383. html += "<img src='"+url+"' width =400 height=300 />";
  384. }else{
  385. html += "<a href='"+url+"' target=_blank >下载:"+d.attributes.name+"</a>";
  386. }
  387. $("#fileShow").html(html);
  388. }
  389. function uploadCallback(callback,inputId){
  390. var url = $("#fileUrl").val();
  391. var name= $("#fileName").val();
  392. callback(url,name,inputId);
  393. }
  394. </script>
  395. <span id="instructionspan"><input type="file" name="instruction"
  396. id="instruction" /></span>
  397. <!-- update--end--author:zhangjiaqiang date:20170601 for:切换上传资源的保存路径 -->