setter
parent
f64e7696a4
commit
a17bb70b56
|
@ -173,7 +173,7 @@ class Index extends Base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$search[] = ['phone_active', '=', AccountModel::COMMON_ON];
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$items = AccountRepository::getInstance()->getAndHandleAccountList($search, [], $page, $size, function ($q) use ($other) {
|
$items = AccountRepository::getInstance()->getAndHandleAccountList($search, [], $page, $size, function ($q) use ($other) {
|
||||||
|
|
|
@ -164,6 +164,7 @@ class Category extends Base
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$item['path'] = CategoryModel::getPath($item['pid']);
|
$item['path'] = CategoryModel::getPath($item['pid']);
|
||||||
|
$item['name'] = "name";
|
||||||
(new CategoryModel())->create($item);
|
(new CategoryModel())->create($item);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return $this->json();
|
return $this->json();
|
||||||
|
|
|
@ -297,10 +297,8 @@ class Order extends Base
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
$businessRemarks = trim(input('business_remarks/s', ''));
|
$data = input("item/a",[]);
|
||||||
|
$item->save($data);
|
||||||
$item->save(['business_remarks' => $businessRemarks]);
|
|
||||||
|
|
||||||
return $this->json();
|
return $this->json();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,6 +580,7 @@ class Order extends Base
|
||||||
public function exportOrderInfo()
|
public function exportOrderInfo()
|
||||||
{
|
{
|
||||||
$id = input("id/d");
|
$id = input("id/d");
|
||||||
|
$type = input("type/s","save");
|
||||||
$order = OrderModel::findById($id, [], function ($q) {
|
$order = OrderModel::findById($id, [], function ($q) {
|
||||||
return $q->with([ 'skus']);
|
return $q->with([ 'skus']);
|
||||||
});
|
});
|
||||||
|
@ -697,18 +696,56 @@ class Order extends Base
|
||||||
//第一种保存方式
|
//第一种保存方式
|
||||||
$writer = new Xlsx($spreadsheet);
|
$writer = new Xlsx($spreadsheet);
|
||||||
//保存的路径可自行设置
|
//保存的路径可自行设置
|
||||||
$path = public_path()."storage/order_excel/" ;
|
$path = "storage/order_excel/" ;
|
||||||
if(!is_writable($path)){
|
if(!is_writable($path)){
|
||||||
return $this->json(4001,"上传文件夹需要写入权限");
|
return $this->json(4001,"上传文件夹需要写入权限");
|
||||||
}
|
}
|
||||||
$path.=date("Ymd")."/";
|
$path.=date("Ymd")."/";
|
||||||
if(!is_dir($path)){
|
if(!is_dir(public_path().$path)){
|
||||||
mkdir($path);
|
mkdir(public_path().$path);
|
||||||
}
|
}
|
||||||
$downloadFileName = $order->contacts . "_" . $order->phone . "_" . $order->coding ;
|
$downloadFileName = $order->contacts . "_" . $order->phone . "_" . $order->coding ;
|
||||||
$fileName = $downloadFileName . ".xlsx";
|
$fileName = $downloadFileName . ".xlsx";
|
||||||
$filepath = $path. $fileName;
|
$filepath = public_path().$path. $fileName;
|
||||||
$writer->save($filepath);
|
$writer->save($filepath);
|
||||||
return download($filepath,$downloadFileName );
|
if($type =="save"){
|
||||||
|
return download($filepath,$downloadFileName );
|
||||||
|
}else{
|
||||||
|
return $this->json(0,"success",["url"=>$path.$fileName]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出订单信息
|
||||||
|
* */
|
||||||
|
public function exportOrderInfoZip()
|
||||||
|
{
|
||||||
|
$urls = input("urls/s",'');
|
||||||
|
$urls = array_filter(explode(",", $urls));
|
||||||
|
if(empty($urls)){
|
||||||
|
return $this->json("4001","空的文件");
|
||||||
|
} if(count($urls)>10){
|
||||||
|
return $this->json("4001","最多支持10个文件");
|
||||||
|
}
|
||||||
|
$zipdir = date("Ymd_His_") .randomStr();
|
||||||
|
$downloadZipFilename = $zipdir. '.zip';
|
||||||
|
$zipFilename = public_path() . 'storage/order_excel_zip/' . $downloadZipFilename;
|
||||||
|
$zip = new \ZipArchive();
|
||||||
|
// 打开一个zip文档,ZipArchive::OVERWRITE:如果存在这样的文档,则覆盖;ZipArchive::CREATE:如果不存在,则创建
|
||||||
|
$res = $zip->open($zipFilename, $zip::OVERWRITE | $zip::CREATE);
|
||||||
|
$zip->addEmptyDir($zipdir);
|
||||||
|
if($res){
|
||||||
|
foreach ($urls as $url) {
|
||||||
|
$filrnamearr = explode("/",$url);
|
||||||
|
$filrname = end($filrnamearr);
|
||||||
|
$zip->addFile(public_path() . $url, $zipdir . "/" . $filrname);
|
||||||
|
}
|
||||||
|
$zip->close();
|
||||||
|
|
||||||
|
return download($zipFilename, $downloadZipFilename);
|
||||||
|
}
|
||||||
|
return $this->json(5001,"创建压缩文件失败");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -469,6 +469,7 @@ class OrderRepository extends Repository
|
||||||
$arr['is_activity'] = $sku->is_activity;
|
$arr['is_activity'] = $sku->is_activity;
|
||||||
$arr['activity_type'] = $sku->activity_type;
|
$arr['activity_type'] = $sku->activity_type;
|
||||||
$arr['sku_unit'] = $sku->unit;
|
$arr['sku_unit'] = $sku->unit;
|
||||||
|
$arr['subtotal'] = $sku->original_price*$dataSku[$sku->coding];
|
||||||
$insert[] = $arr;
|
$insert[] = $arr;
|
||||||
|
|
||||||
if ($sku->is_virtual > 0) {
|
if ($sku->is_virtual > 0) {
|
||||||
|
|
|
@ -209,6 +209,47 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
||||||
exportFile(type, ids, isScore);
|
exportFile(type, ids, isScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// toolbar 导出物流
|
||||||
|
case 'export-zip':
|
||||||
|
|
||||||
|
let thischeckStatus = table.checkStatus('table-container'); //idTest 即为基础参数 id 对应的值
|
||||||
|
let thisids = [];
|
||||||
|
$(thischeckStatus.data).each(function (i, item) {
|
||||||
|
thisids.push(item.id);
|
||||||
|
});
|
||||||
|
if(thisids.length==0){
|
||||||
|
layer.msg("请勾选数据");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let index_layer = layer.msg("导出中",{icon: 16,time: 100000,shade : [0.5 , '#000' , true]});
|
||||||
|
//console.log(thisids);
|
||||||
|
let excelUrls = [];
|
||||||
|
|
||||||
|
for(let aa =0;aa<thisids.length;aa++){
|
||||||
|
$.ajax('/manager/mall/order/export-order-info', {
|
||||||
|
data: {id: thisids[aa],type:"zip"},
|
||||||
|
async: false,
|
||||||
|
dataType: 'json',//服务器返回json格式数据
|
||||||
|
type: 'post',//HTTP请求类型
|
||||||
|
timeout: 10000,//超时时间设置为10秒;
|
||||||
|
success: function (res) {
|
||||||
|
// console.log(res)
|
||||||
|
if (res.code === 0) {
|
||||||
|
excelUrls.push(res.data.url);
|
||||||
|
}else{
|
||||||
|
layer.msg("导出订单失败id:"+thisids[aa]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, type, errorThrown) {
|
||||||
|
layer.msg("导出订单失败id:"+thisids[aa]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
layer.close(index_layer)
|
||||||
|
window.open("/manager/mall/order/export-order-info-zip?urls="+excelUrls.join(","));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
if (layEvent !== 'LAYTABLE_COLS' && layEvent !== 'LAYTABLE_EXPORT') {
|
if (layEvent !== 'LAYTABLE_COLS' && layEvent !== 'LAYTABLE_EXPORT') {
|
||||||
|
@ -246,6 +287,8 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
||||||
type: 'datetime',
|
type: 'datetime',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('.location-operate-page').length > 0) {
|
if ($('.location-operate-page').length > 0) {
|
||||||
|
@ -282,6 +325,21 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
||||||
if ($('.location-detail-page').length > 0) {
|
if ($('.location-detail-page').length > 0) {
|
||||||
miniTab.listen();
|
miniTab.listen();
|
||||||
|
|
||||||
|
$(".layui-datetime").each(function () {
|
||||||
|
laydate.render({
|
||||||
|
elem: this,
|
||||||
|
type: 'datetime',
|
||||||
|
});
|
||||||
|
})
|
||||||
|
$(".layui-date").each(function () {
|
||||||
|
laydate.render({
|
||||||
|
elem: this,
|
||||||
|
type: 'date',
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//监听行工具条
|
//监听行工具条
|
||||||
table.on('tool(table-container)', function (obj) {
|
table.on('tool(table-container)', function (obj) {
|
||||||
let layEvent = obj.event;
|
let layEvent = obj.event;
|
||||||
|
@ -385,7 +443,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
||||||
layer.close(indexLoad);
|
layer.close(indexLoad);
|
||||||
layer.msg(res.msg)
|
layer.msg(res.msg)
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
$("#order_original_price").text(res.data.original_price);
|
$("#order_original_price").val(res.data.original_price);
|
||||||
insTb.refresh();
|
insTb.refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -104,6 +104,7 @@
|
||||||
<!-- toolbar -->
|
<!-- toolbar -->
|
||||||
<script type="text/html" id="toolbar-tpl">
|
<script type="text/html" id="toolbar-tpl">
|
||||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||||
|
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="export-zip">批量导出</a>
|
||||||
<!-- <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="export-list">导出待发货物流</a>-->
|
<!-- <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="export-list">导出待发货物流</a>-->
|
||||||
<!-- <a class="layui-btn layui-btn-warm layui-btn-sm" id="upload-order" href="javascript:;">导入待发货物流</a>-->
|
<!-- <a class="layui-btn layui-btn-warm layui-btn-sm" id="upload-order" href="javascript:;">导入待发货物流</a>-->
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 0px;">
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 0px;">
|
||||||
<legend>订单信息</legend>
|
<legend>订单信息</legend>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div>
|
<div class="layui-form">
|
||||||
<table class="layui-table" lay-even="" lay-skin="nob">
|
<table class="layui-table" lay-even="" lay-skin="nob">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -16,7 +16,12 @@
|
||||||
<td>订单状态:{$statusList[$item['status']] ?? ''}</td>
|
<td>订单状态:{$statusList[$item['status']] ?? ''}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>应付总价(元):<span id="order_original_price">{$item.original_price ?? 0}</span></td>
|
<td>应付总价(元):
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input id="order_original_price" type="text" class="layui-input " name="item[original_price]" value="{$item.original_price ?? ''}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>下单时间:{$item.created_at ?? ''}</td>
|
||||||
<!-- <td>实付总价(元):{$item.price ?? 0}</td>-->
|
<!-- <td>实付总价(元):{$item.price ?? 0}</td>-->
|
||||||
</tr>
|
</tr>
|
||||||
<!-- <tr>-->
|
<!-- <tr>-->
|
||||||
|
@ -34,12 +39,16 @@
|
||||||
{/if}
|
{/if}
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>下单时间:{$item.created_at ?? ''}</td>
|
<td>发货时间:
|
||||||
<!-- <td>付款时间:{$item.paid_at ?? ''}</td>-->
|
<div class="layui-input-inline">
|
||||||
</tr>
|
<input type="text" class="layui-input layui-datetime" name="item[shipped_at]" value="{$item.shipped_at ?? ''}">
|
||||||
<tr>
|
</div>
|
||||||
<td>发货时间:{$item.shipped_at ?? ''}</td>
|
</td>
|
||||||
<td>确认收货时间:{$item.accepted_at ?? ''}</td>
|
<td>确认收货时间:
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" class="layui-input layui-datetime" name="item[accepted_at]" value="{$item.accepted_at ?? ''}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- <tr>-->
|
<!-- <tr>-->
|
||||||
<!-- <td>物流方式:{$item.pick_self == 1 ? '自提' : '邮寄'}</td>-->
|
<!-- <td>物流方式:{$item.pick_self == 1 ? '自提' : '邮寄'}</td>-->
|
||||||
|
@ -62,15 +71,35 @@
|
||||||
<!-- </tr>-->
|
<!-- </tr>-->
|
||||||
{/if}
|
{/if}
|
||||||
<tr>
|
<tr>
|
||||||
<td>婚期:{$item.wedding_date ?? ''}</td>
|
<td>婚期 :
|
||||||
<td>期望送达日期:{$item.expected_delivery_date ?? ''}</td>
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" class="layui-input layui-date" name="item[wedding_date]" value="{$item.wedding_date ?? ''}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>期望送达日期:
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" class="layui-input layui-date" name="item[expected_delivery_date]" value="{$item.expected_delivery_date ?? ''}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>收货地址:{$item.address ?? ''}</td>
|
<td>收货地址:
|
||||||
<td>联系人:{$item.contacts ?? ''}</td>
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" class="layui-input" name="item[address]" value="{$item.address ?? ''}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>联系人 :
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="item[contacts]" class="layui-input" value="{$item.contacts ?? ''}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>联系电话:{$item.phone ?? ''}</td>
|
<td>联系电话:
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="item[phone]" class="layui-input" value="{$item.phone ?? ''}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
{if $item.pick_self != 1}
|
{if $item.pick_self != 1}
|
||||||
|
@ -80,6 +109,16 @@
|
||||||
<!-- <tr>-->
|
<!-- <tr>-->
|
||||||
<!-- <td>买家备注:{$item.remarks ?? ''}</td>-->
|
<!-- <td>买家备注:{$item.remarks ?? ''}</td>-->
|
||||||
<!-- </tr>-->
|
<!-- </tr>-->
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<button class="layui-btn layui-btn-normal" data-url="/manager/mall/order/info?id={$item.id}" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<div class="layui-row upload-file-div">
|
<div class="layui-row upload-file-div">
|
||||||
<div class=" layui-col-xs12 layui-col-md8">
|
<div class=" layui-col-xs12 layui-col-md8">
|
||||||
<input class="layui-input upload-file-value" name="item[src]" type="text" value="">
|
<input class="layui-input upload-file-value" name="item[src]" type="text" value="">
|
||||||
<div class="layui-form-mid layui-word-aux">图片尺寸:最低高度为200px</div>
|
<div class="layui-form-mid layui-word-aux">图片尺寸:710px*400px</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-xs12 layui-col-md3">
|
<div class="layui-col-xs12 layui-col-md3">
|
||||||
<span>
|
<span>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<div class="layui-row upload-file-div">
|
<div class="layui-row upload-file-div">
|
||||||
<div class=" layui-col-xs12 layui-col-md8">
|
<div class=" layui-col-xs12 layui-col-md8">
|
||||||
<input class="layui-input upload-file-value" name="item[src]" type="text" value="{$item.src ?? ''}">
|
<input class="layui-input upload-file-value" name="item[src]" type="text" value="{$item.src ?? ''}">
|
||||||
<div class="layui-form-mid layui-word-aux">图片尺寸:最低高度为200px</div>
|
<div class="layui-form-mid layui-word-aux">图片尺寸:710px*400px</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-xs12 layui-col-md3">
|
<div class="layui-col-xs12 layui-col-md3">
|
||||||
<span>
|
<span>
|
||||||
|
|
Loading…
Reference in New Issue