Commit 139e2153 by 朱继来

自营添加备注

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