Merge pull request !94 from bugfix/0909
This commit is contained in:
赵世界 2022-09-14 10:32:35 +00:00 committed by Gitee
commit a819bfe087
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
46 changed files with 82 additions and 45 deletions

View File

@ -3,6 +3,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Models\GoodsSku; use App\Models\GoodsSku;
use App\Models\Log;
use App\Models\Shop; use App\Models\Shop;
use App\Services\Business\BusinessFactory; use App\Services\Business\BusinessFactory;
use App\Utils\DateTimeUtils; use App\Utils\DateTimeUtils;

View File

@ -51,8 +51,11 @@ class InventoryImport implements ToCollection, SkipsEmptyRows
Log::warning(json_encode($row, 256) . '=====库存导入未找到'); Log::warning(json_encode($row, 256) . '=====库存导入未找到');
continue; continue;
} }
$goodsSku->stock = $row[6] + $row[7];
$goodsSku->save();
$updateIds[] = $goodsSku->id; $updateIds[] = $goodsSku->id;
DailyStockRecord::where('sku_id', $goodsSku->id)->where('day', $day)->update([ DailyStockRecord::where('sku_id', $goodsSku->id)->where('day', $day)->update([
'arrived_today_num' => $row[7],
'inventory' => $row[6], 'inventory' => $row[6],
'inventory_time' => $dateTime 'inventory_time' => $dateTime
]); ]);
@ -64,13 +67,16 @@ class InventoryImport implements ToCollection, SkipsEmptyRows
throw $exception; throw $exception;
} }
$onSkuIds = GoodsSku::query() $onSkuIds = GoodsSku::query()
->where('stock', '>', 0)
->where('status', '<>', 0) ->where('status', '<>', 0)
->pluck('id') ->pluck('id')
->toArray(); ->toArray();
if ($downSkuIds = array_diff($onSkuIds, $updateIds)) { $downSkuIds = array_diff($onSkuIds, $updateIds);
GoodsSku::whereIn('id', $onSkuIds)->update(['stock' => 0]); foreach ($downSkuIds as $downSkuId) {
event(new StockUpdateEvent($downSkuIds)); $goodsSku = GoodsSku::query()->find($downSkuId);
$goodsSku->yesterday_num -= $goodsSku->stock;
$goodsSku->stock = 0;
$goodsSku->save();
event(new StockUpdateEvent($goodsSku));
} }
} }
} }

View File

@ -49,7 +49,7 @@ class UpdateBusinessGoodsStock implements ShouldQueue
if ('下架' === $event->goodsSku->status) { if ('下架' === $event->goodsSku->status) {
return; return;
} }
$shops = Shop::query()->where('id', '<>', $event->businessOrderItem['shop_id'])->whereNotIn('status', [0, 3])->get(['id', 'plat_id']); $shops = Shop::query()->whereNotIn('status', [0, 3])->get(['id', 'plat_id']);
if (empty($shops)) { if (empty($shops)) {
LogFile::info('可操作店铺为空'); LogFile::info('可操作店铺为空');
return; return;

View File

@ -2,6 +2,7 @@
namespace App\Services\Business\KuaiTuanTuan; namespace App\Services\Business\KuaiTuanTuan;
use App\Events\BusinessOrdersUpdate;
use App\Models\BusinessGoodsSku; use App\Models\BusinessGoodsSku;
class Goods class Goods
@ -31,10 +32,14 @@ class Goods
foreach ($skuList as $sku) { foreach ($skuList as $sku) {
$sku['spec_list'] = json_encode($sku['spec_list'], 256); $sku['spec_list'] = json_encode($sku['spec_list'], 256);
$data = array_merge($businessGood, $sku); $data = array_merge($businessGood, $sku);
BusinessGoodsSku::updateOrCreate( $businessGoodSku = BusinessGoodsSku::firstOrNew(
['shop_id' => $shopId, 'goods_id' => $businessGood['goods_id'], 'sku_id' => $sku['sku_id']], ['shop_id' => $shopId, 'goods_id' => $businessGood['goods_id'], 'sku_id' => $sku['sku_id']],
$data $data
); );
if (empty($businessGood->id)) {
$businessGoodSku->save();
event(new BusinessOrdersUpdate($businessGoodSku, 0));
}
} }
} }
} }

