Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionForm.js
===================================================================
diff -u -r32456 -r32471
--- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionForm.js (.../proxyDisinfectionForm.js) (revision 32456)
+++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionForm.js (.../proxyDisinfectionForm.js) (revision 32471)
@@ -69,6 +69,10 @@
id: 'pakingRecordIDs'
}, {
xtype: 'hidden',
+ name: 'receiveToussesIDs',
+ id: 'receiveToussesIDs'
+ }, {
+ xtype: 'hidden',
name: 'currentDepartCoding',
id: 'currentDepartCoding',
value: currentDepartCoding
@@ -223,11 +227,17 @@
{
header: '名称', dataIndex: 'name', width: 230, renderer: function (v, p, record) {
if (sstsConfig.generateProxySterilizationFormFunctionInHistoricalAssemblyRecords) {
- if (record.checkStatus == '待核对') {
+ if (record.hasReceived == '否') {
+ if (record.receiveTousse == true) {
+ return '
' + v + '
';
+ }
return '' + v + '
';
- } if (record.checkStatus == '已核对') {
+ } else if (record.hasReceived == '是') {
return '' + v + '
';
} else {
+ if (record.receiveTousse == true) {
+ return '' + v + '
';
+ }
return '' + v + '';
}
} else {
@@ -242,7 +252,7 @@
header: "操作", dataIndex: 'operation', hidden: !editMode, width: 70,
renderer: function (v, p, record) {
if (sstsConfig.generateProxySterilizationFormFunctionInHistoricalAssemblyRecords) {
- if (record.checkStatus == '已核对' && !isFirstRoomPeople) {
+ if (record.hasReceived == '是' && !isFirstRoomPeople) {
return;
} else {
return "
";
@@ -333,18 +343,24 @@
// 开始:判断是否有器械包未入筐
var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode();
var isExistNotInBasketTousseInstance = false;
+ var receiveToussesArray = [];
rootNode.eachChild(function (pNode) {
if (pNode.attributes.type == '器械包') {
isExistNotInBasketTousseInstance = true;
}
+ if (pNode.attributes.receiveTousse == true) {
+ receiveToussesArray.push(pNode.attributes.id);
+ }
});
+ if (receiveToussesArray.length > 0) {
+ top.Ext.getCmp('receiveToussesIDs').setValue(receiveToussesArray.join(','));
+ }
if (isExistNotInBasketTousseInstance) {
var r = confirm("有器械包未放入灭菌筐,是否继续?")
if (r != true) {
return false;
}
}
-
// 结束:判断是否有器械包未入筐
var confirmMessage = "是否提交" + entityName + "单信息?";
top.Ext.MessageBox.confirm("请确认", confirmMessage, function (btn) {
@@ -408,49 +424,131 @@
success: function (response, options) {
var result = Ext.decode(response.responseText);
if (result.success) {
- if (result.type == "器械包") {
- if (result.isProxyed == true) {
- showResult('该器械包已经申请代理灭菌,不能重复申请。');
- return false;
- } else {
- if (top.Ext.getCmp('id').getValue() == '') {
- if (isBarcodeRepeat(barcode)) {
- showResult('条形码:' + barcode + ' 已经存在!');
- return false;
+ var receiveTousse = result.receiveTousse || false;
+ if (receiveTousse == true) {
+ var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode();
+ var index = 0;
+ rootNode.eachChild(function (pNode) {
+ if (pNode.attributes.barcode == barcode) {
+ pNode.remove();
+ return false;
+ }
+ index++;
+ });
+ setTimeout(function () {
+ addTousseInstance(result.id, barcode, result.name, result.status, receiveTousse, index);
+ }, 100);
+ } else {
+ if (result.type == "器械包") {
+ if (result.isProxyed == true) {
+ showResult('该器械包已经申请代理灭菌,不能重复申请。');
+ return false;
+ } else {
+ if (top.Ext.getCmp('id').getValue() == '') {
+ if (isBarcodeRepeat(barcode)) {
+ showResult('条形码:' + barcode + ' 已经存在!');
+ return false;
+ }
}
+ var orgUnitCode = result.produceDeptCode;
+ var orgUnitName = result.produceDeptName;
+ var departCodingCmp = top.Ext.getCmp('departCoding');
+ if (departCodingCmp.getValue() == '') {
+ departCodingCmp.setValue(orgUnitCode);
+ top.Ext.getCmp('depart').setValue(orgUnitName);
+ addTousseInstance(result.id, barcode, result.name, result.status);
+ } else if (departCodingCmp.getValue() != orgUnitCode) {
+ top.Ext.MessageBox.confirm("请确认", "该器械包属于" + orgUnitName + ",是否将申请科室改为" + orgUnitName + "并清空器械包明细列表?",
+ function (button, text) {
+ if ("yes" == button) {
+ top.Ext.getCmp('departCoding').setValue(orgUnitCode);
+ top.Ext.getCmp('depart').setValue(orgUnitName);
+ clearGoodsGrid();
+ addTousseInstance(result.id, barcode, result.name, result.status);
+ }
+ }
+ );
+ } else {
+ addTousseInstance(result.id, barcode, result.name, result.status);
+ }
}
- var orgUnitCode = result.produceDeptCode;
- var orgUnitName = result.produceDeptName;
- var departCodingCmp = top.Ext.getCmp('departCoding');
- if (departCodingCmp.getValue() == '') {
- departCodingCmp.setValue(orgUnitCode);
- top.Ext.getCmp('depart').setValue(orgUnitName);
- addTousseInstance(result.id, barcode, result.name, result.status);
- } else if (departCodingCmp.getValue() != orgUnitCode) {
- top.Ext.MessageBox.confirm("请确认", "该器械包属于" + orgUnitName + ",是否将申请科室改为" + orgUnitName + "并清空器械包明细列表?",
- function (button, text) {
- if ("yes" == button) {
- top.Ext.getCmp('departCoding').setValue(orgUnitCode);
- top.Ext.getCmp('depart').setValue(orgUnitName);
- clearGoodsGrid();
- addTousseInstance(result.id, barcode, result.name, result.status);
+ } else if (result.type == "容器") {
+ var containerType = result.purpose;
+ if (containerType == '灭菌筐') {
+ var notDeliverTousseAmount = result.notDeliverTousseAmount;
+ if (checkExistBasket(barcode)) {
+ showResult(result.containerName + "已经扫描");
+ return false;
+ }
+ if (notDeliverTousseAmount > 0) {
+ if (sstsConfig.disableGoodsNotShippedAlert) {
+ top.Ext.getCmp('basketBarcode').setValue(barcode);
+ var remark = top.Ext.getCmp('remark').getValue();
+ remark = barcode + ";" + remark;
+ top.Ext.getCmp('remark').setValue(remark);
+ top.Ext.getCmp('reviewedBasketId').setValue(result.basketId);
+ top.Ext.getCmp('basketName').setValue(result.containerName);
+
+ var orgUnitCode = result.produceDeptCode;
+ var orgUnitName = result.produceDeptName;
+ if (currentDepartCoding != orgUnitCode) {
+ var departCodingCmp = top.Ext.getCmp('departCoding');
+ if (departCodingCmp.getValue() == '') {
+ departCodingCmp.setValue(orgUnitCode);
+ top.Ext.getCmp('depart').setValue(orgUnitName);
+ bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
+ } else if (departCodingCmp.getValue() != orgUnitCode) {
+ top.Ext.MessageBox.confirm("请确认", "该灭菌筐属于" + orgUnitName + ",是否将申请科室改为" + orgUnitName + "并清空器械包明细列表?",
+ function (button, text) {
+ if ("yes" == button) {
+ departCodingCmp.setValue(orgUnitCode);
+ top.Ext.getCmp('depart').setValue(orgUnitName);
+ clearGoodsGrid();
+ bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
+ }
+ }
+ );
+ } else {
+ bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
+ }
}
+ } else {
+ top.Ext.MessageBox.confirm("请确认", "【" + result.containerName + "】内有" + notDeliverTousseAmount + "个未发货的包,继续使用会导致不能扫描篮筐条码发货,是否继续?", function (button, text) {
+ if ("yes" == button) {
+ top.Ext.getCmp('basketBarcode').setValue(barcode);
+ var remark = top.Ext.getCmp('remark').getValue();
+ remark = barcode + ";" + remark;
+ top.Ext.getCmp('remark').setValue(remark);
+ top.Ext.getCmp('reviewedBasketId').setValue(result.basketId);
+ top.Ext.getCmp('basketName').setValue(result.containerName);
+
+ var orgUnitCode = result.produceDeptCode;
+ var orgUnitName = result.produceDeptName;
+ if (currentDepartCoding != orgUnitCode) {
+ var departCodingCmp = top.Ext.getCmp('departCoding');
+ if (departCodingCmp.getValue() == '') {
+ departCodingCmp.setValue(orgUnitCode);
+ top.Ext.getCmp('depart').setValue(orgUnitName);
+ bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
+ } else if (departCodingCmp.getValue() != orgUnitCode) {
+ top.Ext.MessageBox.confirm("请确认", "该灭菌筐属于" + orgUnitName + ",是否将申请科室改为" + orgUnitName + "并清空器械包明细列表?",
+ function (button, text) {
+ if ("yes" == button) {
+ departCodingCmp.setValue(orgUnitCode);
+ top.Ext.getCmp('depart').setValue(orgUnitName);
+ clearGoodsGrid();
+ bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
+ }
+ }
+ );
+ } else {
+ bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
+ }
+ }
+ }
+ });
}
- );
- } else {
- addTousseInstance(result.id, barcode, result.name, result.status);
- }
- }
- } else if (result.type == "容器") {
- var containerType = result.purpose;
- if (containerType == '灭菌筐') {
- var notDeliverTousseAmount = result.notDeliverTousseAmount;
- if (checkExistBasket(barcode)) {
- showResult(result.containerName + "已经扫描");
- return false;
- }
- if (notDeliverTousseAmount > 0) {
- if (sstsConfig.disableGoodsNotShippedAlert) {
+ } else {
top.Ext.getCmp('basketBarcode').setValue(barcode);
var remark = top.Ext.getCmp('remark').getValue();
remark = barcode + ";" + remark;
@@ -481,89 +579,23 @@
bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
}
}
- } else {
- top.Ext.MessageBox.confirm("请确认", "【" + result.containerName + "】内有" + notDeliverTousseAmount + "个未发货的包,继续使用会导致不能扫描篮筐条码发货,是否继续?", function (button, text) {
- if ("yes" == button) {
- top.Ext.getCmp('basketBarcode').setValue(barcode);
- var remark = top.Ext.getCmp('remark').getValue();
- remark = barcode + ";" + remark;
- top.Ext.getCmp('remark').setValue(remark);
- top.Ext.getCmp('reviewedBasketId').setValue(result.basketId);
- top.Ext.getCmp('basketName').setValue(result.containerName);
-
- var orgUnitCode = result.produceDeptCode;
- var orgUnitName = result.produceDeptName;
- if (currentDepartCoding != orgUnitCode) {
- var departCodingCmp = top.Ext.getCmp('departCoding');
- if (departCodingCmp.getValue() == '') {
- departCodingCmp.setValue(orgUnitCode);
- top.Ext.getCmp('depart').setValue(orgUnitName);
- bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
- } else if (departCodingCmp.getValue() != orgUnitCode) {
- top.Ext.MessageBox.confirm("请确认", "该灭菌筐属于" + orgUnitName + ",是否将申请科室改为" + orgUnitName + "并清空器械包明细列表?",
- function (button, text) {
- if ("yes" == button) {
- departCodingCmp.setValue(orgUnitCode);
- top.Ext.getCmp('depart').setValue(orgUnitName);
- clearGoodsGrid();
- bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
- }
- }
- );
- } else {
- bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
- }
- }
- }
- });
}
} else {
- top.Ext.getCmp('basketBarcode').setValue(barcode);
- var remark = top.Ext.getCmp('remark').getValue();
- remark = barcode + ";" + remark;
- top.Ext.getCmp('remark').setValue(remark);
- top.Ext.getCmp('reviewedBasketId').setValue(result.basketId);
- top.Ext.getCmp('basketName').setValue(result.containerName);
-
- var orgUnitCode = result.produceDeptCode;
- var orgUnitName = result.produceDeptName;
- if (currentDepartCoding != orgUnitCode) {
- var departCodingCmp = top.Ext.getCmp('departCoding');
- if (departCodingCmp.getValue() == '') {
- departCodingCmp.setValue(orgUnitCode);
- top.Ext.getCmp('depart').setValue(orgUnitName);
- bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
- } else if (departCodingCmp.getValue() != orgUnitCode) {
- top.Ext.MessageBox.confirm("请确认", "该灭菌筐属于" + orgUnitName + ",是否将申请科室改为" + orgUnitName + "并清空器械包明细列表?",
- function (button, text) {
- if ("yes" == button) {
- departCodingCmp.setValue(orgUnitCode);
- top.Ext.getCmp('depart').setValue(orgUnitName);
- clearGoodsGrid();
- bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
- }
- }
- );
- } else {
- bindTousseToBaseket(result.basketId, barcode, result.containerName, result.instances);
- }
+ if (result.message) {
+ showResult(result.message);
+ } else {
+ showResult('代理灭菌入筐只能使用灭菌筐。');
}
+
}
+
} else {
if (result.message) {
showResult(result.message);
- } else {
- showResult('代理灭菌入筐只能使用灭菌筐。');
}
-
+ clearGoodsGrid();
+ loadProxyDisinfection(form, id, isFirstRoomPeople);
}
-
- } else {
- if (result.message) {
- showResult(result.message);
- }
- clearGoodsGrid();
- loadProxyDisinfection(form, id, isFirstRoomPeople);
}
} else {
if (result.message) {
@@ -644,11 +676,11 @@
var status = action.result.data.deliverStatus;
editMode = action.result.editMode;
if (isFirstRoomPeople) {
- if (status != '待发货' || editMode == false) {
+ if ((status != '待发货' && status != '待接收' && status != '部分接收') || editMode == false) {
top.Ext.getCmp('saveBtn').disable();
}
} else {
- if (status == '待发货' || editMode == false) {
+ if ((status == '待发货') || editMode == false) {
top.Ext.getCmp('saveBtn').disable();
}
}
@@ -668,8 +700,8 @@
for (var i = 0; i < action.result.instances.length; i++) {
var instance = action.result.instances[i];
if (instancesBarcodeInBasket.indexOf(';' + instance.barcode + ';') < 0) {
- var checkStatus = instance.checkStatus || '';
- var instanceNode = createNode(false, instance.id, instance.barcode, instance.name, '器械包', instance.status, checkStatus);
+ var hasReceived = instance.hasReceived || '';
+ var instanceNode = createNode(false, instance.id, instance.barcode, instance.name, '器械包', instance.status, hasReceived);
rootNode.appendChild(instanceNode);
}
}
@@ -703,7 +735,7 @@
return null;
}
-function createNode(isParentNode, id, barcode, name, type, status, checkStatus) {
+function createNode(isParentNode, id, barcode, name, type, status, hasReceived, receiveTousse) {
var node;
if (isParentNode) {
//创建父节点
@@ -734,7 +766,8 @@
node.attributes.type = type;
node.attributes.operation = '';
node.attributes.status = status;
- node.attributes.checkStatus = checkStatus;
+ node.attributes.hasReceived = hasReceived;
+ node.attributes.receiveTousse = receiveTousse || false;
return node;
}
@@ -762,17 +795,22 @@
return isRepeat;
}
-function addTousseInstance(id, barcode, name, status) {
+function addTousseInstance(id, barcode, name, status, receiveTousse, index) {
var basketBarcode = top.Ext.getCmp('basketBarcode').getValue();
var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode();
+ var z = index || 0;
var tousseNode;
if (basketBarcode == null || basketBarcode == '') {
- tousseNode = createNode(false, id, barcode, name, '器械包', status);
+ tousseNode = createNode(false, id, barcode, name, '器械包', status, false, receiveTousse);
} else {
- tousseNode = createNode(false, id, barcode, name, '器械包', status);
+ tousseNode = createNode(false, id, barcode, name, '器械包', status, false, receiveTousse);
}
- rootNode.insertBefore(tousseNode, rootNode.item(0));
- top.Ext.getCmp('totalAmountOfTousses').setValue(parseInt(top.Ext.getCmp('totalAmountOfTousses').getValue(), 10) + 1);
+ rootNode.insertBefore(tousseNode, rootNode.item(z));
+ if(receiveTousse == true){
+ top.Ext.getCmp('totalAmountOfTousses').setValue(parseInt(top.Ext.getCmp('totalAmountOfTousses').getValue(), 10));
+ }else {
+ top.Ext.getCmp('totalAmountOfTousses').setValue(parseInt(top.Ext.getCmp('totalAmountOfTousses').getValue(), 10) + 1);
+ }
}
function putTousseInBasket() {