Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/diposableGoodsSummary/diposableGoodsSummaryView.js
===================================================================
diff -u -r35826 -r35827
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/diposableGoodsSummary/diposableGoodsSummaryView.js (.../diposableGoodsSummaryView.js) (revision 35826)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/diposableGoodsSummary/diposableGoodsSummaryView.js (.../diposableGoodsSummaryView.js) (revision 35827)
@@ -17,13 +17,11 @@
params: { ids: ids.join(';') },
success: function (response, options) {
var result = Ext4.JSON.decode(response.responseText);
- var success = result.success;
- if (true != success) {
- showResult(result.message);
- return;
- } else {
+ if (result.success) {
showResult('删除成功!');
listStore.load();
+ } else {
+ showResult(result.message);
}
},
failure: function (response, options) {
@@ -36,12 +34,49 @@
}
}
+function moveUpOrDown(id, type) {
+ var orderType = 'up';
+ if (type == 1) {
+ orderType = 'down';
+ }
+ Ext4.Ajax.request({
+ url: WWWROOT + '/disinfectSystem/diposableGoodsSummaryAction!sortDisposableGoodsSummary.do',
+ params: {
+ id: id,
+ orderType: orderType
+ },
+ success: function (response, options) {
+ var result = Ext4.JSON.decode(response.responseText);
+ if (result.success) {
+ showResult('排序成功!');
+ listStore.load();
+ } else {
+ showResult(result.message);
+ }
+ },
+ failure: function (response, options) {
+ var result = Ext4.JSON.decode(response.responseText);
+ showResult(result.message);
+ }
+ });
+}
+
+function moveUpDown(v, p, record) {
+ var id = record.data.id;
+ var html = '';
+ html += '
';
+ html += '';
+ html += '
';
+ return html;
+}
+
Ext4.onReady(function () {
Ext4.QuickTips.init();
var columns = [
{ header: "id", dataIndex: 'id', hidden: true },
{ header: "一次性物品名称", dataIndex: 'name', width: 200 },
- { header: "规格", dataIndex: 'specification', width: 200 }
+ { header: "规格", dataIndex: 'specification', width: 200 },
+ { header: "排序操作", dataIndex: 'orderNum', renderer: moveUpDown, width: 80 },
];
var tbar = [{
text: '添加',
@@ -63,7 +98,7 @@
url: WWWROOT + '/disinfectSystem/diposableGoodsSummaryAction!loadDisposableGoodsSummaryList.do',
reader: {
root: 'data',
- totalProperty:'totalCount'
+ totalProperty: 'totalCount'
},
extraParams: {}
},