|
@@ -88,19 +88,76 @@
|
|
|
var flag = true;
|
|
|
var deviceNumber = $('#deviceNumber').val();
|
|
|
var deviceName = $('#deviceName').val();
|
|
|
+ var device_date = $('#device_date').val();
|
|
|
+ var deviceRemake = $('#deviceRemake').val();
|
|
|
+
|
|
|
if (deviceNumber == null || !check_number.test(deviceNumber)) {
|
|
|
flag = false;
|
|
|
layer.msg('设备编号格式不正确,请重新输入!',{icon: 5,time:1000});
|
|
|
return flag;
|
|
|
}
|
|
|
+ $.ajax({
|
|
|
+ cache: true,
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ deviceNumber:deviceNumber
|
|
|
+ },
|
|
|
+ url: "${path}/admin/equipment/is_equipment",
|
|
|
+ async: false,
|
|
|
+ success: function(data){
|
|
|
+ if (data.returnCode == 200) {
|
|
|
+ flag = false;
|
|
|
+ layer.msg('该设备编号已存在',{icon: 5,time:1000});
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(flag == false){
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
if (deviceName == null || !check_name.test(deviceName)) {
|
|
|
flag = false;
|
|
|
layer.msg('设备名称格式不正确,请重新输入!',{icon: 5,time:1000});
|
|
|
return flag;
|
|
|
}
|
|
|
+ if (device_date == null || device_date == "" ) {
|
|
|
+ flag = false;
|
|
|
+ layer.msg('购买日期不能为空!',{icon: 5,time:1000});
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
+ if(deviceRemake != null){
|
|
|
+ if(deviceRemake.length > 50){
|
|
|
+ layer.msg('备注长度为0-50个字符!',{icon: 5,time:1000});
|
|
|
+ }
|
|
|
+ }
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
+ /*验证编号*/
|
|
|
+ function ptsValiDataNo(thVal) {
|
|
|
+ $.ajax({
|
|
|
+ cache: true,
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ deviceNumber:thVal
|
|
|
+ },
|
|
|
+ url: "${path}/admin/equipment/is_equipment",
|
|
|
+ async: false,
|
|
|
+ success: function(data){
|
|
|
+ if (data.returnCode == 200) {
|
|
|
+ layer.msg('该设备编号已存在',{icon: 5,time:1000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function submit_value() {
|
|
|
var deviceNumber = $('#deviceNumber').val();
|
|
|
var deviceName = $('#deviceName').val();
|