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.
227 lines
9.8 KiB
227 lines
9.8 KiB
{% extends 'base.html' %}
|
|
|
|
|
|
{% block content %}
|
|
|
|
<style type="text/css">
|
|
.ibox {
|
|
background-color: #FFF !important;
|
|
}
|
|
.myForm {
|
|
padding-top: 30px;
|
|
padding-left: 30px;
|
|
}
|
|
.layui-form-label {
|
|
width: 100px;
|
|
}
|
|
</style>
|
|
{% load static %}
|
|
|
|
<div class="ibox float-e-margins">
|
|
<form class="form-horizontal myForm" role="form" style="margin-top:15px">
|
|
<div class="form-group">
|
|
<label class="layui-form-label" for="ds_username">药剂类型 *</label>
|
|
<div class="col-sm-8">
|
|
<input class="layui-input" id="VarietyId" value="{% firstof itemContent.VarietyId '' %}" name="VarietyId" type="hidden" />
|
|
<input type="text" class="layui-input" value="{% firstof itemContent.Name '' %}" data-placeholder="请输入药剂类型..." id="drugTypeSelect" required="required" style="width:480px;" >
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="layui-form-label" for="ds_username">EnglishName </label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="EnglishName" maxlength="50" value="{% firstof itemContent.EnglishName '' %}" name="EnglishName" type="text" value="" />
|
|
</div>
|
|
<label class="layui-form-label" for="ds_username">CAS码*</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="CASNumber" name="CASNumber" value="{% firstof itemContent.CASNumber '' %}" type="text" required="required" value="" />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="layui-form-label" for="ds_username">生产日期 </label>
|
|
<div class="col-sm-3">
|
|
<div class="input-group">
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
<input type="text" class="layui-input" value="{% firstof itemContent.ProductionDate '' %}" id="ProductionDate" name="ProductionDate">
|
|
</div>
|
|
</div>
|
|
<label class="layui-form-label" for="ds_username">纯度 *</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="Purity" name="Purity" value="{% firstof itemContent.Purity '' %}" type="text" required="required" value="" />
|
|
</div>
|
|
|
|
</div>
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="layui-form-label" for="ds_username">保质期</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="ShelfLife" name="ShelfLife" value="{% firstof itemContent.ShelfLife '' %}" oninput="this.value=this.value.replace(/[^0-9]+/,'');" type="number" value="" />
|
|
</div>
|
|
|
|
<label class="layui-form-label" for="ds_username">导入数量*</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="ExportCount" name="ExportCount" value="{% firstof itemContent.ExportCount '' %}" oninput="this.value=this.value.replace(/[^0-9]+/,'');" type="number" required="required" value="" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
|
|
<label class="layui-form-label" for="ds_username">到期日期</label>
|
|
<div class="col-sm-3">
|
|
<div class="input-group">
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
<input type="text" class="layui-input" id="ExpirationDate" value="{% firstof itemContent.ExpirationDate '' %}" name="ExpirationDate">
|
|
</div>
|
|
</div>
|
|
|
|
<label class="layui-form-label" for="ds_username"></label>
|
|
<div class="col-sm-3">
|
|
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
|
|
<label class="layui-form-label" for="ds_username">价格</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="Price" name="Price" value="{% firstof itemContent.Price '' %}" oninput="this.value=this.value.replace(/[^0-9.]+/,'');" type="number" required="required" value="" />
|
|
</div>
|
|
|
|
<label class="layui-form-label" for="ds_username">销售商</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="Distributor" value="{% firstof itemContent.Distributor '' %}" name="Distributor" type="text" required="required" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="layui-form-label" for="ds_username">规格 *</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="Speci" value="{% firstof itemContent.Speci '' %}" name="Manufacturer" type="number" required="required" />
|
|
</div>
|
|
<label class="layui-form-label" for="ds_username">单位</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="Unit" value="{% firstof itemContent.Unit '' %}" name="Distributor" value="瓶" type="text" required="required" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="layui-form-label" for="ds_username">规格单位</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="SpeciUnit" value="{% firstof itemContent.SpeciUnit '' %}" name="Manufacturer" type="text" required="required" value="g"/>
|
|
</div>
|
|
<label class="layui-form-label" for="ds_username">生产厂商</label>
|
|
<div class="col-sm-3">
|
|
<input class="layui-input" id="Manufacturer" value="{% firstof itemContent.Manufacturer '' %}" name="Manufacturer" type="text" required="required" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group" style="margin-bottom: 0px;">
|
|
<label class="layui-form-label" for="ds_username">预估质量</label>
|
|
<div class="col-sm-3">
|
|
<div class="input-group">
|
|
<input class="layui-input" id="Remain" value="{% firstof itemContent.Remain '' %}" name="Remain" type="number" required="required" value="0"/>
|
|
<span class="input-group-addon">g</span>
|
|
</div>
|
|
</div>
|
|
<label class="layui-form-label" for="ds_username"></label>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
{% load static %}
|
|
<link href="{% static 'plugins/autosuggestjs/autosuggest.css' %}" rel="stylesheet" />
|
|
<script src="{% static 'plugins/autosuggestjs/autosuggest-native.js' %}"></script>
|
|
<script src="{% static 'js/plugins/datapicker/bootstrap-datepicker.js' %}"></script>
|
|
<script src="{% static 'js/utils.js' %}"></script>
|
|
<script src="{% static 'js/warning.js' %}"></script>
|
|
|
|
<script type="text/javascript">
|
|
var laydate = layui.laydate;
|
|
//年月选择器
|
|
laydate.render({
|
|
elem: '#ProductionDate',
|
|
|
|
trigger: 'click',
|
|
|
|
});
|
|
laydate.render({
|
|
elem: '#ExpirationDate',
|
|
|
|
trigger: 'click',
|
|
|
|
});
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
$(function () {
|
|
$("#drugTypeSelect").autosuggest({
|
|
url: '{% url 'drugTemplate:autoSearchDrugList' %} ',
|
|
queryParamName: 'keyWord',
|
|
maxNum: 5,
|
|
firstSelected: true,
|
|
onSelect: function (obj) {
|
|
$("#CASNumber").val($(obj).attr("data-id"));
|
|
$("#EnglishName").val($(obj).attr("data-EnglishName"));
|
|
if (String($(obj).attr("data-Purity")) != "undefined"){
|
|
$("#Purity").val($(obj).attr("data-Purity"));
|
|
$("#Manufacturer").val($(obj).attr("data-Manufacturer"));
|
|
$("#Distributor").val($(obj).attr("data-Distributor"));
|
|
$("#ProductionDate").val($(obj).attr("data-ProductionDate"));
|
|
$("#ShelfLife").val($(obj).attr("data-ShelfLife"));
|
|
$("#Price").val($(obj).attr("data-Price"));
|
|
$("#ExportCount").val($(obj).attr("data-ExportCount"));
|
|
$("#Speci").val($(obj).attr("data-Speci"));
|
|
$("#Unit").val($(obj).attr("data-Unit"));
|
|
$("#SpeciUnit").val($(obj).attr("data-SpeciUnit"));
|
|
$("#Remain").val($(obj).attr("data-Remain"));
|
|
}else{
|
|
$("#Purity").val("");
|
|
$("#Manufacturer").val("");
|
|
$("#Distributor").val("");
|
|
$("#ProductionDate").val("");
|
|
$("#ShelfLife").val("");
|
|
$("#Price").val("");
|
|
$("#ExportCount").val("");
|
|
$("#Speci").val("");
|
|
$("#Unit").val("");
|
|
$("#SpeciUnit").val("");
|
|
$("#Remain").val("");
|
|
}
|
|
|
|
|
|
//setSupervise(obj.CASNumber);
|
|
//var reagentData = ReagentDB.GetReagent($(obj).attr("data-id"));
|
|
//$("#EnglishName").val(reagentData.EnglishName);
|
|
//$("#CASNumber").val(reagentData.CASNumber);
|
|
}
|
|
});
|
|
|
|
$("#IsSuperviseSwich").change(function () {
|
|
|
|
$("#IsSupervise").val($("#IsSuperviseSwich").is(":checked") ? 1 : 0);
|
|
});
|
|
$(".myForm").submit(function () {
|
|
var loadIndex = layer.load(2);
|
|
$.post("", $(this).serialize(), function (obj) {
|
|
layer.close(loadIndex);
|
|
if (obj.status == 1) {
|
|
msg("保存成功", function () {
|
|
parent.layer.close(index);
|
|
});
|
|
}
|
|
else {
|
|
msg("保存失败");
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
$("#closeForm").click(function () {
|
|
parent.layer.close(index);
|
|
});
|
|
})
|
|
</script>
|
|
|
|
|
|
{% endblock %}
|