更新pcb后台

parent 84a6f0dd
......@@ -2,11 +2,14 @@
namespace App\Http\Controllers;
use App\Http\Page;
use App\Map\PcbOrderInvoiceMap;
use App\Map\PcbOrderMap;
use App\Map\PcbOrderShippingMap;
use App\Model\PaymentDaysModel;
use App\Model\Pcb\PcbOrderModel;
use App\Model\Pcb\PcbPublicModel;
use App\Model\Pcb\PcbPurchaseModel;
use Illuminate\Http\Request;
use App\Http\Requests;
......@@ -76,6 +79,14 @@ class WebController extends Controller
$data['order_type'] = PcbOrderMap::$order_type;
$data['status'] = PcbOrderMap::$status;
$data['shipping'] = objectToArray(DB::connection("order")->table("lie_shipping")->get());
//分页
$response = (new PcbOrderModel())->getList();
$page = new Page($response[3], 10);
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$show = $page->show();
$data['list'] = $response[2];
$data['page'] = $show;
return view("Pcb",$data);
}
//pcb详情
......@@ -175,6 +186,14 @@ class WebController extends Controller
$data['title']='PCB交易列表';
$data['order_type'] = PcbOrderMap::$order_type;
$data['status'] = PcbOrderMap::$status;
//分页
$response = (new PcbPurchaseModel())->getList();
$page = new Page($response[3], 10);
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$show = $page->show();
$data['list'] = $response[2];
$data['page'] = $show;
return view("Pcb",$data);
}
//pcb详情
......
......@@ -387,3 +387,10 @@ function arrayToCommaStr($data,$col,$type=''){
}
return $e;
}
// 计算中文字符串长度
function utf8_strlen($string = null) {
// 将字符串分解为单元
preg_match_all("/./us", $string, $match);
// 返回单元个数
return count($match[0]);
}
\ No newline at end of file
......@@ -58,6 +58,8 @@ class PcbOrderModel extends Model
})->orderBy('order_id','desc');
//getSql();
if ($type == 1){
$input['limit'] = 10;
$input['p'] = isset($input['p']) ? $input['p'] : 1;
$list = $list->paginate($input['limit'], ['*'], 'p', $input['p'])->toArray();
if (!$list) return [20001, '没有数据'];
$data = $this->clearData($list['data']);
......@@ -94,6 +96,12 @@ class PcbOrderModel extends Model
$v['order_type'] = PcbOrderMap::$order_type[$v['order_type']];
$v['status_name'] = PcbOrderMap::$status[$v['status']];
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
$v['pay_time'] = $v['pay_time'] > 0 ? date('Y-m-d H:i:s',$v['pay_time']) : "";
$shipping = $con->table('shipping')->where(['relevance_id' => $v['order_id'],'shipping_type'=>1])->first();
$v['shipping_no'] = $shipping ? $shipping->shipping_no : "";
$v['shipping_name'] = $shipping ? $shipping->shipping_name : "";
$userCompany = DB::connection('order')->table("lie_user_company")->where("user_id",$v['user_id'])->first();
$v['company_name'] = $userCompany ? $userCompany->com_name : "" ;
}
return $data;
}
......
......@@ -13,6 +13,9 @@ class PcbPublicModel
* 插入后台客服审核结果
*/
public function auditOrder($audit_uid,$order_id,$order_sn,$remark,$type = 1){
if ($remark == "" || utf8_strlen($remark) > 30){
return [1009,'只能输入1~30个字符'];
}
$con = DB::connection('pcb');
$data = [
'audit_uid'=>$audit_uid,
......
......@@ -45,6 +45,8 @@ class PcbPurchaseModel extends Model
})->orderBy('purchase_id','desc');
//getSql();
if ($type == 1){
$input['limit'] = 10;
$input['p'] = isset($input['p']) ? $input['p'] : 1;
$list = $list->paginate($input['limit'], ['*'], 'p', $input['p'])->toArray();
if (!$list) return [20001, '没有数据'];
$data = $this->clearData($list['data']);
......@@ -53,11 +55,13 @@ class PcbPurchaseModel extends Model
return $this->clearData($list->get()->toArray());
}
}
//清洗列表数据
//清洗列表数据
private function clearData($data){
if (!is_array($data) || count($data) == 0 || $data == ""){
return [];
}
$con = DB::connection('pcb');
foreach ($data as $k=>&$v){
//查询采购
if ($v['purchase_amount'] > 0){
......@@ -70,6 +74,13 @@ class PcbPurchaseModel extends Model
$v['order_type'] = PcbOrderMap::$order_type[$v['order_type']];
$v['status_name'] = PcbOrderMap::$status[$v['status']];
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
$v['pay_time'] = $v['pay_time'] > 0 ? date('Y-m-d H:i:s',$v['pay_time']) : "";
$shipping = $con->table('shipping')->where(['relevance_id' => $v['order_id'],'shipping_type'=>1])->first();
$v['shipping_no'] = $shipping ? $shipping->shipping_no : "";
$v['shipping_name'] = $shipping ? $shipping->shipping_name : "";
//供应商审核结果
$orderAuditReason2 = $con->table('order_audit_reason')->where(['order_id' => $v['order_id'],'type'=>2])->orderBy("id","desc")->first();
$v['audit_reason'] = $orderAuditReason2 ? $orderAuditReason2->remark : "";
}
return $data;
}
......
......@@ -4,48 +4,17 @@ layui.use(['table','form','element','layer', 'laydate'], function() {
var form = layui.form;
var laydate = layui.laydate;
setTimeout(function () {
table.render({
elem: '#list'
,url:'/api/ApiPcbOrderList'
,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,where: {start_time: $("input[name='start_time']").val(), end_time: $("input[name='end_time']").val()} //如果无需传递额外参数,可不加该参数
,loading:true
,first: true //不显示首页
,last: false //不显示尾页
,id:'Abnormal'
,cols: [[
{field:'order_id', title: 'ID',width:120,align:'center'}
,{field:'user_account', title: '会员账号',width:160,align:'center'}
,{field:'order_sn', title: '交易订单编号',width:160,align:'center'}
,{field:'purchase_sn', title: '采购订单编号',width:160,align:'center'}
,{field:'tiaojia', title: '是否调价',width:160,align:'center'}
,{field:'order_amount', title: '订单金额',width:160,align:'center'}
,{field:'purchase_amount', title: '调整后订单金额',width:160,align:'center'}
,{field:'status_name', title: '订单状态',width:160,align:'center'}
,{field:'order_type', title: '订单类型',width:160,align:'center'}
,{field:'order_pay_type', title: '支付方式',width:160,align:'center'}
,{field:'create_time', title: '下单时间',width:160,align:'center'}
,{field:'adtag', title: 'adtag',width:160,align:'center'}
,{field:'ptag', title: 'ptag',width:160,align:'center'}
,{field:'cahe', title: '操作',templet:'#cahe',width:150,align:'center', fixed: 'right'}
]]
,page:{ }
,done: function(res, curr, count) {
// 若无数据,则禁用导出按钮
if (!count) {
$('.export').addClass('layui-disabled');
// 展示列表下的内容
$('.show-list').click(function(){
var nextTr = $(this).parent('tr').next('.show-other-content');
if (nextTr.css('display') == 'none') {
$(this).parent('tr').siblings('.show-other-content').hide();
nextTr.show();
} else {
$('.export').removeClass('layui-disabled');
}
nextTr.hide();
}
});
},500)
})
form.on('submit(load)', function(data){
form.render();
......@@ -152,6 +121,7 @@ layui.use(['table','form','element','layer', 'laydate'], function() {
}
})
}))
})
//确定发货
......
......@@ -4,46 +4,18 @@ layui.use(['table','form','element','layer', 'laydate'], function() {
var form = layui.form;
var laydate = layui.laydate;
setTimeout(function () {
table.render({
elem: '#list'
,url:'/api/ApiPcbPurchaseList'
,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,where: {start_time: $("input[name='start_time']").val(), end_time: $("input[name='end_time']").val()} //如果无需传递额外参数,可不加该参数
,loading:true
,first: true //不显示首页
,last: false //不显示尾页
,id:'Abnormal'
,cols: [[
{field:'purchase_id', title: 'ID',width:120,align:'center'}
,{field:'user_account', title: '会员账号',width:160,align:'center'}
,{field:'order_sn', title: '交易订单编号',width:160,align:'center'}
,{field:'purchase_sn', title: '采购订单编号',width:160,align:'center'}
,{field:'tiaojia', title: '是否调价',width:160,align:'center'}
,{field:'order_amount', title: '订单金额',width:160,align:'center'}
,{field:'purchase_amount', title: '调整后订单金额',width:160,align:'center'}
,{field:'status_name', title: '订单状态',width:160,align:'center'}
,{field:'order_type', title: '订单类型',width:160,align:'center'}
,{field:'order_pay_type', title: '支付方式',width:160,align:'center'}
,{field:'create_time', title: '下单时间',width:160,align:'center'}
,{field:'cahe', title: '操作',templet:'#cahe',width:150,align:'center', fixed: 'right'}
]]
,page:{ }
,done: function(res, curr, count) {
// 若无数据,则禁用导出按钮
if (!count) {
$('.export').addClass('layui-disabled');
// 展示列表下的内容
$('.show-list').click(function(){
var nextTr = $(this).parent('tr').next('.show-other-content');
if (nextTr.css('display') == 'none') {
$(this).parent('tr').siblings('.show-other-content').hide();
nextTr.show();
} else {
$('.export').removeClass('layui-disabled');
nextTr.hide();
}
}
});
},500)
})
form.on('submit(load)', function(data){
form.render();
......
......@@ -272,7 +272,6 @@
// 展示列表下的内容
$('.show-list').click(function(){
var nextTr = $(this).parent('tr').next('.show-other-content');
if (nextTr.css('display') == 'none') {
$(this).parent('tr').siblings('.show-other-content').hide();
nextTr.show();
......
<style type="text/css">
.c1{background-color: #f9f9f9}
.c2{background-color: #f2f2f2}
</style>
<div class="row">
<div class="wrapper">
<div class="page-content order-details">
......@@ -6,11 +11,11 @@
<table class="table table-bordered order-express">
<tbody>
<tr class="caption">
<th colspan="7" style="text-align: center; background: #f9f9f9;">
<th colspan="7" style="text-align: center; " class="c1">
基础信息
</th>
</tr>
<tr>
<tr class="c2">
<th>会员账号</th>
<th>交易订单编号</th>
<th>是否调价</th>
......@@ -26,7 +31,7 @@
<td><?= @$purchase['purchase_amount']; ?></td>
<td><?= @$orderBase['status_name'] ?></td>
</tr>
<tr>
<tr class="c2">
<th>订单类型</th>
<th>是否返单</th>
<th>公司名称</th>
......@@ -34,7 +39,7 @@
<th>下单时间</th>
<th>支付时间</th>
</tr>
<tr>
<tr >
<td><?= @$orderBase['order_type'] ?></td>
<td><?= $orderBase['is_return_order'] ? "是" : "否" ?></td>
<td><?= $orderBase['company_name'] ?></td>
......@@ -42,15 +47,15 @@
<td><?= @$orderBase['create_time'] ?></td>
<td><?= @$orderBase['pay_time'] ?></td>
</tr>
<tr>
<th>支付方式</th>
<th>采购订单编号</th>
<tr >
<th class="c2">支付方式</th>
<th class="c2">采购订单编号</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<tr style="height: 30px;">
<td><?= $orderBase['order_pay_type'] ?></td>
<td><?= @$purchase['purchase_sn'] ?></td>
<td></td>
......@@ -70,7 +75,7 @@
收货信息
</th>
</tr>
<tr>
<tr class="c2">
<th>收货人</th>
<th>联系方式</th>
<th>收货地址</th>
......@@ -100,6 +105,7 @@
<td colspan="3">
<table class="table table-bordered">
<tbody>
<?php if(@$orderInfo['technical_contact'] != "") {?>
<tr>
<th>技术联系人</th>
<th>联系方式</th>
......@@ -108,6 +114,7 @@
<td><?= @$orderInfo['technical_contact'] ?></td>
<td><?= @$orderInfo['technical_contact_tel'] ?></td>
</tr>
<?php } else{ echo '<tr><td colspan="2">无</td></tr>'; } ?>
</tbody>
</table>
</td>
......@@ -128,6 +135,7 @@
<td colspan="3">
<table class="table table-bordered">
<tbody>
<?php if(count($orderInvoice)) {?>
<tr>
<th>发票类型</th>
<th>发票抬头</th>
......@@ -152,6 +160,7 @@
<td><?= @$orderInvoice['bank_account'] ?></td>
<td></td>
</tr>
<?php } else{ echo '<tr><td colspan="2">不需要开票</td></tr>'; } ?>
</tbody>
</table>
</td>
......@@ -172,7 +181,7 @@
<td colspan="3">
<table class="table table-bordered">
<tbody>
<tr>
<tr class="c2">
<th>板子长宽</th>
<th>板子数量</th>
<th>板子面积</th>
......@@ -188,7 +197,7 @@
<td><?= $orderInfo['design_num'] ?></td>
<td><?= $orderInfo['board_color'] ?></td>
</tr>
<tr>
<tr class="c2">
<th>板子厚度</th>
<th>最小线宽/线距</th>
<th>过孔</th>
......@@ -204,7 +213,7 @@
<td><?= $orderInfo['copper_thickness'] ?></td>
<td><?= $orderInfo['test_type'] ?></td>
</tr>
<tr>
<tr class="c2">
<th>焊盘喷镀</th>
<th>阻焊覆盖</th>
<th>内层铜厚</th>
......@@ -221,20 +230,20 @@
<td></td>
</tr>
<tr>
<th>其他要求</th>
<th class="c2">其他要求</th>
<th colspan="5"><?= $orderBase['order_remark'] ?></th>
</tr>
<tr>
<th>特殊工艺</th>
<th class="c2">特殊工艺</th>
<th colspan="5"><?= $orderInfo['teshu'] ?></th>
</tr>
<tr>
<th>供应商审核结果</th>
<th class="c2">供应商审核结果</th>
<th colspan="5"><?= @$orderAuditReason2['remark'] ?></th>
</tr>
<tr>
<th>确认后审核结果</th>
<th colspan="5"><input style="width: 300px;" value="<?= @$orderAuditReason1['remark'] ?>" type="text" id="content" name="">&nbsp;&nbsp;<button class="layui-btn layui-btn-xs" onclick="AuditOrder()" >提交</button></th>
<th class="c2">确认后审核结果</th>
<th colspan="5"><input style="width: 350px;" value="<?= @$orderAuditReason1['remark'] ?>" type="text" id="content" name="">&nbsp;&nbsp;<button class="layui-btn layui-btn-sm layui-btn-normal" onclick="AuditOrder()" >提交</button></th>
</tr>
</tbody>
</table>
......@@ -256,7 +265,7 @@
<td colspan="3">
<table class="table table-bordered">
<tbody>
<tr>
<tr class="c2">
<th>工程费</th>
<th>拼版费</th>
<th>版费</th>
......@@ -272,7 +281,7 @@
<td><?= $orderAuditDetail['pdf_net'] ?></td>
<td><?= $orderAuditDetail['pcb_ysf_net'] ?></td>
</tr>
<tr>
<tr class="c2">
<th>测试费</th>
<th>加急费</th>
<th>税费</th>
......@@ -289,13 +298,13 @@
<td></td>
</tr>
<tr>
<th>总计</th>
<th class="c2">总计</th>
<th colspan="2"><?= $orderBase['order_amount'] ?></th>
<th>获得积分</th>
<th class="c2">获得积分</th>
<th colspan="2"><?= $orderBase['integral'] ?></th>
</tr>
<tr>
<th>其他费用说明</th>
<th class="c2">其他费用说明</th>
<th colspan="5"></th>
</tr>
</tbody>
......
<style type="text/css">
.c1{background-color: #f9f9f9}
.c2{background-color: #f2f2f2}
</style>
<div class="row">
<div class="wrapper">
<div class="page-content order-details">
......@@ -10,7 +14,7 @@
基础信息
</th>
</tr>
<tr>
<tr class="c2">
<th>采购订单编号</th>
<th>交易订单编号</th>
<th>是否调价</th>
......@@ -53,7 +57,7 @@
收货信息
</th>
</tr>
<tr>
<tr class="c2">
<th>收货人</th>
<th>联系方式</th>
<th>收货地址</th>
......@@ -83,7 +87,7 @@
<td colspan="3">
<table class="table table-bordered">
<tbody>
<tr>
<tr class="c2">
<th>发票类型</th>
<th>发票抬头</th>
<th>公司注册地址</th>
......@@ -96,9 +100,9 @@
<td><?= @$liexinInfo['tax_no'] ?></td>
</tr>
<tr>
<th>公司电话</th>
<th>开户银行</th>
<th>银行卡号</th>
<th class="c2">公司电话</th>
<th class="c2">开户银行</th>
<th class="c2">银行卡号</th>
<th></th>
</tr>
<tr>
......@@ -127,7 +131,7 @@
<td colspan="3">
<table class="table table-bordered">
<tbody>
<tr>
<tr class="c2">
<th>板子长宽</th>
<th>板子数量</th>
<th>板子面积</th>
......@@ -143,7 +147,7 @@
<td><?= $orderInfo['design_num'] ?></td>
<td><?= $orderInfo['board_color'] ?></td>
</tr>
<tr>
<tr class="c2">
<th>板子厚度</th>
<th>最小线宽/线距</th>
<th>过孔</th>
......@@ -160,11 +164,11 @@
<td><?= $orderInfo['test_type'] ?></td>
</tr>
<tr>
<th>焊盘喷镀</th>
<th>阻焊覆盖</th>
<th>内层铜厚</th>
<th>生产周期</th>
<th>交货日期</th>
<th class="c2">焊盘喷镀</th>
<th class="c2">阻焊覆盖</th>
<th class="c2">内层铜厚</th>
<th class="c2">生产周期</th>
<th class="c2">交货日期</th>
<th></th>
</tr>
<tr>
......@@ -176,15 +180,15 @@
<td></td>
</tr>
<tr>
<th>其他要求</th>
<th class="c2">其他要求</th>
<th colspan="5"><?= $orderBase['order_remark'] ?></th>
</tr>
<tr>
<th>特殊工艺</th>
<th class="c2">特殊工艺</th>
<th colspan="5"><?= $orderInfo['teshu'] ?></th>
</tr>
<tr>
<th>供应商审核结果</th>
<th class="c2">供应商审核结果</th>
<th colspan="5"><?= @$orderAuditReason2['remark'] ?></th>
</tr>
</tbody>
......@@ -207,7 +211,7 @@
<td colspan="3">
<table class="table table-bordered">
<tbody>
<tr>
<tr class="c2">
<th>工程费</th>
<th>拼版费</th>
<th>版费</th>
......@@ -224,11 +228,11 @@
<td><?= $orderAuditDetail['pcb_ysf_net'] ?></td>
</tr>
<tr>
<th>测试费</th>
<th>加急费</th>
<th>税费</th>
<th>快递费</th>
<th>其他费用</th>
<th class="c2">测试费</th>
<th class="c2">加急费</th>
<th class="c2">税费</th>
<th class="c2">快递费</th>
<th class="c2">其他费用</th>
<th></th>
</tr>
<tr>
......@@ -240,13 +244,13 @@
<td></td>
</tr>
<tr>
<th>总计</th>
<th class="c2">总计</th>
<th colspan="2"><?= $orderBase['order_amount'] ?></th>
<th>获得积分</th>
<th class="c2">获得积分</th>
<th colspan="2"><?= $orderBase['integral'] ?></th>
</tr>
<tr>
<th>其他费用说明</th>
<th class="c2">其他费用说明</th>
<th colspan="5"></th>
</tr>
</tbody>
......
<form class="layui-form" id="form1">
<div class="layui-collapse layui-box" lay-filter="where">
<div class="layui-colla-item">
<h2 class="layui-colla-title" style="margin: 0">查询条件 (点击收起)</h2>
<div class="layui-colla-content layui-show">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">下单时间:</label>
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="start_time" id="start_time" placeholder="开始时间" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="end_time" id="end_time" placeholder="结束时间" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">会员账号:</label>
<div class="layui-input-inline">
<input type="text" name="user_account" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">交易订单编号:</label>
<div class="layui-input-inline">
<input type="text" name="order_sn" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">采购订单编号:</label>
<div class="layui-input-inline">
<input type="text" name="purchase_sn" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">订单状态:</label>
<div class="layui-input-inline payment-status" style="width: 800px !important;">
<input type="hidden" name="status" value="">
@if(!empty($status) && is_array($status))
@foreach($status as $k=>$v)
<input type="checkbox" lay-filter="*" data-type="status" value="{{$k}}" title="{{$v or '未知'}}" >
@endforeach
@endif
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">订单类型:</label>
<div class="layui-input-inline payment-status">
<input type="hidden" name="order_type" value="">
@if(!empty($order_type) && is_array($order_type))
@foreach($order_type as $k=>$v)
<input type="checkbox" lay-filter="*" data-type="status" value="{{$k}}" title="{{$v or '未知'}}" >
@endforeach
@endif
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">adtag:</label>
<div class="layui-input-inline">
<input type="text" name="adtag" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">ptag:</label>
<div class="layui-input-inline">
<input type="text" name="ptag" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
</div>
</div>
</div>
</div>
<div style="margin-top: 10px">
<div style="float: left;">
<button class="layui-btn" lay-submit="" lay-filter="load">立即查询</button>
<button type="reset" class="layui-btn layui-btn-primary">重置条件</button>
<button class="layui-btn export" >导出</button>
</div>
</div>
</form>
<table class="layui-table" lay-filter="test" id="list"></table>
<script type="text/html" id="cahe">
<a href="/web/PcbPurchaseDetail?purchase_id=@{{ d.purchase_id }}&order_id=@{{ d.order_id }}" class="btn btn-xs btn-outline btn-success"><strong>详情</strong></a>
@{{# if(d.status==3){ }}
<button class="btn btn-xs btn-outline btn-danger" lay-submit="" order_id="@{{ d.purchase_id }}" order_sn="@{{ d.purchase_sn }}" onclick="confirmOrder(@{{ d.purchase_id }})">采购确认</button>
@{{# } }}
</script>
......@@ -459,6 +459,7 @@
@endif
</table>
</div>
<div class="row-fluid pagination">
@if ($username != 'vpadmin@ichunt.com')
<span class="show-list-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