Commit 315afce2 by 朱继来

fix

parents 4ccd94bc cf26a7d1
......@@ -204,7 +204,7 @@ class ApiController extends Controller
$result = $OrderItemsModel->updateData($data);
if($result){
if($result !== false){
$this->Export(0, '编辑明细成功');
}else{
$this->Export(1, '编辑明细失败');
......
......@@ -1164,29 +1164,42 @@
// 编辑商品明细
$('.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 = '';
content = '<div class="form-horizontal">\
<div class="form-group">';
if (order_goods_type == 1) {
content += '<label class="col-sm-3 control-label"><i class="error">*</i> 批次</label>';
} else {
content += '<label class="col-sm-3 control-label"> 批次</label>';
}
content += '<div class="col-sm-9">\
<input type="text" class="form-control" name="batch" value="'+item_batch+'" placeholder="请填写批次" style="width:200px;">\
</div>\
</div>';
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">\
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">\
......@@ -1194,14 +1207,18 @@
'+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">';
content += '<label class="col-sm-3 control-label">备注</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'],
......@@ -1211,10 +1228,10 @@
//提交事件
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) {
if (order_goods_type == 1 && !batch) {
layer.tips('请填写批次', $('input[name=batch]'));
return false;
}
......
......@@ -24,6 +24,7 @@
<input type="hidden" id="user_id" name="user_id" value="{{$order_info['user_id']}}">
<input type="hidden" id="new_client_price" name="new_client_price" value="{{$order_price_info['new_client_price']}}">
<input type="hidden" id="order_type_extend" name="order_type_extend" value="{{$order_info['order_type_extend']}}">
<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">
......@@ -507,13 +508,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])) {
......@@ -587,20 +584,18 @@
<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> -->
@if ($order_info['status'] != -1)
<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>
@endif
</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>
......@@ -613,7 +608,7 @@
@if ($order_info['order_remark'])
<tr>
<td>订单备注信息:</td>
<td colspan="16">{{$order_info['order_remark']}}</td>
<td colspan="17">{{$order_info['order_remark']}}</td>
</tr>
@endif
......
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