feat: #10000 更新
This commit is contained in:
parent
0555b4a536
commit
9c86453d7c
@ -61,7 +61,7 @@ class GoodsSkusController extends Controller
|
||||
]);
|
||||
$rolesName = $request->user()->getRoleNames()->toArray();
|
||||
foreach ($goodsSkus as &$sku) {
|
||||
$lastInventoryTime = $sku['daily']['inventory_time'];
|
||||
$lastInventoryTime = $sku['daily']['inventory_time'] ?: date('Y-m-d 07:00:00');
|
||||
$orderDetail = BusinessOrderItem::query()
|
||||
->select(DB::raw($fields))
|
||||
->with(['shop:id,name'])
|
||||
|
||||
@ -57,6 +57,7 @@ class ShipController extends Controller
|
||||
$sender->mobile = $item['mobile'];
|
||||
$sender->sort = $item['sort'];
|
||||
$sender->status = $item['status'];
|
||||
$sender->timed_delivery_code = $item['timed_delivery_code'];
|
||||
$sender->save();
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ class WayBillService
|
||||
$faceSheet->setShop($shopShip);
|
||||
foreach ($order as $item) {
|
||||
[$sender, $orderInfo, $wpCode] = $this->prepareRequest($item, $shopShip);
|
||||
$waybill = $this->saveWayBill($item, $shopShip);
|
||||
$waybill = $this->saveWayBill($item, $shopShip, $sender);
|
||||
|
||||
if (empty($waybill->id)) {
|
||||
$resp = $faceSheet->getWayBill($sender, $orderInfo, $wpCode);
|
||||
@ -114,9 +114,8 @@ class WayBillService
|
||||
return [$documents, $orderIds];
|
||||
}
|
||||
|
||||
private function saveWayBill($order, $shop)
|
||||
private function saveWayBill($order, $shop, $senderConfig)
|
||||
{
|
||||
$senderConfig = $shop->senders[0];
|
||||
$waybill = Waybill::query()->firstOrNew(
|
||||
['order_sn' => $order['order_sn']]
|
||||
);
|
||||
@ -179,18 +178,6 @@ class WayBillService
|
||||
private function prepareRequest($order, $shopShip)
|
||||
{
|
||||
$this->getTimedDelivery($order);
|
||||
$senderConfig = $shopShip->senders[0];
|
||||
$sender = [
|
||||
'address' => [
|
||||
'city' => $senderConfig['city'],
|
||||
'country' => $senderConfig['country'],
|
||||
'detail' => $senderConfig['detail'],
|
||||
'district' => $senderConfig['district'],
|
||||
'province' => $senderConfig['province'],
|
||||
],
|
||||
'name' => $senderConfig['name'],
|
||||
'mobile' => $senderConfig['mobile'],
|
||||
];
|
||||
|
||||
$this->setObjectId();
|
||||
|
||||
@ -209,6 +196,29 @@ class WayBillService
|
||||
}
|
||||
}
|
||||
|
||||
$senderConfig = [];
|
||||
foreach ($shopShip->senders as $sender) {
|
||||
if ($sender['timed_delivery_code'] === $this->timedDeliveryCode) {
|
||||
$senderConfig = $sender;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($senderConfig)) {
|
||||
abort(404, '发货人信息未匹配');
|
||||
}
|
||||
$sender = [
|
||||
'address' => [
|
||||
'city' => $senderConfig['city'],
|
||||
'country' => $senderConfig['country'],
|
||||
'detail' => $senderConfig['detail'],
|
||||
'district' => $senderConfig['district'],
|
||||
'province' => $senderConfig['province'],
|
||||
],
|
||||
'name' => $senderConfig['name'],
|
||||
'mobile' => $senderConfig['mobile'],
|
||||
];
|
||||
|
||||
$orderInfo = [
|
||||
'logistics_services' => [
|
||||
'TIMED-DELIVERY' => [
|
||||
@ -336,7 +346,7 @@ class WayBillService
|
||||
->where('shop_id', $shopId)
|
||||
->with([
|
||||
'senders' => function ($query) {
|
||||
$query->orderBy('sort')->first();
|
||||
$query->where('status', 1)->orderBy('sort');
|
||||
}
|
||||
])
|
||||
->first();
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTimedDeliveryCodeToShopSendersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (Schema::hasColumns('shop_senders', ['timed_delivery_code'])) {
|
||||
return;
|
||||
}
|
||||
Schema::table('shop_senders', function (Blueprint $table) {
|
||||
$table->integer('timed_delivery_code')->default(247)->comment('地址类型: 247-电商标快,266-空运');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('shop_senders', function (Blueprint $table) {
|
||||
$table->dropColumn(['timed_delivery_code']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1 +1 @@
|
||||
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a[data-v-5959e012]{text-decoration:none;color:#fff}.block[data-v-5959e012]{margin-top:20px}
|
||||
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a[data-v-446dc800]{text-decoration:none;color:#fff}.block[data-v-446dc800]{margin-top:20px}
|
||||
2
public/dist/index.html
vendored
2
public/dist/index.html
vendored
@ -1 +1 @@
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.9dd0c7db.js"></script><script defer="defer" src="js/app.d75564d8.js"></script><link href="css/chunk-vendors.4e2d36cb.css" rel="stylesheet"><link href="css/app.487f8f5a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.9dd0c7db.js"></script><script defer="defer" src="js/app.17b8ae77.js"></script><link href="css/chunk-vendors.4e2d36cb.css" rel="stylesheet"><link href="css/app.487f8f5a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
4
public/dist/js/214.10aea2cc.js
vendored
Normal file
4
public/dist/js/214.10aea2cc.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/214.10aea2cc.js.map
vendored
Normal file
1
public/dist/js/214.10aea2cc.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
4
public/dist/js/984.5c09ac22.js
vendored
4
public/dist/js/984.5c09ac22.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/984.5c09ac22.js.map
vendored
1
public/dist/js/984.5c09ac22.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/app.17b8ae77.js
vendored
Normal file
2
public/dist/js/app.17b8ae77.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/dist/js/app.d75564d8.js
vendored
2
public/dist/js/app.d75564d8.js
vendored
File diff suppressed because one or more lines are too long
@ -58,11 +58,18 @@
|
||||
<el-radio :label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="item.timed_delivery_code">
|
||||
<el-radio :label="247">电商标快</el-radio>
|
||||
<el-radio :label="266">空运</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="saveSenders">保存</el-button>
|
||||
<el-button type="primary" @click="saveSenders()">保存</el-button>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user