View File

@ -5,7 +5,8 @@ namespace App\Services\Business\KuaiTuanTuan;
use App\Models\BusinessGoodsSku; use App\Models\BusinessGoodsSku;
use App\Models\GoodsSku; use App\Models\GoodsSku;
use App\Services\Business\BusinessClient; use App\Services\Business\BusinessClient;
use Illuminate\Support\Facades\Log; use App\Models\Log;
use App\Utils\DateTimeUtils;
class KuaiTuanTuan extends BusinessClient class KuaiTuanTuan extends BusinessClient
{ {
@ -41,6 +42,18 @@ class KuaiTuanTuan extends BusinessClient
public function downloadGoodsListAndBind($page = 1) public function downloadGoodsListAndBind($page = 1)
{ {
[$type, $appendParams] = Goods::downloadGoods($this->shop->owner_id, $page); [$type, $appendParams] = Goods::downloadGoods($this->shop->owner_id, $page);
$log = Log::query()
->where('target_field', 'pdd.ktt.goods.query.list')
->where('target_id', $this->shop->id)
->orderBy('id', 'desc')
->first();
if ($log) {
$lastGetTime = DateTimeUtils::getMicroTime($log->created_at);
// 毫秒时间戳,往前算3分钟
$startTime = $lastGetTime - 30000;
$appendParams['update_time_start'] = $startTime;
$appendParams['update_time_end'] = DateTimeUtils::getMicroTime();
}
$res = $this->doRequest($type, $appendParams); $res = $this->doRequest($type, $appendParams);
$goods = $res['ktt_goods_query_list_response']['goods_list']; $goods = $res['ktt_goods_query_list_response']['goods_list'];
$this->bindGoods($goods); $this->bindGoods($goods);

View File

@ -0,0 +1 @@
.backimg[data-v-602ebc52]{width:100%;height:1080px;background-image:url(../img/组\ 32.1fba730a.png);background-repeat:no-repeat;background-size:100%;position:relative}.sign[data-v-602ebc52]{width:400px;height:500px;position:absolute;top:270px;right:300px}.sign input[data-v-602ebc52]{width:400px;height:51px;border:2px solid #bcbcbc;opacity:1;border-radius:5px;margin-bottom:25px}.sign .title[data-v-602ebc52]{width:125px;height:23px;font-size:22px;font-family:BigruixianBlackGBV1\.0;font-weight:400;line-height:23px;color:#2b53ec;opacity:1}.sign .manage[data-v-602ebc52]{margin-top:19px;margin-bottom:50px}.sign .manage img[data-v-602ebc52]{margin-right:20px}.sign .manage span[data-v-602ebc52]{width:340px;height:57px;font-size:54px;font-family:BigruixianBlackGBV1\.0;font-weight:400;line-height:57px;color:#2b53ec;opacity:1}.sign .title-1[data-v-602ebc52]{width:70px;height:35px;font-size:35px;font-family:Source Han Sans CN;font-weight:500;line-height:60px;color:#393939;opacity:1;margin-bottom:35px}.sign .el-button[data-v-602ebc52]{width:400px;height:58px;background:#2b53ec;border-radius:5px;margin-top:40px}.sign .el-checkbox[data-v-602ebc52]{color:#2b53ec}

View File

@ -1 +0,0 @@
.el-upload--picture-card[data-v-c92e4950]{width:50px;height:50px}.el-form-item[data-v-c92e4950]{margin-left:60px}.addto[data-v-c92e4950]{display:inline-block;width:30px;height:30px;background-color:#00f;color:#fff;font-size:25px;text-align:center;line-height:30px;border-radius:5px;margin-top:4px}.avatar-uploader .el-upload[data-v-c92e4950]{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-c92e4950]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-c92e4950]{font-size:28px;color:#8c939d;width:148px;height:148px;line-height:148px;text-align:center}.avatar[data-v-c92e4950]{width:148px;height:148px;display:block}

View File

@ -0,0 +1 @@
.block[data-v-4d020ce1]{margin-top:20px}

View File

@ -1 +0,0 @@
.backimg[data-v-27777327]{width:100%;height:1080px;background-image:url(../img/组\ 32.1fba730a.png);background-repeat:no-repeat;background-size:100%;position:relative}.sign[data-v-27777327]{width:400px;height:500px;position:absolute;top:270px;right:300px}.sign input[data-v-27777327]{width:400px;height:51px;border:2px solid #bcbcbc;opacity:1;border-radius:5px;margin-bottom:25px}.sign .title[data-v-27777327]{width:125px;height:23px;font-size:22px;font-family:BigruixianBlackGBV1\.0;font-weight:400;line-height:23px;color:#2b53ec;opacity:1}.sign .manage[data-v-27777327]{margin-top:19px;margin-bottom:50px}.sign .manage img[data-v-27777327]{margin-right:20px}.sign .manage span[data-v-27777327]{width:340px;height:57px;font-size:54px;font-family:BigruixianBlackGBV1\.0;font-weight:400;line-height:57px;color:#2b53ec;opacity:1}.sign .title-1[data-v-27777327]{width:70px;height:35px;font-size:35px;font-family:Source Han Sans CN;font-weight:500;line-height:60px;color:#393939;opacity:1;margin-bottom:35px}.sign .el-button[data-v-27777327]{width:400px;height:58px;background:#2b53ec;border-radius:5px;margin-top:40px}.sign .el-checkbox[data-v-27777327]{color:#2b53ec}

View File

@ -1 +0,0 @@
.table[data-v-c3c0b34a]{margin-top:20px;position:relative}.btn[data-v-c3c0b34a]{float:right}[data-v-c3c0b34a] .cell{display:flex;align-items:center}.commodityimg[data-v-c3c0b34a]{width:59px;height:59px;background:hsla(0,0%,89%,.39);opacity:1;display:block;margin-right:12px}.Img[data-v-c3c0b34a]{width:100%;height:100%}.confirmbtn[data-v-c3c0b34a]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-c3c0b34a]{margin-top:30px}.import-right a[data-v-c3c0b34a]{text-decoration:none;color:#000}[data-v-c3c0b34a] .btn11{padding:0;width:14px;height:14px}[data-v-c3c0b34a] .btn11 img{width:100%;height:100%}.page[data-v-c3c0b34a]{margin-top:20px}

View File

@ -1 +0,0 @@
.block[data-v-d92bd0d6]{margin-top:20px}

View File

@ -0,0 +1 @@
.el-upload--picture-card[data-v-4e813208]{width:50px;height:50px}.el-form-item[data-v-4e813208]{margin-left:60px}.addto[data-v-4e813208]{display:inline-block;width:30px;height:30px;background-color:#00f;color:#fff;font-size:25px;text-align:center;line-height:30px;border-radius:5px;margin-top:4px}.avatar-uploader .el-upload[data-v-4e813208]{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-4e813208]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-4e813208]{font-size:28px;color:#8c939d;width:148px;height:148px;line-height:148px;text-align:center}.avatar[data-v-4e813208]{width:148px;height:148px;display:block}

View File

@ -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%;-webkit-animation:nprogress-spinner .4s linear infinite;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}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.block[data-v-0e34e0d9]{margin-top:20px}[data-v-0e34e0d9] .el-card__body{padding:0} #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%;-webkit-animation:nprogress-spinner .4s linear infinite;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}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.block[data-v-0780dc0d]{margin-top:20px}[data-v-0780dc0d] .el-card__body{padding:0}

View File

@ -0,0 +1 @@
.table[data-v-42dfed8f]{margin-top:20px;position:relative}.btn[data-v-42dfed8f]{float:right}[data-v-42dfed8f] .cell{display:flex;align-items:center}.commodityimg[data-v-42dfed8f]{width:59px;height:59px;background:hsla(0,0%,89%,.39);opacity:1;display:block;margin-right:12px}.Img[data-v-42dfed8f]{width:100%;height:100%}.confirmbtn[data-v-42dfed8f]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-42dfed8f]{margin-top:30px}.import-right a[data-v-42dfed8f]{text-decoration:none;color:#000}[data-v-42dfed8f] .btn11{padding:0;width:14px;height:14px}[data-v-42dfed8f] .btn11 img{width:100%;height:100%}.page[data-v-42dfed8f]{margin-top:20px}

View File

@ -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%;-webkit-animation:nprogress-spinner .4s linear infinite;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}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.block[data-v-7a934eeb]{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%;-webkit-animation:nprogress-spinner .4s linear infinite;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}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.block[data-v-25465f92]{margin-top:20px}

View File

@ -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><link href="css/chunk-0050b7a0.29a99b3a.css" rel="prefetch"><link href="css/chunk-0b657eb5.f9a14f6c.css" rel="prefetch"><link href="css/chunk-0f6801be.5b16ca29.css" rel="prefetch"><link href="css/chunk-19bd19ca.0843a63e.css" rel="prefetch"><link href="css/chunk-288420ae.363cf34f.css" rel="prefetch"><link href="css/chunk-2c887b38.1e5bfb98.css" rel="prefetch"><link href="css/chunk-353b46a8.06cf7136.css" rel="prefetch"><link href="css/chunk-35db73ce.1f9c10ff.css" rel="prefetch"><link href="css/chunk-4019e2dc.757ac19e.css" rel="prefetch"><link href="css/chunk-4bb1e0d6.5889e5a4.css" rel="prefetch"><link href="css/chunk-698f0f68.96d82e53.css" rel="prefetch"><link href="css/chunk-75426f71.902ebb66.css" rel="prefetch"><link href="css/chunk-a3ddd952.902ebb66.css" rel="prefetch"><link href="js/chunk-0050b7a0.55e2f736.js" rel="prefetch"><link href="js/chunk-0b657eb5.cbe37031.js" rel="prefetch"><link href="js/chunk-0f6801be.02751f94.js" rel="prefetch"><link href="js/chunk-19bd19ca.e3f8701a.js" rel="prefetch"><link href="js/chunk-288420ae.01dbede2.js" rel="prefetch"><link href="js/chunk-2c887b38.91f2854d.js" rel="prefetch"><link href="js/chunk-353b46a8.17e63e16.js" rel="prefetch"><link href="js/chunk-35db73ce.a3585c34.js" rel="prefetch"><link href="js/chunk-4019e2dc.ee4c1cfa.js" rel="prefetch"><link href="js/chunk-4bb1e0d6.379fe0a2.js" rel="prefetch"><link href="js/chunk-63c1eac8.59f3df74.js" rel="prefetch"><link href="js/chunk-698f0f68.a0f8050b.js" rel="prefetch"><link href="js/chunk-75426f71.aa7e65a8.js" rel="prefetch"><link href="js/chunk-a3ddd952.ad97c910.js" rel="prefetch"><link href="css/app.6c30acd7.css" rel="preload" as="style"><link href="css/chunk-vendors.9181e156.css" rel="preload" as="style"><link href="js/app.c65ddc23.js" rel="preload" as="script"><link href="js/chunk-vendors.13743003.js" rel="preload" as="script"><link href="css/chunk-vendors.9181e156.css" rel="stylesheet"><link href="css/app.6c30acd7.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><script src="js/chunk-vendors.13743003.js"></script><script src="js/app.c65ddc23.js"></script></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><link href="css/chunk-0050b7a0.29a99b3a.css" rel="prefetch"><link href="css/chunk-0cbcaa56.e05858e7.css" rel="prefetch"><link href="css/chunk-0f6801be.5b16ca29.css" rel="prefetch"><link href="css/chunk-253ca5b0.e94ab248.css" rel="prefetch"><link href="css/chunk-288420ae.363cf34f.css" rel="prefetch"><link href="css/chunk-35db73ce.1f9c10ff.css" rel="prefetch"><link href="css/chunk-4f15b41a.2cf53495.css" rel="prefetch"><link href="css/chunk-5c4e4e5e.6bab9f78.css" rel="prefetch"><link href="css/chunk-698f0f68.96d82e53.css" rel="prefetch"><link href="css/chunk-7529a615.00296464.css" rel="prefetch"><link href="css/chunk-75426f71.902ebb66.css" rel="prefetch"><link href="css/chunk-a3ddd952.902ebb66.css" rel="prefetch"><link href="css/chunk-d98e057e.1d268c2c.css" rel="prefetch"><link href="js/chunk-0050b7a0.55e2f736.js" rel="prefetch"><link href="js/chunk-0cbcaa56.114d39a7.js" rel="prefetch"><link href="js/chunk-0f6801be.02751f94.js" rel="prefetch"><link href="js/chunk-253ca5b0.37e2e0e1.js" rel="prefetch"><link href="js/chunk-288420ae.01dbede2.js" rel="prefetch"><link href="js/chunk-35db73ce.a3585c34.js" rel="prefetch"><link href="js/chunk-4f15b41a.059677d1.js" rel="prefetch"><link href="js/chunk-5c4e4e5e.96b6dca7.js" rel="prefetch"><link href="js/chunk-63c1eac8.59f3df74.js" rel="prefetch"><link href="js/chunk-698f0f68.a0f8050b.js" rel="prefetch"><link href="js/chunk-7529a615.a6b91ae6.js" rel="prefetch"><link href="js/chunk-75426f71.aa7e65a8.js" rel="prefetch"><link href="js/chunk-a3ddd952.ad97c910.js" rel="prefetch"><link href="js/chunk-d98e057e.6df199dd.js" rel="prefetch"><link href="css/app.6c30acd7.css" rel="preload" as="style"><link href="css/chunk-vendors.9181e156.css" rel="preload" as="style"><link href="js/app.728c36ae.js" rel="preload" as="script"><link href="js/chunk-vendors.13743003.js" rel="preload" as="script"><link href="css/chunk-vendors.9181e156.css" rel="stylesheet"><link href="css/app.6c30acd7.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><script src="js/chunk-vendors.13743003.js"></script><script src="js/app.728c36ae.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
<br /> <br />
<el-checkbox v-model="checked">记住密码</el-checkbox> <el-checkbox v-model="checked">记住密码</el-checkbox>
<br /> <br />
<el-button type="primary" @click="Login()">登录</el-button> <el-button type="primary" @click="Login()" @keyup.enter="Login()">登录</el-button>
</div> </div>
</div> </div>
</template> </template>
@ -32,6 +32,7 @@ export default {
}, },
mounted() { mounted() {
this.getCookie(); this.getCookie();
window.addEventListener('keydown', this.keyDown);
}, },
methods: { methods: {
Login() { Login() {
@ -103,7 +104,15 @@ export default {
clearCookie: function () { clearCookie: function () {
this.setCookie("", "", false, -1); this.setCookie("", "", false, -1);
}, },
keyDown(e) {
if (13 === e.keyCode) {
this.Login();
}
}
}, },
destroyed() {
window.removeEventListener('keydown', this.keyDown, false);
}
}; };
</script> </script>

View File

@ -400,12 +400,15 @@ export default {
mounted() { mounted() {
this.gid = this.$route.query; this.gid = this.$route.query;
let page = {
per_page: 999,
};
// //
goods_types().then((res) => { goods_types(page).then((res) => {
this.cate = res.data.data; this.cate = res.data.data;
}); });
// //
Brand_goods_types().then((res) => { Brand_goods_types(page).then((res) => {
this.brand = res.data.data; this.brand = res.data.data;
}); });
this.handleList(); this.handleList();

View File

@ -531,7 +531,7 @@ export default {
handleChoose() { handleChoose() {
this.form = { this.form = {
...this.form, ...this.form,
page: this.current_page, page: 1,
per_page: this.per_page, per_page: this.per_page,
}; };

View File

@ -322,7 +322,7 @@ export default {
// //
query() { query() {
let queryData = { let queryData = {
page: this.current_page, page: 1,
per_page: this.per_page, per_page: this.per_page,
module: this.form.module, module: this.form.module,
action: this.form.action, action: this.form.action,

View File

@ -159,7 +159,7 @@ export default {
let queryData = { let queryData = {
userId: this.form.userId, userId: this.form.userId,
target_field: this.form.targetField, target_field: this.form.targetField,
page: this.current_page, page: 1,
per_page: this.per_page, per_page: this.per_page,
moudule: this.moudule, moudule: this.moudule,
target_id: this.$route.query.id, target_id: this.$route.query.id,

View File

@ -123,7 +123,7 @@ export default {
handleChoose() { handleChoose() {
this.form = { this.form = {
...this.form, ...this.form,
page: this.current_page, page: 1,
per_page: this.per_page, per_page: this.per_page,
}; };