Commit 139e2153 by 朱继来

自营添加备注

parent 0f3dc01e
...@@ -1154,29 +1154,36 @@ ...@@ -1154,29 +1154,36 @@
// 编辑商品明细 // 编辑商品明细
$('.edit-item').click(function() { $('.edit-item').click(function() {
var order_goods_type = $('#order_goods_type').val();
var rec_id = $(this).data('id'); var rec_id = $(this).data('id');
var item_batch = $(this).data('batch'); var item_batch = $(this).data('batch');
var item_buyer_id = $(this).data('bid');
var item_remarks = $(this).data('remarks'); var item_remarks = $(this).data('remarks');
var buyer_count = buyers.length;
var html = '';
for (var i = 0; i < buyer_count; i++) { if (order_goods_type == 1) {
if (item_buyer_id && item_buyer_id == buyers[i].userId) { var item_buyer_id = $(this).data('bid');
html += '<option value="'+buyers[i].userId+'" selected>'+buyers[i].name+'</option>'; var buyer_count = buyers.length;
} else { var html = '';
html += '<option value="'+buyers[i].userId+'">'+buyers[i].name+'</option>';
for (var i = 0; i < buyer_count; i++) {
if (item_buyer_id && item_buyer_id == buyers[i].userId) {
html += '<option value="'+buyers[i].userId+'" selected>'+buyers[i].name+'</option>';
} else {
html += '<option value="'+buyers[i].userId+'">'+buyers[i].name+'</option>';
}
} }
} }
var content = '<div class="form-horizontal">\ var content = '';
<div class="form-group">\ content = '<div class="form-horizontal">\
<label class="col-sm-3 control-label"><i class="error">*</i> 批次</label>\ <div class="form-group">\
<div class="col-sm-9">\ <label class="col-sm-3 control-label"><i class="error">*</i> 批次</label>\
<input type="text" class="form-control" name="batch" value="'+item_batch+'" placeholder="请填写批次" style="width:200px;">\ <div class="col-sm-9">\
</div>\ <input type="text" class="form-control" name="batch" value="'+item_batch+'" placeholder="请填写批次" style="width:200px;">\
</div>\ </div>\
<div class="form-group">\ </div>';
if (order_goods_type == 1) {
content += '<div class="form-group">\
<label class="col-sm-3 control-label">采购员</label>\ <label class="col-sm-3 control-label">采购员</label>\
<div class="col-sm-9" style="width:230px;">\ <div class="col-sm-9" style="width:230px;">\
<select class="form-control buyer_id selectpicker" name="buyer_id" data-live-search="true" data-size="7">\ <select class="form-control buyer_id selectpicker" name="buyer_id" data-live-search="true" data-size="7">\
...@@ -1184,14 +1191,22 @@ ...@@ -1184,14 +1191,22 @@
'+html+'\ '+html+'\
</select>\ </select>\
</div>\ </div>\
</div>\ </div>';
<div class="form-group">\ }
<label class="col-sm-3 control-label">备注</label>\
<div class="col-sm-9">\ content += '<div class="form-group">';
<textarea class="form-control" name="remarks" placeholder="请填写备注" style="width:200px;">'+item_remarks+'</textarea>\
</div>\ if (order_goods_type == 1) {
</div>\ content += '<label class="col-sm-3 control-label">备注</label>';
</div>'; } else {
content += '<label class="col-sm-3 control-label"><i class="error">*</i> 备注</label>';
}
content += '<div class="col-sm-9">\
<textarea class="form-control" name="remarks" placeholder="请填写备注" style="width:200px;">'+item_remarks+'</textarea>\
</div>\
</div>\
</div>';
layer.open({ layer.open({
area: ['400px'], area: ['400px'],
...@@ -1201,7 +1216,7 @@ ...@@ -1201,7 +1216,7 @@
//提交事件 //提交事件
btn1:function(){ btn1:function(){
var batch = $('input[name=batch]').val(); var batch = $('input[name=batch]').val();
var buyer_id = $('select[name=buyer_id]').val(); var buyer_id = $('select[name=buyer_id]').val() || 0;
var remarks = $('textarea[name=remarks]').val(); var remarks = $('textarea[name=remarks]').val();
if (!batch) { if (!batch) {
...@@ -1209,6 +1224,11 @@ ...@@ -1209,6 +1224,11 @@
return false; return false;
} }
if (order_goods_type == 2 && !remarks) {
layer.tips('请填写备注', $('textarea[name=remarks]'));
return false;
}
$.ajax({ $.ajax({
url: '/api/update_order_items', url: '/api/update_order_items',
data: {id: rec_id, batch: batch, buyer_id: buyer_id, remarks: remarks}, data: {id: rec_id, batch: batch, buyer_id: buyer_id, remarks: remarks},
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<input type="hidden" class="action_type" value="{{$action_name}}"> <input type="hidden" class="action_type" value="{{$action_name}}">
<input type="hidden" id="order_id" name="order_id" value="{{$order_info['order_id']}}"> <input type="hidden" id="order_id" name="order_id" value="{{$order_info['order_id']}}">
<input type="hidden" id="user_id" name="user_id" value="{{$order_info['user_id']}}"> <input type="hidden" id="user_id" name="user_id" value="{{$order_info['user_id']}}">
<input type="hidden" id="order_goods_type" name="order_goods_type" value="{{$order_info['order_goods_type']}}">
<div class="tabs-box table-responsive"> <div class="tabs-box table-responsive">
<table class="table table-bordered order-express"> <table class="table table-bordered order-express">
...@@ -491,13 +492,9 @@ ...@@ -491,13 +492,9 @@
<th>生产跟踪</th> <th>生产跟踪</th>
@endif @endif
@if (empty($_REQUEST['tags'])) <th>备注</th>
<th>备注</th>
@endif
@if ($order_info['order_goods_type'] == 1) <th>操作</th>
<th></th>
@endif
<?php <?php
if ($action_name == 'changeOrder' && count($order_items_info) > 1 && in_array($order_info['status'], [1, 2])) { if ($action_name == 'changeOrder' && count($order_items_info) > 1 && in_array($order_info['status'], [1, 2])) {
...@@ -571,20 +568,16 @@ ...@@ -571,20 +568,16 @@
<td><a class="order-track" data-rid="{{$v['rec_id']}}">{{ App\Http\Controllers\getLastTrack($v['rec_id']) }}</a></td> <td><a class="order-track" data-rid="{{$v['rec_id']}}">{{ App\Http\Controllers\getLastTrack($v['rec_id']) }}</a></td>
@endif @endif
@if (empty($_REQUEST['tags']))
<td class="remarks"> <td class="remarks">
@if(!empty($v['remarks'])) @if(!empty($v['remarks']))
{{$v['remarks']}} {{$v['remarks']}}
@endif @endif
</td> </td>
@endif
@if ($order_info['order_goods_type'] == 1) <td>
<td> <!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> -->
<!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> --> <button type="button" class="btn btn-success btn-xs edit-item" data-id="{{$v['rec_id']}}" data-batch="{{$v['batch']}}" data-bid="{{$v['buyer_id']}}" data-remarks="{{$v['remarks']}}">编辑</button>
<button type="button" class="btn btn-success btn-xs edit-item" data-id="{{$v['rec_id']}}" data-batch="{{$v['batch']}}" data-bid="{{$v['buyer_id']}}" data-remarks="{{$v['remarks']}}">编辑</button> </td>
</td>
@endif
@if ($action_name == 'changeOrder' && count($order_items_info) > 1 && in_array($order_info['status'], [1, 2])) @if ($action_name == 'changeOrder' && count($order_items_info) > 1 && in_array($order_info['status'], [1, 2]))
<td><a class="btn btn-danger deletegoods" href="javascript:;" data-id="{{$v['rec_id']}}">删除</a></td> <td><a class="btn btn-danger deletegoods" href="javascript:;" data-id="{{$v['rec_id']}}">删除</a></td>
......
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