v1

parent 950029e2
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Model\ExportModel;
use App\Model\Server\ServerFinanceModel;
use App\Model\Server\ServerPurModel;
use App\Model\SupplierAccountModel;
......@@ -16,6 +17,9 @@ class ApiController extends Controller
public function Entrance(Request $request, $id ){
$this->$id($request, $id);
}
public function __call($name,$arr){
exit("不存在路径");
}
//登录
private function ApiLogin($request, $id){
Export((new SupplierAccountModel())->Login($request));
......@@ -38,24 +42,19 @@ class ApiController extends Controller
}
//订单列表导出
private function ApiOrderListExport($request, $id){
$input = $request->input();
$input['type'] = 2; //导出类型
$res = (new ServerPurModel($request->appid,$request->key))->OrderList($input,2);
if (!count($res['data']) ){
exit("没有数据");
}
$out = [];
foreach ($res['data'] as $k=>$v){
array_push($out,[
'order_sn'=>$v['order_sn'],
'picking_amount'=>$v['picking_amount'],
'currency'=>$v['currency'],
'pay_type'=>$v['pay_type'],
'status'=>$v['status'],
'create_time'=>$v['create_time'],
]);
}
export_csv($out,['订单号','订单金额','币种','结算方式','状态','创建时间'],'订单列表导出'.time().'.csv');
ExportModel::ApiOrderListExport($request);
}
//退货列表
private function ApiAbnormalList($request, $id){
(new ServerPurModel($request->appid,$request->key))->AbnormalList($request->input());
}
//退货详情
private function ApiAbnormalDetail($request, $id){
(new ServerPurModel($request->appid,$request->key))->AbnormalDetail($request->input());
}
//退货列表导出
private function ApiAbnormalListExport($request, $id){
ExportModel::ApiAbnormalListExport($request);
}
//订单列表
private function ApiOrderDetail($request, $id){
......@@ -67,32 +66,13 @@ class ApiController extends Controller
}
//对账单列表导出
private function ApiAccountCheckingListExport($request, $id){
$input = $request->input();
$input['type'] = 2; //导出类型
$res = (new ServerFinanceModel($request->appid,$request->key))->accountCheckingList($input,2);
if ($res['errcode'] > 0 ){
exit("没有数据");
}
$out = [];
foreach ($res['data'] as $k=>$v){
array_push($out,[
'checking_sn'=>$v['checking_sn'],
'amount'=>$v['amount'],
'currency'=>$v['currency'],
'day_num'=>$v['day_num'],
'finish_time'=>$v['finish_time'],
'create_time'=>$v['create_time'],
'checking_time'=>$v['checking_time'],
'status'=>$v['status'],
]);
}
export_csv($out,['对账单号','账单金额','结算币种','结算方式','结算时间','创建时间','对账时间','状态'],'对账列表导出'.time().'.csv');
ExportModel::ApiAccountCheckingListExport($request);
}
//获取对账单列表明细
private function ApiAccountCheckingDetail($request, $id){
(new ServerFinanceModel($request->appid,$request->key))->accountCheckingDetail($request->input());
}
//退货列表明细
//对账列表明细
private function ApiAccountChangeChecking($request, $id){
$input = $request->input();
$input['checking_name'] = $request->supplier_name;
......
......@@ -73,6 +73,18 @@ class WebController extends Controller
return view('pc',$data);
}
//退货列表
private function AbnormalList($request,$data,$id){
$data['title']='退货列表';
$data['time']=time();
return view('pc',$data);
}
//退货详情
private function AbnormalDetail($request,$data,$id){
$data['title']='退货详情';
$data['time']=time();
return view('pc',$data);
}
//退货列表
private function StockRefundList($request,$data,$id){
$data['title']='欢迎使用云芯系统';
$data['time']=time();
......
<?php
namespace App\Model;
use Request;
use DB;
use App\Model\Server\ServerPurModel;
use App\Model\Server\ServerFinanceModel;
//导出模型
class ExportModel
{
//订单列表导出
static function ApiOrderListExport($request){
$input = $request->input();
$input['type'] = 2; //导出类型
$res = (new ServerPurModel($request->appid,$request->key))->OrderList($input,2);
if (!count($res['data']) ){
exit("没有数据");
}
$out = [];
foreach ($res['data'] as $k=>$v){
array_push($out,[
'order_sn'=>$v['order_sn'],
'picking_amount'=>$v['picking_amount'],
'currency'=>$v['currency'],
'pay_type'=>$v['pay_type'],
'status'=>$v['status'],
'create_time'=>$v['create_time'],
]);
}
export_csv($out,['订单号','订单金额','币种','结算方式','状态','创建时间'],'订单列表导出'.time().'.csv');
}
/*
* 退货列表导出
* 导出内容:退货单号,创建单时间,金额,状态,商家商品编码,型号,品牌,封装,包装方式,MPQ,数量,单价,收货数量
*/
static function ApiAbnormalListExport($request){
$input = $request->input();
$input['type'] = 2; //导出类型
$res = (new ServerPurModel($request->appid,$request->key))->AbnormalDetail($input,2);
if (!count($res['data']) ){
exit("没有数据");
}
$out = [];
foreach ($res['data'] as $k=>$v){
array_push($out,[
'abnormal_sn'=>$v['abnormal_sn'],
'create_time'=>$v['create_time'],
'withdraw_amount'=>$v['withdraw_amount'],
'status'=>$v['status'],
'currency'=>$v['currency'],
'supplier_goods_id'=>$v['supplier_goods_id'],
'goods_name'=>$v['goods_name'],
'supplier_brand_name'=>$v['supplier_brand_name'],
'encap'=>$v['encap'],
'packing_id'=>$v['packing_id'],
'mpq'=>$v['mpq'],
'real_number'=>$v['real_number'],
'initial_price'=>$v['initial_price'],
]);
}
export_csv($out,['退货单号','创建单时间','金额','状态','币种','商品编码','型号','品牌','封装','包装方式','MPQ','数量','单价'],'退货列表导出'.time().'.csv');
}
//对账单列表导出
static function ApiAccountCheckingListExport($request, $id){
$input = $request->input();
$input['type'] = 2; //导出类型
$res = (new ServerFinanceModel($request->appid,$request->key))->accountCheckingList($input,2);
if ($res['errcode'] > 0 ){
exit("没有数据");
}
$out = [];
foreach ($res['data'] as $k=>$v){
array_push($out,[
'checking_sn'=>$v['checking_sn'],
'amount'=>$v['amount'],
'currency'=>$v['currency'],
'day_num'=>$v['day_num'],
'finish_time'=>$v['finish_time'],
'create_time'=>$v['create_time'],
'checking_time'=>$v['checking_time'],
'status'=>$v['status'],
]);
}
export_csv($out,['对账单号','账单金额','结算币种','结算方式','结算时间','创建时间','对账时间','状态'],'对账列表导出'.time().'.csv');
}
}
\ No newline at end of file
<?php
namespace App\Model;
use ClassPreloader\Config;
use Illuminate\Database\Eloquent\Model;
use League\Flysystem\Exception;
use Request;
use DB;
use Illuminate\Support\Facades\Redis;
//价格审核列表
class GoodsAuditModel extends Model
{
protected $connection='yunxin';
protected $table='supplier_account';
protected $primaryKey='id';
public $timestamps = false;
//列表
public function getList($input,$supplier_id = "")
{
$arr = ['p', 'limit','create_time1','create_time2'];
$input=TrimX($input,true,$arr);
//查询数据
$list = $this->where(function ($query) use ($input,$supplier_id) {
$query->where('supplier_id', '=', $supplier_id);
foreach ($input as $k => $v){
$v = trim($v);
switch ($k){
case "p":
case "limit":
continue;
break;
case "create_time1":
$query->where('create_time', '>=', strtotime($v));
break;
case "create_time2":
$query->where('create_time', '<=',strtotime($v));
break;
}
}
});
$list = $list->orderBy('create_time','desc')->paginate(@$input['limit'] ? @$input['limit'] : 10, ['*'], 'p', @$input['p'] ? @$input['p']:1 )->toArray();
if (!$list) return [20001, '没有数据'];
$changeType = StockChangeItemsMap::$change_type;
$OutData = []; //返回数据
foreach ($list['data'] as $k=>&$v){
array_push($OutData,[
'change_type'=>$changeType[$v['change_type']],
'create_time'=>timeToDate($v['create_time']),
'doc_sn'=>$v['change_type'] == 1 ? $v['picking_sn'] : $v['abnormal_sn'],
'change_number'=>$v['change_number']
]);
}
return [0, '成功', $OutData, $list['total']];
}
/*
* 忘记密码
* @param int $account_id 账号id
*/
public function ForgetPassword($request){
$account_name = $request->input('account_name');
$new_password = $request->input('new_password');
$mobile_code= Request::input('moblie_code');//手机验证码
$yunxin_mobile_code = Redis::get('yunxin_mobile_code_'.$account_name);
if ($yunxin_mobile_code != $mobile_code){
return [1001,'手机验证码不正确'];
}
$account = $this->where("id",$request->account_id)->first();
if (!$account){
return [1002,'不存在此账号'];
}
if (utf8_strlen($new_password) != 32 ) return [1001,'新密码长度不对'];
$password = createPassword($new_password);
$this->where("id",$request->account_id)->update(['password'=>$password]);
Redis::del("yunxin_login_".$request->yunxin_token); //删除缓存
return [0,"成功,请登录"];
}
}
\ No newline at end of file
......@@ -41,24 +41,24 @@ class ServerPurModel
}
}
//获取库存变化列表
public function StockChangeItemsList($data){
return $this->push( '/thridapi/StockChangeItems',$data);
public function StockChangeItemsList($data,$type =1){
return $this->push( '/thridapi/StockChangeItems',$data,$type);
}
//获取订单列表
public function OrderList($data,$type = 1){
return $this->push( '/thridapi/OrderList',$data,$type);
}
//获取订单明细
public function OrderDetail($data){
return $this->push( '/thridapi/OrderDetail',$data);
public function OrderDetail($data,$type =1){
return $this->push( '/thridapi/OrderDetail',$data,$type);
}
//获取退货列表
public function AbnormalList($data){
return $this->push( '/thridapi/AbnormalList',$data,1);
public function AbnormalList($data,$type =1){
return $this->push( '/thridapi/AbnormalList',$data,$type);
}
//获取退货明细
public function AbnormalDetail($data){
return $this->push( '/thridapi/AbnormalDetail',$data);
public function AbnormalDetail($data,$type =1){
return $this->push( '/thridapi/AbnormalDetail',$data,$type);
}
......
;!function () {
window.app = {
init: function () {
this.tableList(1);
//刷新搜索
$("#search").click(function () {
tableList(1)
})
},
tableList:function (page) {
var res = ajax_push(URL_YUNXIN + '/api/ApiAbnormalDetail',{'p':page,'abnormal_id':$("#abnormal_id").val()})
if (res.errcode == 0) {
var other = res.other;
$(".abnormal_sn").html(other.abnormal_sn);
$(".create_time").html(other.create_time);
$(".status").html(other.status);
$(".amount").html(other.amount);
$(".currency").html(other.currency);
var html;
for (i = 0; i < res.data.length; i++) {
var s = res.data[i];
html += "<tr class=\"you\"> " +
"<td><span class=\"t1\">"+s.supplier_goods_id+"</span></td>" +
"<td><span class=\"t1\">"+s.goods_name+"</span></td>" +
"<td><span class=\"t1\">"+s.supplier_brand_name+"</span></td>" +
"<td><span class=\"t1\">"+s.encap+"</span></td>" +
"<td><span class=\"t1\">"+s.mpq+"</span></td>" +
"<td><span class=\"t1\">"+s.putaway_number+"</span></td>" +
"<td><span class=\"t1\">"+s.initial_price+"</span></td>" +
"</tr>"
}
$("#shopListContent").html(html)
layui.laypage.render({
elem: 'pagination',
theme: '#1080d0',
count: res.count,
groups:10,
curr: page,
jump:function (obj, first) {
if(!first){
this.tableList(obj.curr)
}
}
});
} else {
alert_err(res.errmsg)
return false;
}
}
}, $(function () {
app.init();
})
}();
\ No newline at end of file
;!function () {
window.app = {
init: function () {
app.tableList(1);
//搜索
$("#search").click(function () {
app.tableList(1);
})
//导出
$("#export").click(function () {
exportUrl('/api/ApiAbnormalListExport','form1','确定导出数据?')
})
//下单时间选择
layui.laydate.render({
elem: '.order-time-1',
theme: '#1080d0'
});
layui.laydate.render({
elem: '.order-time-2',
theme: '#1080d0'
});
},
//列表数据查询
tableList: function (page) {
var postData = {
'p':page,
'abnormal_sn':$("input[name='abnormal_sn']").val(),
'goods_name':$("input[name='goods_name']").val(),
'status':$("input[name='status']").val(),
'create_time1':$("input[name='create_time1']").val(),
'create_time2':$("input[name='create_time2']").val(),
}
var res = ajax_push(URL_YUNXIN + '/api/ApiAbnormalList',postData)
if (res.errcode == 0) {
var html = "";
if(res.data.length > 0) {
for (i = 0; i < res.data.length; i++) {
var s = res.data[i];
html += "<tr class=\"you\"> " +
"<td><span class=\"t1\">"+s.abnormal_sn+"</span></td>" +
"<td><span class=\"t1\">"+s.create_time+"</span></td>" +
"<td><span class=\"t1\">"+s.currency+"</span></td>" +
"<td><span class=\"t1\">"+s.status+"</span></td>" +
"<td><span class=\"t1\">"+s.amount+"</span></td>" +
"<td><a href=\"/web/AbnormalDetail?id="+s.abnormal_id+"\" class=\"lineBlock va-m operation-1\"><i class=\"iconfont icon-mingxi-\"></i><em>明细</em></a></td></tr>"
}
}else{
html = "<tr class=\"you\"><td colspan='9' style='text-align: center;'><span class=\"t1\" style='color: #cccccc'>没有数据</span></td></tr>";
}
$("#shopListContent").html(html)
layui.laypage.render({
elem: 'pagination',
theme: '#1080d0',
count: res.count,
groups:10,
curr: page,
jump:function (obj, first) {
if(!first){
app.tableList(obj.curr)
}
}
});
} else {
alert_err(res.errmsg)
return false;
}
}
}, $(function () {
app.init();
})
}();
\ No newline at end of file
......@@ -92,18 +92,24 @@
</dd>
</dl>
</li>
<li>
<li class="<?php if( in_array($id,['OrderList','OrderDetail','AbnormalList','AbnormalDetail']) !== false ) echo "curr" ?>">
<a href="javascript:;" class="bx">
<i class="iconfont icon-dingdanguanli- va-m"></i>
<span class="t1 lineBlock va-m">订单管理</span>
<b class="iconfont icon-xiala-"></b>
</a>
<dl <?php if( in_array($id,['OrderList','OrderDetail']) !== false ) echo "style='display: block;'" ?>>
<dd class="curr">
<dl style='display: block;'>
<dd class=" <?php if( in_array($id,['OrderList','OrderDetail']) !== false ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/OrderList">订单列表</a>
</dd>
</dl>
<dl style='display: block;'>
<dd class=" <?php if( in_array($id,['AbnormalList','AbnormalDetail']) !== false ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/AbnormalList">退货列表</a>
</dd>
</dl>
</li>
<li >
<a href="javascript:;" class="bx">
......
<div class="lx-content-r fr">
<div class="tit-bar">
<a href="">订单管理</a>
<span>&gt;</span>
<a href="">退货列表</a>
<span>&gt;</span>
<a class="text" href="">{{ $title }}</a>
</div>
<div class="con-section shop-list">
<p class="text">{{ $title }}</p>
<div class="detail-list">
<div class="lineBlock va-m mr100">
<span class="lineBlock t1">退货单号:</span>
<span class="lineBlock t2 abnormal_sn"></span>
</div>
<div class="lineBlock va-m mr126">
<span class="lineBlock t1">创建时间:</span>
<span class="lineBlock t2 create_time"></span>
</div>
<div class="mt20">
<div class="lineBlock va-m mr26">
<span class="lineBlock t3">单据状态:</span>
<span class="lineBlock t4 status"></span>
</div>
<div class="lineBlock va-m mr40">
<span class="lineBlock t3">金额:</span>
<span class="lineBlock t4 amount"></span>
</div>
<div class="lineBlock va-m">
<span class="lineBlock t3">结算币种:</span>
<span class="lineBlock t4 currency"></span>
</div>
</div>
</div>
<div class="table-list" id="shopList">
<table>
<tr>
<th>商家商品编码<b></b></th>
<th>型号<b></b></th>
<th>品牌<b></b></th>
<th>封装</th>
<th>包装方式</th>
<th>入库数量</th>
<th>单价</th>
</tr>
<tbody id="shopListContent">
</tbody>
</table>
</div>
<div class="pagination-with" id="pagination"></div>
</div>
</div>
<!--隐藏域-->
<input type="hidden" value="{{ @$_GET['id'] }}" id="abnormal_id">
\ No newline at end of file
<div class="lx-content-r fr">
<div class="tit-bar">
<a href="">库存管理</a>
<span>&gt;</span>
<a class="text" href="">订单列表</a>
</div>
<div class="con-section shop-list">
<p class="text">订单列表</p>
<form action="">
<div class="search-bar">
<div class="lineBlock input-inline va-m">
<label class="tag">退货单号:</label>
<input type="text" class="inp w180" name="order_sn" >
</div>
<div class="lineBlock input-inline va-m">
<label class="tag">型号:</label>
<input type="text" class="inp w180" name="goods_name">
</div>
<div class="lineBlock input-inline va-m">
<label class="tag">状态:</label>
<select class="sel w180" name="status">
<option value=""></option>
<option value="-10">已取消</option>
<option value="4">已完成</option>
</select>
</div>
<div class="lineBlock input-inline va-m">
<label class="tag">创建时间:</label>
<input type="text" name="create_time1" class="inp w120 order-time-1" lay-key="1">
<span class="lineBlock va-m line">~</span>
<input type="text" name="create_time2" class="inp w120 order-time-2" lay-key="2">
</div>
<div class="lineBlock input-inline va-m" id="search">
<a href="javascript:;" class="search-btn">
<i class="iconfont icon-chaxun-"></i>
<span>查询</span>
</a>
</div>
<div class="lineBlock input-inline va-m" id="export">
<a href="javascript:;" class="export-btn">
<i class="iconfont icon-daochu-"></i>
<span>导出</span>
</a>
</div>
</div>
</form>
<div class="table-list" id="shopList">
<table>
<tr>
<th>退货单号<b></b></th>
<th>创建时间<b></b></th>
<th>币种<b></b></th>
<th>金额<b></b></th>
<th>状态<b></b></th>
<th>操作</th>
</tr>
<tbody id="shopListContent">
</tbody>
</table>
</div>
<div class="pagination-with" id="pagination"></div>
</div>
</div>
<div class="lx-content-r fr">
<div class="tit-bar">
<a href="">库存管理</a>
<a href="">订单管理</a>
<span>&gt;</span>
<a class="text" href="">订单列表</a>
<a class="text" href="">{{ $title }}</a>
</div>
<div class="con-section shop-list">
<p class="text">订单列表</p>
<p class="text">{{ $title }}</p>
<form action="">
<div class="search-bar">
<div class="lineBlock input-inline va-m">
......
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