|
@@ -893,16 +893,19 @@ function inputShowOneValiDate(e)
|
|
|
|
|
|
//批量更新
|
|
//批量更新
|
|
var list_mul_state = 1;
|
|
var list_mul_state = 1;
|
|
-function list_mul(e)
|
|
|
|
|
|
+function list_mul(e, t, url)
|
|
{
|
|
{
|
|
- var type = parseInt($("#mul_type").val());
|
|
|
|
- if(type != 1 && type != 2)
|
|
|
|
- {
|
|
|
|
- alert('您还没有选择数据更新方式');
|
|
|
|
- return;
|
|
|
|
|
|
+ if (t == 1) {
|
|
|
|
+ var type = parseInt($("#mul_type").val());
|
|
|
|
+ if(type != 1 && type != 2)
|
|
|
|
+ {
|
|
|
|
+ showAlert('您还没有选择数据');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
if (list_mul_state == 2) {
|
|
if (list_mul_state == 2) {
|
|
- alert('请不要重复点击');
|
|
|
|
|
|
+ showAlert('请不要重复点击');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
var index = layer.confirm('确定进行此项操作吗?', function()
|
|
var index = layer.confirm('确定进行此项操作吗?', function()
|
|
@@ -911,6 +914,9 @@ function list_mul(e)
|
|
$('#method').val('mul');
|
|
$('#method').val('mul');
|
|
$('#function').val('msg');
|
|
$('#function').val('msg');
|
|
layer.close(index);
|
|
layer.close(index);
|
|
|
|
+ if (url) {
|
|
|
|
+ $('#method').val('mul.' + url);
|
|
|
|
+ }
|
|
$('#form1').attr('target', 'f1').submit();
|
|
$('#form1').attr('target', 'f1').submit();
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -1029,90 +1035,87 @@ function loading(e, data, type)
|
|
var value = e.attr('v');
|
|
var value = e.attr('v');
|
|
} else {
|
|
} else {
|
|
var value = e.val();
|
|
var value = e.val();
|
|
- if(e.attr('id') && e.attr('id').indexOf('_temp') != -1)
|
|
|
|
- {
|
|
|
|
|
|
+ if (e.attr('id') && e.attr('id').indexOf('_temp') != -1) {
|
|
var id = e.attr('id').replace('_temp', '');
|
|
var id = e.attr('id').replace('_temp', '');
|
|
- if($('#' + id).length)
|
|
|
|
- {
|
|
|
|
|
|
+ if ($('#' + id).length) {
|
|
var value = $('#' + id).val();
|
|
var value = $('#' + id).val();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(data.element)
|
|
|
|
- {
|
|
|
|
- if(data.url)
|
|
|
|
- {
|
|
|
|
|
|
+ if (data.element) {
|
|
|
|
+ if (data.url) {
|
|
data.value = value;
|
|
data.value = value;
|
|
- $.getJSON(data.url + '&json=1', data, function(t)
|
|
|
|
- {
|
|
|
|
- $('#update_'+data.element+'_value').val(t.data);
|
|
|
|
|
|
+ $.getJSON(data.url + '&json=1', data, function(t) {
|
|
|
|
+ $('#update_'+data.element+'').val(t.data);
|
|
});
|
|
});
|
|
|
|
+ } else {
|
|
|
|
+ $('#update_'+data.element+'').val(value);
|
|
}
|
|
}
|
|
- else
|
|
|
|
- {
|
|
|
|
- $('#update_'+data.element+'_value').val(value);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if(data.url)
|
|
|
|
- {
|
|
|
|
|
|
+ } else if(data.url) {
|
|
data.value = value;
|
|
data.value = value;
|
|
data.where_id = $('#update_where_id').val();
|
|
data.where_id = $('#update_where_id').val();
|
|
data.table = $('#table').val();
|
|
data.table = $('#table').val();
|
|
data.project = $('#project').val();
|
|
data.project = $('#project').val();
|
|
-
|
|
|
|
- $.getJSON(data.url + '&json=1', data, function(s)
|
|
|
|
- {
|
|
|
|
|
|
+ var parent = e.parent().parent();
|
|
|
|
+ var tagName = parent.prop("tagName");
|
|
|
|
+ $.getJSON(data.url + '&json=1', data, function(s) {
|
|
t = s.data;
|
|
t = s.data;
|
|
if (typeof(t) == 'object') {
|
|
if (typeof(t) == 'object') {
|
|
var d = t.data;
|
|
var d = t.data;
|
|
t = t.html;
|
|
t = t.html;
|
|
if (d) {
|
|
if (d) {
|
|
for(var i in d) {
|
|
for(var i in d) {
|
|
- //$('#update_'+i+'_value').val(d[i]);
|
|
|
|
- $('#update_'+i).val(d[i]);
|
|
|
|
|
|
+ if (tagName == 'TD') {
|
|
|
|
+ var p = parent.parent();
|
|
|
|
+ var ti = p.attr('id') + '_i_' + i;
|
|
|
|
+ var ue = $('#update_'+ti);
|
|
|
|
+ } else {
|
|
|
|
+ var ue = $('#update_'+i);
|
|
|
|
+ }
|
|
|
|
+ var div = ue.prop("tagName");
|
|
|
|
+ if (div == 'DIV') {
|
|
|
|
+ ue.html(d[i]);
|
|
|
|
+ } else {
|
|
|
|
+ ue.val(d[i]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(t.indexOf('onblur') != -1)
|
|
|
|
- {
|
|
|
|
- eval(t);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- var parent = e.parent().parent();
|
|
|
|
- var tagName = parent.prop("tagName");
|
|
|
|
- if(t.indexOf('status') == -1)
|
|
|
|
- {
|
|
|
|
- if(data.type == 1)
|
|
|
|
- {
|
|
|
|
- $('.checking_1,.checking_2,.checking_3,.checking_4').each(function()
|
|
|
|
- {
|
|
|
|
- $(this).remove();
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- $('.checking_-1,.checking_3,.checking_4').each(function()
|
|
|
|
- {
|
|
|
|
- $(this).remove();
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
|
|
- if (!parent.parent().find('.bind_show').length) {
|
|
|
|
- if (tagName == 'TD') {
|
|
|
|
- parent.next().html('<div class="bind_show">' + t + '</div>');
|
|
|
|
|
|
+ if (t) {
|
|
|
|
+ if (t.indexOf('onblur') != -1) {
|
|
|
|
+ eval(t);
|
|
|
|
+ } else {
|
|
|
|
+ if (t.indexOf('status') == -1) {
|
|
|
|
+ if (data.type == 1) {
|
|
|
|
+ $('.checking_1,.checking_2,.checking_3,.checking_4').each(function()
|
|
|
|
+ {
|
|
|
|
+ $(this).remove();
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- parent.after('<div class="bind_show">' + t + '</div>');
|
|
|
|
|
|
+ $('.checking_-1,.checking_3,.checking_4').each(function()
|
|
|
|
+ {
|
|
|
|
+ $(this).remove();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!parent.parent().find('.bind_show').length) {
|
|
|
|
+ if (tagName == 'TD') {
|
|
|
|
+ parent.next().html('<div class="bind_show">' + t + '</div>');
|
|
|
|
+ } else {
|
|
|
|
+ parent.after('<div class="bind_show">' + t + '</div>');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else if (parent.parent().find('.bind_show').html() != t) {
|
|
|
|
+ parent.parent().find('.bind_show').html(t);
|
|
}
|
|
}
|
|
-
|
|
|
|
- } else if (parent.parent().find('.bind_show').html() != t) {
|
|
|
|
- parent.parent().find('.bind_show').html(t);
|
|
|
|
- }
|
|
|
|
|
|
|
|
- checkbox();
|
|
|
|
|
|
+ checkbox();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1203,7 +1206,7 @@ function autocomplete()
|
|
|
|
|
|
var cate = self.attr('complete_cate');
|
|
var cate = self.attr('complete_cate');
|
|
if (cate) {
|
|
if (cate) {
|
|
- request[cate] = $('update_' + cate + '_value').val();
|
|
|
|
|
|
+ request[cate] = $('#update_' + cate).val();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1478,8 +1481,9 @@ function msg(value)
|
|
}
|
|
}
|
|
submit();
|
|
submit();
|
|
var url = '';
|
|
var url = '';
|
|
- if(value.data != 'reload' && value.status == 2)
|
|
|
|
|
|
+ if(value.data != 'reload' && value.status == 2 && value.code == 1)
|
|
{
|
|
{
|
|
|
|
+ list_mul_state = 1;
|
|
showAlert(value.msg, false, '错误提示');
|
|
showAlert(value.msg, false, '错误提示');
|
|
//alert(value.data);
|
|
//alert(value.data);
|
|
//location.reload();
|
|
//location.reload();
|
|
@@ -3377,16 +3381,20 @@ function sku(e)
|
|
var type = 'required';
|
|
var type = 'required';
|
|
var value = '';
|
|
var value = '';
|
|
}
|
|
}
|
|
- if (data[i]['type'] == 'image') {
|
|
|
|
- var icon = '';
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (data[i]['type'] == 'input') {
|
|
var icon = 'layui-icon-cols';
|
|
var icon = 'layui-icon-cols';
|
|
|
|
+ } else {
|
|
|
|
+ var icon = '';
|
|
}
|
|
}
|
|
mthead.push({title: data[i]['name'], icon: icon});
|
|
mthead.push({title: data[i]['name'], icon: icon});
|
|
- mtbody.push({type: data[i]['type'], field: i, value: value, verify: type, reqtext: data[i]['name'] + '不能为空'});
|
|
|
|
- if (data[i]['type'] != 'image') {
|
|
|
|
|
|
+ var option = {type: data[i]['type'], field: i, value: value, verify: type, reqtext: data[i]['name'] + '不能为空'};
|
|
|
|
+ if (option.type == 'select') {
|
|
|
|
+ option.option = eval("(" + data[i]['option'] + ")");
|
|
|
|
+ }
|
|
|
|
+ mtbody.push(option);
|
|
|
|
+ if (option.type != 'image') {
|
|
thead.push({title: data[i]['name'], icon: 'layui-icon-cols'});
|
|
thead.push({title: data[i]['name'], icon: 'layui-icon-cols'});
|
|
- tbody.push({type: data[i]['type'], field: i, value: value, verify: type, reqtext: data[i]['name'] + '不能为空'});
|
|
|
|
|
|
+ tbody.push(option);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var obj = skuTable.render({
|
|
var obj = skuTable.render({
|
|
@@ -3438,7 +3446,7 @@ function append(self, id)
|
|
total += append_total;
|
|
total += append_total;
|
|
html = html.replaceAll('_-1_', '_' + total + '_');
|
|
html = html.replaceAll('_-1_', '_' + total + '_');
|
|
html = html.replaceAll('up_', 'update_');
|
|
html = html.replaceAll('up_', 'update_');
|
|
- id = 'append_' + id + '_' + total;
|
|
|
|
|
|
+ id = 'update_' + id + '_c_' + total;
|
|
parent.append('<tr id="'+id+'">' + html + '</tr>');
|
|
parent.append('<tr id="'+id+'">' + html + '</tr>');
|
|
form.render();
|
|
form.render();
|
|
$('#' + id + " select").each(function()
|
|
$('#' + id + " select").each(function()
|