You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yy_rms_39zhiyao_duizhao/templates/drug/DrugUseByBarCode.html

195 lines
8.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{% extends 'base.html' %}
{% block content %}
<style>
body {
overflow: hidden;
}
.dl-horizontal dt {
line-height: 45px;
font-size: 15px;
}
.dl-horizontal dd {
line-height: 45px;
font-size: 15px;
}
</style>
<div class="wrapper wrapper-content animated fadeInDown" style="overflow: hidden">
<div class="row">
<div class="col-md-5" style="text-align:center;padding-top:200px;"><i class="fa fa-4x"
style="font-size:12em; margin: 0 0 0 10px;"><img src="../../static/img/scanning.png" alt="" srcset=""></i>
<div style="font-size:45px; margin-top: 20px;">请扫描或检测RFID</div>
<!-- <div style="font-size:30px;color:red" id="status">点击此页面开始</div><input type="text"
style="color:#F3F3F4; background-color:#F3F3F4; border-width:0px;outline:none" id="fff" /> -->
</div>
<div class="col-md-7"
style="border-left-color:#8B8989;border-left-width:1px;border-left-style:solid;height:650px;padding-top:110px">
<div class="wrapper wrapper-content animated fadeInDown">
<div class="mail-box-header">
<h2>
药剂领用列表
</h2>
</div>
<div class="ibox-content">
<table id="dataTableModel"
class="table table-striped table-bordered table-hover dataTables-example">
<thead>
<tr>
<th>条码编号</th>
<th>药剂名称</th>
<th>CAS码</th>
<th>纯度</th>
</tr>
</thead>
<tbody id="shuju">
</tbody>
</table>
</div>
</div>
</div>
</div>
{% load static %}
<script src="{% static 'js/utils.js' %}"></script>
<script src="{% static 'js/warning.js' %}"></script>
<script type="text/javascript">
$(function () {
$('#navTitle', window.parent.document).text('药剂领用');
// $(document).click(function () {
// $("#status").text("等待扫描检测...")
// })
var flag_status = true;
window.focus(); // 当前页面获得焦点用来RFID扫描
//挂钩jquery插件实现条码识别
$(document).barCodeScanerModeEnter(function (barCode) {
// alert(barCode);
var index = layer.load(2, { shade: 0.01 });
$.ajax({
type: 'POST',
url: '{% url 'drug:drugUseView' %}',
data: { drugId: barCode },
success: function (data) {
layer.close(index);
if (data.status == 0) {
layer.msg("药剂领用成功!");
resultData = JSON.parse(data.data);
$("#shuju").append("<tr><td>" + resultData.BarCode + "</td><td>" + resultData.Name + "</td><td>" + resultData.CASNumber + "</td><td>" + resultData.Purity + "</td></tr>")
console.log(data)
parent.layer.open({
title: "取出称重",
shift: 2,
type: 2,
area: ['1400px', '700px'],
//skin: 'layui-layer-rim', //加上边框
content: ['/drug/drug_popWeigh_Jump?barCode=' + barCode],
end: function () {
currentTime = 0;
quiteTime = 600;
tableModel.ajax.reload();
}
});
}else if (data.status == 2) {
console.log("1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")
layer.confirm('' + data.message, { icon: 3, title: '提示' }, function (index) {
//do something
$.ajax({
type: 'POST',
url: '{% url 'drug:drugUseView' %}',
data: { drugId: barCode, forceUse: "True" },
success: function (data) {
console.log(data, "1111111111111111111111111111111111111111111111111111111111111111111111111111")
layer.msg("药剂领用成功!");
resultData = JSON.parse(data.data);
$("#shuju").append("<tr><td>" + resultData.BarCode + "</td><td>" + resultData.Name + "</td><td>" + resultData.CASNumber + "</td><td>" + resultData.Purity + "</td></tr>")
console.log(data)
layer.close(index);
parent.layer.open({
title: "取出称重",
shift: 2,
type: 2,
area: ['1400px', '700px'],
//skin: 'layui-layer-rim', //加上边框
content: ['/drug/drug_popWeigh_Jump?barCode=' + barCode],
end: function () {
currentTime = 0;
quiteTime = 600;
tableModel.ajax.reload();
}
})
}
})
})
}
else {
new $.flavr({
modal: false,
autoclose: false,
timeout: 2000,
buttons: {
OK: {
text: '确认',
style: 'danger',
addClass: null,
action: function (e) {
console.log("3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333")
flag_status = true;
// socket.send('123123');
}
},
},
content: data.message
});
}
},
error: function () {
alert('数据异常!');
flag_status = true;
layer.close(index);
// socket.send('886');
}
});
});
// flag_status 用来RFID入库禁止频繁弹窗
var flag_status = true;
function format_status(params) {
switch (params) {
case 1:
return '在库';
case 2:
return '出库';
case 3:
return '空瓶';
default:
return ''
}
}
})
</script>
</div>
{% endblock %}