Index: ssts-web/src/main/webapp/disinfectsystem/borrowRecord/borrowRecordView.jsp
===================================================================
diff -u -r13904 -r14326
--- ssts-web/src/main/webapp/disinfectsystem/borrowRecord/borrowRecordView.jsp (.../borrowRecordView.jsp) (revision 13904)
+++ ssts-web/src/main/webapp/disinfectsystem/borrowRecord/borrowRecordView.jsp (.../borrowRecordView.jsp) (revision 14326)
@@ -43,6 +43,7 @@
SSTS_ReturnedItem_Delete = false;
+
@@ -56,6 +57,10 @@
+
+
+
+
借还管理
Index: ssts-web/src/main/webapp/disinfectsystem/print/print.js
===================================================================
diff -u -r14054 -r14326
--- ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 14054)
+++ ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 14326)
@@ -1582,6 +1582,20 @@
LODOP.PREVIEW();
}
}
+
+//借物单打印
+function printBorrowRecord(obj,printType) {
+ formTypeOfPrinted = obj.formTypeOfPrinted;
+ setGoodsInfos(obj);
+ print2(obj);
+ if(printType == 0){//直接打印
+ LODOP.PRINT();
+ }else{//打印预览
+ LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD",1);
+ LODOP.PREVIEW();
+ }
+}
+
function createInvoiceInfo2(invoiceObj) {
LODOP = getLodop(document.getElementById('LODOP'), document
.getElementById('LODOP_EM'));
Index: ssts-web/src/main/webapp/disinfectsystem/borrowRecord/borrowRecordView.js
===================================================================
diff -u -r13925 -r14326
--- ssts-web/src/main/webapp/disinfectsystem/borrowRecord/borrowRecordView.js (.../borrowRecordView.js) (revision 13925)
+++ ssts-web/src/main/webapp/disinfectsystem/borrowRecord/borrowRecordView.js (.../borrowRecordView.js) (revision 14326)
@@ -492,16 +492,8 @@
params : {id : id},
waitMsg : '正在加载数据,请稍候',
success : function(form, action) {
- if(action.result.data.lendingTime != null){
- top.Ext.getCmp('lendingTime').setValue(Ext.util.Format.date(
- new Date(action.result.data.lendingTime.time),
- "Y-m-d H:i"));
- }
- if(action.result.data.receivingTime != null){
- top.Ext.getCmp('receivingTime').setValue(Ext.util.Format.date(
- new Date(action.result.data.receivingTime.time),
- "Y-m-d H:i"));
- }
+ top.Ext.getCmp('lendingTime').setValue(dateTimeFormat(action.result.data.lendingTime));
+ top.Ext.getCmp('receivingTime').setValue(dateTimeFormat(action.result.data.receivingTime));
var items = action.result.data.items;
var lendTousseItems = action.result.data.lendItems;
var returnedTousseItems = action.result.data.returnedItems;
@@ -695,6 +687,55 @@
return "" + v + "
";
}
+function getSelectedIds(){
+ var records = grid.getSelectionModel().getSelections();
+ if (records.length == 0) {
+ showResult("请选择要打印的单!");
+ return false;
+ }
+ var ids = [];
+ for ( var i = 0, len = records.length; i < len; i++) {
+ ids.push(records[i].data['id']);
+ }
+ return ids;
+}
+function dateTimeFormat(date){
+ if(date == null){
+ return "";
+ }
+ return Ext.util.Format.date(new Date(date.time),"Y-m-d H:i");
+}
+function printBorrowRecordLocal(printType,borrowRecordid){
+ if(borrowRecordid == null)
+ return;
+ top.Ext.MessageBox.show({
+ title:'请等待',
+ msg:'打印中……',
+ width:350,
+ progress:true,
+ closable:false
+ });
+ Ext.Ajax.timeout=300*000;
+ Ext.Ajax.request({
+ timeout: 300*000,
+ url : WWWROOT + '/disinfectSystem/borrowRecordAction!loadPrintData.do',
+ params : {id : borrowRecordid},
+ success : function(response){
+ var result = Ext.decode(response.responseText);
+ result.goods=result.items;
+ result.formTypeOfPrinted = 'borrowRecord';
+ result.lendingTime=dateTimeFormat(result.lendingTime);
+ result.receivingTime=dateTimeFormat(result.receivingTime);
+ printBorrowRecord(result, printType);
+ hideMessageBox(true);
+ },
+ failure: function(response){
+ showResult("打印失败!");
+ hideMessageBox(true);
+ }
+ });
+}
+
Ext.onReady(function() {
Ext.QuickTips.init();
var columns = [
@@ -755,6 +796,22 @@
handler : function() {
deleteBorrowRecord(grid);
}
+ },'-',{
+ text : '打印',
+ iconCls : 'icon_print',
+ handler : function() {
+ var ids = getSelectedIds();
+ if (ids && ids.length > 0){
+ top.Ext.MessageBox.confirm("请确认", "要打印所选的单吗?",
+ function(btn) {
+ if (btn == 'yes') {
+ for (var i=0;i map = new HashMap();
map.put("success", true);
map.put("data", borrowRecord);
JsonConfig config = new JsonConfig();
config.setExcludes(TousseInstance.filterProperties);
config.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONObject jsonObject = JSONObject.fromObject(map, config);
- String jsonStr = jsonObject.toString();
- try {
- StrutsParamUtils.getResponse().getWriter().print(jsonStr);
- } catch (IOException e) {
- e.printStackTrace();
- }
+ StrutsResponseUtils.output(jsonObject);
}
public String deleteBorrowRecord() {
@@ -263,11 +253,19 @@
e.printStackTrace();
}
}
+
+ public void loadPrintData(){
+ JsonConfig config = new JsonConfig();
+ config.setExcludes(TousseInstance.filterProperties);
+ config.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
+ JSONObject jsonObject = JSONObject.fromObject(borrowRecord, config);
+ StrutsResponseUtils.output(jsonObject);
+ }
public void prepare() throws Exception {
try {
String id = StrutsParamUtils.getPraramValue("id", "");
- if (StringUtils.isNotBlank(id) && !"0".equals(id)) {
+ if (DatabaseUtil.isPoIdValid(id)) {
borrowRecord = borrowRecordManager.getById(id);
} else {
borrowRecord = new BorrowRecord();