Commit b585cc1e by 朱继来

调整联营新增商品

parent 40012185
......@@ -101,7 +101,7 @@
var price = parseFloat($(this).find('.price').val()) || 0;
if (supplier.hasOwnProperty(sup)) { // 判断当前key是否存在于数组中
supplier[sup] += parseFloat(num * price).toFixed(2);
supplier[sup] = (parseFloat(supplier[sup]) + parseFloat(num * price)).toFixed(2);
} else {
supplier[sup] = parseFloat(num * price).toFixed(2);
}
......@@ -454,7 +454,7 @@
change_str += goods_name+'单价不能为0或空 ';
}
if (order_goods_type == 1 && buyer_id == null) {
if (order_goods_type == 1 && (buyer_id == null || buyer_id == '')) {
change_buyer_id = true;
change_str += goods_name+'采购员不能为空 ';
}
......
......@@ -94,6 +94,11 @@
var data = eval('('+resp.data+')');
var order_item = data.item; // 当前新增商品信息
var sup = order_item.canal ? order_item.supplier_id+'.'+order_item.canal : order_item.supplier_id;
var buyers_option = '';
for (var i = 0; i < buyers.length; i++) {
buyers_option += '<option value="'+buyers[i].userId+'">'+buyers[i].name+'</option>';
}
html += '<tr data-sup="'+sup+'" data-brand_name="'+order_item.brand_name+'">\
<td>'+curr_no+'</td>\
......@@ -134,6 +139,14 @@
<input class="price only_number" name="change_info['+curr_no+'][goods_price]" data-price="'+order_item.goods_price+'" value="'+order_item.goods_price+'">\
</td>\
<td>\
<select id="buyer_id_'+curr_no+'" class="form-control change_buyer_id selectpicker" name="change_info['+curr_no+'][buyer_id]" data-live-search="true" data-size="5" title="请选择采购员">\
<option value="">请选择采购员</option>'+buyers_option+'\
</select>\
</td>\
<td>\
<input type="text" class="form-control change_batch" name="change_info['+curr_no+'][batch]" value="">\
</td>\
<td>\
<input class="change_status" type="hidden" name="change_info['+curr_no+'][status]" value="1">\
<span class="change_status_val">正常<i style="color:green;">(新增)</i></span>\
</td>\
......@@ -147,6 +160,7 @@
$('.order-change-table').find('tbody').append(html);
$('.order-change-table').find('tbody input').trigger('blur'); // 自动触发
$('.change_buyer_id').selectpicker();
// 添加附加费
var extend_fee_items = data.extend_fee_items;
......@@ -287,6 +301,15 @@
})
var curr_no = goods_len + 1; // 当前添加行序号
var buyers_option = '';
for (var i = 0; i < buyers.length; i++) {
if (add_buyer_id == buyers[i].userId) {
buyers_option += '<option value="'+buyers[i].userId+'" selected>'+buyers[i].name+'</option>';
} else {
buyers_option += '<option value="'+buyers[i].userId+'">'+buyers[i].name+'</option>';
}
}
html += '<tr data-brand_name="'+add_brand_name+'">\
<td>'+curr_no+'</td>\
......@@ -313,6 +336,14 @@
<input class="price only_number" name="change_info['+curr_no+'][goods_price]" data-price="'+add_goods_price+'" value="'+add_goods_price+'">\
</td>\
<td>\
<select id="buyer_id_'+curr_no+'" class="form-control change_buyer_id selectpicker" name="change_info['+curr_no+'][buyer_id]" data-live-search="true" data-size="5" title="请选择采购员">\
<option value="">请选择采购员</option>'+buyers_option+'\
</select>\
</td>\
<td>\
<input type="text" class="form-control change_batch" name="change_info['+curr_no+'][batch]" value="'+add_batch+'">\
</td>\
<td>\
<input class="change_status" type="hidden" name="change_info['+curr_no+'][status]" value="1">\
<span class="change_status_val">正常<i style="color:green;">(新增)</i></span>\
</td>\
......@@ -324,14 +355,13 @@
<input type="hidden" name="change_info['+curr_no+'][goods_id]" value="'+add_goods_id+'" />\
<input type="hidden" name="change_info['+curr_no+'][brand_name]" value="'+add_brand_name+'" />\
<input type="hidden" name="change_info['+curr_no+'][delivery_time]" value="'+add_delivery_time+'" />\
<input type="hidden" name="change_info['+curr_no+'][buyer_id]" value="'+add_buyer_id+'" />\
<input type="hidden" name="change_info['+curr_no+'][batch]" value="'+add_batch+'" />\
<input type="hidden" name="change_info['+curr_no+'][remarks]" value="'+add_remarks+'" />\
</td>\
</tr>';
$('.order-change-table').find('tbody').append(html);
$('.order-change-table').find('tbody input').trigger('blur'); // 自动触发
$('.change_buyer_id').selectpicker();
layer.close(index);
} else {
......
......@@ -358,12 +358,12 @@
</tr>
@endif
@if ($order_info['order_goods_type'] == 2)
@if ($order_price_info['shipping_price'])
<tr>
<th>运费</th>
<td>
<span>{{$currency}}</span>
<input class="only_number freight_fee" type="text" name="freight_fee" value="{{ $order_price_info['shipping_price'] ? $order_price_info['shipping_price'] : 0 }}">
<input class="only_number freight_fee" type="text" name="freight_fee" value="{{ $order_price_info['shipping_price'] }}">
</td>
</tr>
@endif
......@@ -544,6 +544,7 @@
var discount_amount = "{{ $order_price_info['discount_amount'] ? $order_price_info['discount_amount'] : 0 }}"; // 优惠券金额
var pay_preferential = "{{ $order_price_info['pay_preferential'] ? $order_price_info['pay_preferential'] : 0 }}"; // 支付优惠(钱包)
var new_client_price = "{{ $order_price_info['new_client_price'] }}";
var buyers = eval('{!! isset($buyers) ? json_encode($buyers) : '' !!}'); // 采购员集合
// 明细数目
var item_count = "{{ count($order_items_info) }}";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment