Merge pull request !232 from 赵世界/master
This commit is contained in:
赵世界 2024-06-19 06:51:06 +00:00 committed by Gitee
commit 954de121b8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
110 changed files with 14493 additions and 267 deletions

View File

@ -0,0 +1,178 @@
<?php
namespace App\Console\Commands;
use App\Models\BusinessOrder;
use App\Models\BusinessOrderItem;
use App\Models\GoodsSku;
use App\Utils\ArrayUtils;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\Models\DailySalesReport as DailySalesReportModel;
class DailySalesReport extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'daily:report:sales {S}';
/**
* The console command description.
*
* @var string
*/
protected $description = '每日销量数据记录';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$s = $this->argument('S');
$map = [
'S1' => [
'startTime' => date('Y-m-d 11:00:00'),
'endTime' => date('Y-m-d 12:00:00'),
],
'S2' => [
'startTime' => date('Y-m-d 11:00:00'),
'endTime' => date('Y-m-d 13:30:00'),
],
'S3' => [
'startTime' => date('Y-m-d 11:00:00'),
'endTime' => date('Y-m-d 15:00:00'),
],
'S4' => [
'startTime' => date('Y-m-d 15:00:00'),
'endTime' => date('Y-m-d 16:00:00'),
],
'S5' => [
'startTime' => date('Y-m-d 11:00:00'),
'endTime' => date('Y-m-d 17:30:00'),
],
'S6' => [
'startTime' => date('Y-m-d 11:00:00'),
'endTime' => date('Y-m-d 20:00:00'),
],
'S7' => [
'startTime' => Carbon::yesterday()->format('Y-m-d 11:00:00'),
'endTime' => date('Y-m-d 09:30:00'),
],
];
if (!isset($map[$s])) {
return;
}
$startTime = $map[$s]['startTime'];
$endTime = $map[$s]['endTime'];
$businessOrderIds = BusinessOrder::query()
->where('confirm_at', '>=', Carbon::parse($startTime)->getPreciseTimestamp(3))
->where('confirm_at', '<=', Carbon::parse($endTime)->getPreciseTimestamp(3))
->pluck('id');
$businessOrderIds = $businessOrderIds->chunk(200);
$fields = implode(',', [
'external_sku_id',
'SUM(already_cancel_number) as total_already_cancel_number',
'SUM(goods_number) as total_goods_number',
]);
$data = [];
foreach ($businessOrderIds as $ids) {
$businessOrderItems = BusinessOrderItem::query()
->select(DB::raw($fields))
->whereIn('business_order_id', $ids)
->where('external_sku_id', '<>', '')
->groupBy('external_sku_id')
->get();
if ($businessOrderItems->isEmpty()) {
continue;
}
foreach ($businessOrderItems as $businessOrderItem) {
$arr = explode('_', $businessOrderItem['external_sku_id']);
if (2 !== count($arr)) {
continue;
}
if (!isset($data[$businessOrderItem['external_sku_id']])) {
$data[$businessOrderItem['external_sku_id']] = [
'total_already_cancel_number' => 0,
'total_goods_number' => 0,
];
}
$data[$businessOrderItem['external_sku_id']]['total_already_cancel_number'] += $businessOrderItem['total_already_cancel_number'];
$data[$businessOrderItem['external_sku_id']]['total_goods_number'] += $businessOrderItem['total_goods_number'];
}
}
$date = Carbon::parse($startTime)->format('Y-m-d');
$goodsSkus = GoodsSku::query()
->select(['goods_id', 'external_sku_id', 'name', 'id', 'goal_rate'])
->with(['daily' => function ($query) use ($date) {
$query->where('day', $date);
}])
->whereIn('external_sku_id', array_keys($data))
->get();
$goodsSkus = ArrayUtils::index($goodsSkus->toArray(), 'external_sku_id');
foreach ($data as $externalSkuId => $datum) {
if (!isset($goodsSkus[$externalSkuId])) {
continue;
}
$dailySalesReport = DailySalesReportModel::query()
->where('date', $date)
->where('external_sku_id', $externalSkuId)
->first();
$sVal = $datum['total_goods_number'] - $datum['total_already_cancel_number'];
$sRate = $s . '_rate';
$stock = $goodsSkus[$externalSkuId]['daily']['inventory'] + $goodsSkus[$externalSkuId]['daily']['arrived_today_num'];
$sRateVal = $stock ? bcdiv($sVal, $stock, 4) : 0;
if (is_null($dailySalesReport)) {
DailySalesReportModel::query()->updateOrCreate([
'date' => $date,
'external_sku_id' => $externalSkuId,
], [
'goods_id' => $goodsSkus[$externalSkuId]['goods_id'],
'goods_sku_id' => $goodsSkus[$externalSkuId]['id'],
'name' => $goodsSkus[$externalSkuId]['name'],
'inventory' => $goodsSkus[$externalSkuId]['daily']['inventory'],
'arrived_today_num' => $goodsSkus[$externalSkuId]['daily']['arrived_today_num'],
'sales_num' => $sVal,
'loss_num' => $goodsSkus[$externalSkuId]['daily']['loss_num'],
$s => $sVal,
$sRate => $sRateVal,
'already_cancel_number' => $datum['total_already_cancel_number'],
]);
} else {
$num = 0;
foreach ($map as $key => $val) {
if ($key !== $s) {
$num += $dailySalesReport->$key;
}
}
$dailySalesReport->update([
'inventory' => $goodsSkus[$externalSkuId]['daily']['inventory'],
'arrived_today_num' => $goodsSkus[$externalSkuId]['daily']['arrived_today_num'],
'sales_num' => $num + $sVal,
'loss_num' => $goodsSkus[$externalSkuId]['daily']['loss_num'],
$s => $sVal,
$sRate => $sRateVal,
'already_cancel_number' => $datum['total_already_cancel_number'],
'goal_rate' => $goodsSkus[$externalSkuId]['goal_rate'],
]);
}
}
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Console\Commands;
use App\Models\GoodsSku;
use Illuminate\Console\Command;
class UpdateGoodsSkuName extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update:goods_skus:name';
/**
* The console command description.
*
* @var string
*/
protected $description = '更新goods_sku的完整名称';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
GoodsSku::query()
->where('name', '')
->where('is_combination', 0)
->chunk(500, static function ($skus) {
foreach ($skus as $sku) {
$sku->name = $sku->goods->title . $sku->title;
$sku->save();
}
});
}
}

View File

@ -2,6 +2,7 @@
namespace App\Console;
use App\Console\Commands\DailySalesReport;
use App\Console\Commands\GoodsSkuDailyReport;
use App\Console\Commands\Inventory;
use Illuminate\Console\Scheduling\Schedule;
@ -30,9 +31,19 @@ class Kernel extends ConsoleKernel
{
// 服务器/etc/crontab添加cron入口
// * * * * * cd /home/wwwroot/erp.chutang66.com && php artisan schedule:run >> /dev/null 2>&1
$schedule->command(KttOrderQuery::class)->everyMinute();
$schedule->command(GoodsSkuDailyReport::class)->dailyAt('06:00');
$schedule->command(Inventory::class)->dailyAt('07:00');
$schedule->command(KttOrderQuery::class)->everyMinute();
$schedule->command(DailySalesReport::class, ['S1'])->dailyAt('12:00');
$schedule->command(DailySalesReport::class, ['S2'])->dailyAt('13:30');
$schedule->command(DailySalesReport::class, ['S3'])->dailyAt('15:00');
$schedule->command(DailySalesReport::class, ['S4'])->dailyAt('16:00');
$schedule->command(DailySalesReport::class, ['S5'])->dailyAt('17:30');
$schedule->command(DailySalesReport::class, ['S6'])->dailyAt('20:00');
$schedule->command(DailySalesReport::class, ['S7'])->dailyAt('09:30');
$schedule->command(DeleteKttQuery::class)->daily();
}

View File

@ -4,11 +4,6 @@ namespace App\Filters;
class GoodsFilter extends Filters
{
protected function goodsTitle($value)
{
return $this->builder->where('title', 'like', "%$value%");
}
protected function typeId($value)
{
if($value){

View File

@ -0,0 +1,40 @@
<?php
namespace App\Http\Controllers\DataCenter;
use App\Http\Controllers\Controller;
use App\Http\Resources\DailySalesReportResource;
use App\Models\DailySalesReport;
use App\Utils\FormatUtils;
use Illuminate\Http\Request;
class DataCenterController extends Controller
{
public function salesReport(Request $request)
{
$sort = $request->get('sort', 'sales_num');
$order = $request->get('sortOrder', 'DESC');
if (empty($request->get('date'))) {
$request->offsetSet('date', date('Y-m-d'));
}
$dailySalesReports = DailySalesReport::query()
->filter()
->orderBy($sort, $order)
->paginate($request->get('per_page'));
foreach ($dailySalesReports as &$dailySalesReport) {
$dailySalesReport['stock'] = $dailySalesReport['inventory'] + $dailySalesReport['arrived_today_num'];
$dailySalesReport['goal_rate'] = FormatUtils::getPercent($dailySalesReport['goal_rate'], 1);
$dailySalesReport['S1_rate'] = FormatUtils::getPercent($dailySalesReport['S1_rate'], 1);
$dailySalesReport['S2_rate'] = FormatUtils::getPercent($dailySalesReport['S2_rate'], 1);
$dailySalesReport['S3_rate'] = FormatUtils::getPercent($dailySalesReport['S3_rate'], 1);
$dailySalesReport['S4_rate'] = FormatUtils::getPercent($dailySalesReport['S4_rate'], 1);
$dailySalesReport['S5_rate'] = FormatUtils::getPercent($dailySalesReport['S5_rate'], 1);
$dailySalesReport['S6_rate'] = FormatUtils::getPercent($dailySalesReport['S6_rate'], 1);
$dailySalesReport['S7_rate'] = FormatUtils::getPercent($dailySalesReport['S7_rate'], 1);
}
return DailySalesReportResource::collection($dailySalesReports);
}
}

View File

@ -61,6 +61,7 @@ class GoodsController extends Controller
$item['stock'] = $item['num'];
$item['reference_price'] = $item['cost'] * 1.5;
$item['external_sku_id'] = $goods->goods_code . '_' . $item['sku_code'];
$item['name'] = $goods->title . $item['title'];
$goodsSkus[] = $item;
}
$collection = $goods->skus()->createMany($goodsSkus)->toArray();

View File

@ -12,6 +12,7 @@ use App\Http\Requests\GoodsSkuRequest;
use App\Imports\InventoryImport;
use App\Imports\NewSetImport;
use App\Models\BusinessOrderItem;
use App\Models\DailySalesReport;
use App\Models\DeveloperConfig;
use App\Models\Goods;
use App\Models\Log;
@ -121,6 +122,7 @@ class GoodsSkusController extends Controller
$sku['order_detail'] = [];
$sku['order_goods_num'] = 0;
}
$sku['order_goods_num'] -= $sku['daily']['reissue_num'];
$sku['inventory_time'] = $lastInventoryTime;
if ('销售' === $rolesName[0]) {
$sku['cost'] = 0;
@ -140,10 +142,13 @@ class GoodsSkusController extends Controller
->toArray();
$builder->whereIn('id', $skuIds);
}
if ($request->get('goods_title') || $request->get('type_id') || $request->get('brand_id')) {
if ($request->get('type_id') || $request->get('brand_id')) {
$goodsIds = Goods::query()->filter()->pluck('id')->toArray();
$builder->whereIn('goods_id', $goodsIds);
}
if ($request->get('goods_title')) {
$builder->where('name', 'like', '%' . $request->goods_title . '%');
}
}
public function show($id)
@ -185,6 +190,7 @@ class GoodsSkusController extends Controller
$this->setBeforeUpdateForLog($sku->toArray());
$skuInfo = $request->sku;
$skuInfo['external_sku_id'] = $request->goods['goods_code'] . '_' . $request->sku['sku_code'];
$skuInfo['name'] = $request->goods['title'] . $request->sku['title'];
$sku->update($skuInfo);
$this->setAfterUpdateForLog($sku->toArray());
$this->addLog($id, 'update');
@ -432,7 +438,7 @@ class GoodsSkusController extends Controller
$rules = [
'updateField' => [
'required',
Rule::in(['reference_price', 'reserve', 'loss_num', 'status'])
Rule::in(['reference_price', 'reserve', 'loss_num', 'status', 'goal_rate'])
],
'reference_price' => [
'sometimes',
@ -456,7 +462,12 @@ class GoodsSkusController extends Controller
'sometimes',
'required',
'integer',
Rule::in([0, 1, 2])],
Rule::in([0, 1, 2])
],
'goal_rate' => [
'sometimes',
'numeric',
],
];
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
@ -494,6 +505,16 @@ class GoodsSkusController extends Controller
if (in_array($updateField, ['reserve', 'loss_num'])) {
event(new StockUpdateEvent($sku));
}
// 更新目标去化率
if ('goal_rate' === $updateField) {
DailySalesReport::query()
->where('date', date('Y-m-d'))
->where('goods_sku_id', $sku->id)
->update([
'goal_rate' => $request->$updateField
]);
}
$this->addLog($id, $updateField);
end:

View File

@ -41,6 +41,10 @@ class GoodsSkuRequest extends FormRequest
'sometimes',
'integer',
],
'goal_rate' => [
'sometimes',
'numeric',
],
'loss_num' => [
'sometimes',
'integer',

View File

@ -0,0 +1,19 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class DailySalesReportResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return parent::toArray($request);
}
}

View File

@ -45,15 +45,15 @@ class GoodsSkusImport implements ToCollection, SkipsEmptyRows
}
unset($row);
$validator = Validator::make($collection, [
'*.0' => ['required', 'string', 'max:191'],
'*.1' => ['required', 'string', 'max:191', 'exists:goods_types,name'],
'*.2' => ['string', 'max:191', 'exists:goods_brands,name'],
'*.3' => ['required', 'alpha_dash', 'max:32'],
'*.4' => ['required', 'string', 'max:191'],
'*.5' => ['required', 'alpha_dash', 'max:32'],
'*.0' => ['required', 'string', 'max:191'], // 商品名称
'*.1' => ['required', 'string', 'max:191', 'exists:goods_types,name'], // 分类
'*.2' => ['string', 'max:191', 'exists:goods_brands,name'], // 品牌
'*.3' => ['required', 'alpha_dash', 'max:32'], // 商品编码
'*.4' => ['required', 'string', 'max:191'], // 规格名称
'*.5' => ['required', 'alpha_dash', 'max:32'], // 规格编码
'*.6' => ['required', 'string', Rule::in(['下架', '在售', '预警'])],
'*.7' => ['required', 'max:10'],
'*.8' => ['required', 'max:10'],
'*.7' => ['required', 'max:10'], // 数量
'*.8' => ['required', 'max:10'], // 成本
]);
if ($validator->fails()) {
throw new ValidationException($validator);
@ -93,10 +93,15 @@ class GoodsSkusImport implements ToCollection, SkipsEmptyRows
if ($newGoods) {
$goods = new Goods();
$goods->batchInsert(array_values($newGoods));
$hasGoods = Goods::query()->whereIn('goods_code', array_column($newGoods, 'goods_code'))->pluck('id', 'goods_code')->toArray();
$hasGoods = Goods::query()
->whereIn('goods_code', array_column($newGoods, 'goods_code'))
->get()
->toArray();
$hasGoods = ArrayUtils::index($hasGoods, 'goods_code');
foreach ($skus as &$newGoodsSku) {
$newGoodsSku['goods_id'] = $hasGoods[$newGoodsSku['goods_code']];
$newGoodsSku['goods_id'] = $hasGoods[$newGoodsSku['goods_code']]['id'];
$newGoodsSku['external_sku_id'] = $newGoodsSku['goods_code'] . '_' . $newGoodsSku['sku_code'];
$newGoodsSku['name'] = $hasGoods[$newGoodsSku['goods_code']]['title'] . '_' . $newGoodsSku['title'];
unset($newGoodsSku['goods_code']);
}
unset($newGoodsSku);

View File

@ -3,15 +3,16 @@
namespace App\Listeners;
use App\Events\BatchStockUpdateEvent;
use App\Jobs\BusinessGoodsSkuIncrQuantity;
use App\Models\BusinessGoodsSku;
use App\Models\Shop;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use App\Services\Business\BusinessFactory;
class BatchStockUpdateListener
class BatchStockUpdateListener implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener.
*
@ -32,7 +33,7 @@ class BatchStockUpdateListener
{
$shops = Shop::query()->whereNotIn('status', [Shop::$STATUS_UNAUTHORIZED, Shop::$STATUS_STOP])->get(['id', 'plat_id']);
if (empty($shops)) {
return false;
return;
}
foreach ($shops as $shop) {
foreach ($event->goodsSkus as $goodsSku) {
@ -44,6 +45,7 @@ class BatchStockUpdateListener
->where('external_sku_id', $goodsSku->external_sku_id)
->get();
BusinessFactory::init()->make($shop['plat_id'])->setShopWithId($shop['id'])->batchIncrQuantity($businessGoodsSkus->toArray(), $num, false);
usleep(140);
}
}
}

View File

@ -10,8 +10,10 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use App\Events\BatchStockUpdateEvent;
class CombinationGoodsStockUpdateListener
class CombinationGoodsStockUpdateListener implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener.
*

View File

@ -9,8 +9,10 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use App\Services\Business\BusinessFactory;
class StockUpdateListener
class StockUpdateListener implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener.
*
@ -31,7 +33,7 @@ class StockUpdateListener
{
$shops = Shop::query()->whereNotIn('status', [Shop::$STATUS_UNAUTHORIZED, Shop::$STATUS_STOP])->get(['id', 'plat_id']);
if (empty($shops)) {
return false;
return;
}
foreach ($shops as $shop) {
$num = $event->goodsSku->stock;

View File

@ -68,6 +68,7 @@ class UpdateBusinessGoodsStock implements ShouldQueue
->get();
foreach ($businessGoodsSkus as $businessGoodsSku) {
BusinessGoodsSkuIncrQuantity::dispatch($shop, $businessGoodsSku->toArray(), $num, false);
usleep(140);
}
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Models;
use App\Models\traits\Filter;
use Illuminate\Database\Eloquent\Model;
class DailySalesReport extends Model
{
use Filter;
protected $guarded = [];
public $fieldSearchable = [
'date',
'name' => 'like',
'sales_num' => '>',
];
}

View File

@ -10,7 +10,6 @@ class Goods extends Model
//查询字段
public $fieldSearchable = [
'goods_title',
'type_id',
'brand_id',
];

View File

@ -32,6 +32,7 @@ class GoodsSku extends Model
'thumb_url',
'external_sku_id',
'is_combination',
'name',
];
protected $hidden = ['created_at'];

View File

@ -152,6 +152,10 @@ abstract class BusinessClient
$res = (new Client())->request($method, $url, $headers);
$size = $res->getBody()->getSize();
$res = json_decode($res->getBody()->getContents(), true);
$paramsJson = json_encode($params, 256);
if (strlen($paramsJson) > 1024) {
$paramsJson = '';
}
if (!in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list'], true)) {
$log = new Log();
$log->module = 'plat';
@ -161,14 +165,14 @@ abstract class BusinessClient
$log->target_field = $params['type'];
$log->user_id = Auth::id() ?? 999;
if ($size < 48000) {
$log->message = json_encode($res, 256) . '=====' . json_encode($params, 256);
$log->message = json_encode($res, 256) . '=====' . $paramsJson;
} else {
$log->message = json_encode($params, 256);
$log->message = $paramsJson;
}
$log->save();
}
if (in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list'], true)) {
LogFile::info('快团团请求: ' . json_encode($params, 256));
LogFile::info('快团团请求: ' . $paramsJson);
LogFile::info('快团团返回: ' . json_encode($res, 256));
}
@ -186,6 +190,8 @@ abstract class BusinessClient
];
$promises[] = $client->postAsync($url, $options);
}
Promise\Utils::unwrap($promises);
if ($promises) {
Promise\Utils::unwrap($promises);
}
}
}

View File

@ -77,8 +77,10 @@ class KuaiTuanTuan extends BusinessClient
public function batchIncrQuantity($businessGoodsSkus, $num, $incremental)
{
$batchAppendParams = [];
$logData = [];
foreach ($businessGoodsSkus as $businessGoodsSku) {
[$type, $appendParams] = Goods::incrQuantity($businessGoodsSku['goods_id'], $businessGoodsSku['sku_id'], $num, $incremental ? 1 : 2);
$logData[] = $appendParams;
$appendParams['type'] = $type;
$appendParams['client_id'] = $this->clientId;
$appendParams['timestamp'] = time();
@ -87,6 +89,9 @@ class KuaiTuanTuan extends BusinessClient
$batchAppendParams[] = $appendParams;
}
$this->batchAsyncPostRequest('https://gw-api.pinduoduo.com/api/router', $batchAppendParams);
if ($logData) {
Log::info('本次批量同步: ' . json_encode($logData, 256));
}
}
/**
@ -164,7 +169,7 @@ class KuaiTuanTuan extends BusinessClient
if (50001 == $res['error_response']['error_code'] && in_array($res['error_response']['sub_code'], ['13', '11'])) {
BusinessGoodsSku::query()->where('goods_id', $appendParams['goods_id'])->where('sku_id', $appendParams['sku_id'])->update(['is_sync' => 0]);
}
Log::error(json_encode($res, 256));
Log::error(json_encode($res, 256) . $type);
}
return $res;

View File

@ -33,4 +33,9 @@ class FormatUtils
}
return $data;
}
public static function getPercent($dividend, $divisor, $decimal = 2)
{
return bcdiv($dividend, $divisor, $decimal + 2) * 100 . '%';
}
}

View File

@ -28,7 +28,7 @@ class CreateGroupsTable extends Migration
$table->string('activity_no')->nullable()->comment('团号');
$table->unsignedTinyInteger('create_status')->default(3)->comment('1-创建成功,2-创建失败,3-创建中');
$table->string('error_msg')->nullable()->comment('create_status为2时有创建团失败原因');
$table->text('qr_code_url')->nullable()->comment('create_status为1时有团小程序二维码图片地址');
$table->string('qr_code_url')->default('')->comment('create_status为1时有团小程序二维码图片地址');
$table->unsignedBigInteger('create_time')->nullable();
$table->unsignedTinyInteger('is_help_sell')->nullable()->comment('是否帮卖0-我发布的,1-我帮卖的');
$table->tinyInteger('status')->default(-10)->comment('团状态(-10:待发布/预览中,-5:未开始1:跟团中20:已结束30:已删除');

View File

@ -13,6 +13,9 @@ class CreateDailyReportsTable extends Migration
*/
public function up()
{
if (Schema::hasTable('daily_reports')) {
return;
}
Schema::create('daily_reports', function (Blueprint $table) {
$table->bigIncrements('id');
$table->date('date');

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddNameToGoodsSkusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasColumn('goods_skus', 'name')) {
return;
}
Schema::table('goods_skus', function (Blueprint $table) {
$table->string('name')->default('')->comment('完整商品名称');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('goods_skus', function (Blueprint $table) {
$table->dropColumn('name');
});
}
}

View File

@ -0,0 +1,60 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDailySalesReportsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasTable('daily_sales_reports')) {
return;
}
Schema::create('daily_sales_reports', function (Blueprint $table) {
$table->bigIncrements('id');
$table->date('date');
$table->unsignedInteger('goods_id');
$table->unsignedInteger('goods_sku_id');
$table->string('name');
$table->string('external_sku_id', 64);
$table->integer('inventory')->default(0)->comment('盘点数量');
$table->integer('arrived_today_num')->default(0)->comment('今日到货');
$table->integer('sales_num')->default(0)->comment('总销量');
$table->integer('already_cancel_number')->default(0)->comment('已取消数量');
$table->unsignedInteger('loss_num')->default(0)->comment('损耗');
$table->decimal('goal_rate', 8, 4)->default(0)->comment('目标去化率');
$table->integer('S1')->default(0)->comment('11-12');
$table->integer('S2')->default(0)->comment('11-13:30');
$table->integer('S3')->default(0)->comment('11-15');
$table->integer('S4')->default(0)->comment('15-16');
$table->integer('S5')->default(0)->comment('11-17:30');
$table->integer('S6')->default(0)->comment('11-20');
$table->integer('S7')->default(0)->comment('11-9:30');
$table->decimal('S1_rate', 8, 4)->default(0);
$table->decimal('S2_rate', 8, 4)->default(0);
$table->decimal('S3_rate', 8, 4)->default(0);
$table->decimal('S4_rate', 8, 4)->default(0);
$table->decimal('S5_rate', 8, 4)->default(0);
$table->decimal('S6_rate', 8, 4)->default(0);
$table->decimal('S7_rate', 8, 4)->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('daily_sales_reports');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddGoalRateToGoodsSkusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasColumn('goods_skus', 'goal_rate')) {
return;
}
Schema::table('goods_skus', function (Blueprint $table) {
$table->decimal('goal_rate', 8, 4)->default(0)->comment('目标去化率');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('goods_skus', function (Blueprint $table) {
$table->dropColumn('goal_rate');
});
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddReissueNumToDailyStockRecordsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasColumn('daily_stock_records', 'reissue_num')) {
return;
}
Schema::table('daily_stock_records', function (Blueprint $table) {
$table->unsignedInteger('reissue_num')->default(0)->comment('补发数量');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('daily_stock_records', function (Blueprint $table) {
$table->dropColumn('reissue_num');
});
}
}

View File

@ -40,8 +40,10 @@ class MenusTableSeeder extends Seeder
['parent_id' => $id, 'code' => 'PLAT_GOODS_LIST', 'name' => '货品列表', 'seq' => 0],
['parent_id' => $id, 'code' => 'PLAT_ORDER_LIST', 'name' => '订单列表', 'seq' => 1],
]);
// 团购
DB::table('menus')->insertGetId(['parent_id' => 0, 'code' => 'GROUP_MANAGEMENT', 'name' => '团购管理', 'seq' => 1]);
// 团购管理
DB::table('menus')->insertGetId(['parent_id' => 0, 'code' => 'GROUP_MANAGEMENT', 'name' => '团购管理', 'seq' => 2]);
// 数据中心
DB::table('menus')->insertGetId(['parent_id' => 0, 'code' => 'DATA_CENTER', 'name' => '数据中心', 'seq' => 1]);
}
public function update()

1
public/dist/css/149.9f84b84a.css vendored Normal file
View File

@ -0,0 +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)}}.aside-show[data-v-c25279e8]{transition:all .3s;opacity:0;width:0!important}.aside-hide[data-v-c25279e8]{transition:all .3s;opacity:1;width:200px!important}.el-container[data-v-c25279e8]{height:100vh}.el-aside[data-v-c25279e8]{background-color:#d3dce6;color:#333;overflow-x:hidden}.el-aside[data-v-c25279e8]::-webkit-scrollbar{width:8px}.el-aside[data-v-c25279e8]::-webkit-scrollbar-thumb{background-color:hsla(220,4%,58%,.3);border-radius:20px}.el-main[data-v-c25279e8]{background-color:#f0f2f5;color:#333;padding:0 0!important}.el-main[data-v-c25279e8]::-webkit-scrollbar{width:10px}.el-main[data-v-c25279e8]::-webkit-scrollbar-thumb{background-color:hsla(220,4%,58%,.3)}.box-card[data-v-c25279e8]{min-height:calc(100vh - 120px);margin:10px}.conent[data-v-c25279e8]{width:100%;min-height:calc(100vh - 200px);position:relative}.add[data-v-c25279e8]{cursor:pointer;font-size:25px;color:#606266}.head[data-v-c25279e8]{padding:10px;background-color:#fff;border-bottom:1px solid #f6f6f6;box-shadow:0 1px 4px rgba(0,21,41,.08)}.head ul[data-v-c25279e8]{display:flex;justify-content:space-between}.head ul li[data-v-c25279e8]{display:flex;align-items:center}.head ul li .right[data-v-c25279e8]{margin-left:20px}.head ul li .token[data-v-c25279e8]{cursor:pointer}.el-aside[data-v-c25279e8]{background:#282c34;box-shadow:2px 0 6px rgba(0,21,41,.35)}[data-v-c25279e8] .el-menu{border:none}.el-menu-item[data-v-c25279e8]:hover{outline:0!important;background:#5470c6!important;border-radius:5px!important}.el-menu-item.is-active[data-v-c25279e8]{color:#fff!important;background:#5470c6!important;border-radius:5px!important}.el-menu-item-group__title[data-v-c25279e8]{padding:0 0!important}

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%;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)}}.el-upload--picture-card[data-v-49170b11]{width:50px;height:50px}.el-form-item[data-v-49170b11]{margin-left:40px}.avatar-uploader .el-upload[data-v-49170b11]{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-49170b11]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-49170b11]{font-size:28px;color:#8c939d;width:148px;height:148px;line-height:148px;text-align:center}.avatar[data-v-49170b11]{width:148px;height:148px;display:block}
#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)}}.el-upload--picture-card[data-v-1963f826]{width:50px;height:50px}.el-form-item[data-v-1963f826]{margin-left:40px}.avatar-uploader .el-upload[data-v-1963f826]{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-1963f826]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-1963f826]{font-size:28px;color:#8c939d;width:148px;height:148px;line-height:148px;text-align:center}.avatar[data-v-1963f826]{width:148px;height:148px;display:block}

1
public/dist/css/485.8c529968.css vendored Normal file
View File

@ -0,0 +1 @@
.backimg[data-v-53d3caae]{width:100%;height:1080px;background-image:url(../img/%E7%BB%84%2032.a17892e3.png);background-repeat:no-repeat;background-size:100%;position:relative}.sign[data-v-53d3caae]{width:400px;height:500px;position:absolute;top:270px;right:300px}.sign input[data-v-53d3caae]{width:400px;height:51px;border:2px solid #bcbcbc;opacity:1;border-radius:5px;margin-bottom:25px}.sign .title[data-v-53d3caae]{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-53d3caae]{margin-top:19px;margin-bottom:50px}.sign .manage img[data-v-53d3caae]{margin-right:20px}.sign .manage span[data-v-53d3caae]{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-53d3caae]{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-53d3caae]{width:400px;height:58px;background:#2b53ec;border-radius:5px;margin-top:40px}.sign .el-checkbox[data-v-53d3caae]{color:#2b53ec}

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%;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)}}.block[data-v-2a09710c]{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)}}.block[data-v-395eec9a]{margin-top:20px}

View File

@ -1 +0,0 @@
.backimg[data-v-602ebc52]{width:100%;height:1080px;background-image:url(../img/%E7%BB%84%2032.a17892e3.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 +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)}}.table[data-v-10d7f5ca]{margin-top:20px;position:relative}.btn[data-v-10d7f5ca]{float:right}[data-v-10d7f5ca] .cell{display:flex;align-items:center}.commodityimg[data-v-10d7f5ca]{width:59px;height:59px;background:hsla(0,0%,89%,.39);opacity:1;display:block;margin-right:12px}.Img[data-v-10d7f5ca]{width:100%;height:100%}.confirmbtn[data-v-10d7f5ca]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-10d7f5ca]{margin-top:30px}.import-right a[data-v-10d7f5ca]{text-decoration:none;color:#000}[data-v-10d7f5ca] .btn11{padding:0;width:14px;height:14px}[data-v-10d7f5ca] .btn11 img{width:100%;height:100%}.page[data-v-10d7f5ca]{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)}}.table[data-v-b19d0430]{margin-top:20px;position:relative}.btn[data-v-b19d0430]{float:right}[data-v-b19d0430] .cell{display:flex;align-items:center}.commodityimg[data-v-b19d0430]{width:59px;height:59px;background:hsla(0,0%,89%,.39);opacity:1;display:block;margin-right:12px}.Img[data-v-b19d0430]{width:100%;height:100%}.confirmbtn[data-v-b19d0430]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-b19d0430]{margin-top:30px}.import-right a[data-v-b19d0430]{text-decoration:none;color:#000}[data-v-b19d0430] .btn11{padding:0;width:14px;height:14px}[data-v-b19d0430] .btn11 img{width:100%;height:100%}.page[data-v-b19d0430]{margin-top:20px}

View File

@ -1 +0,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%;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)}}.width[data-v-00d7c456]{transition:all .3s;opacity:0;width:0!important}.width1[data-v-00d7c456]{transition:all .3s;opacity:1;width:200px!important}.el-container[data-v-00d7c456]{height:100vh}.el-aside[data-v-00d7c456]{background-color:#d3dce6;color:#333;overflow-x:hidden}.el-aside[data-v-00d7c456]::-webkit-scrollbar{width:8px}.el-aside[data-v-00d7c456]::-webkit-scrollbar-thumb{background-color:hsla(220,4%,58%,.3);border-radius:20px}.el-main[data-v-00d7c456]{background-color:#f0f2f5;color:#333;padding:0 0!important}.el-main[data-v-00d7c456]::-webkit-scrollbar{width:10px}.el-main[data-v-00d7c456]::-webkit-scrollbar-thumb{background-color:hsla(220,4%,58%,.3)}.box-card[data-v-00d7c456]{min-height:calc(100vh - 120px);margin:10px}.conent[data-v-00d7c456]{width:100%;min-height:calc(100vh - 200px);position:relative}.add[data-v-00d7c456]{cursor:pointer;font-size:25px;color:#606266}.head[data-v-00d7c456]{padding:10px;background-color:#fff;border-bottom:1px solid #f6f6f6;box-shadow:0 1px 4px rgba(0,21,41,.08)}.head ul[data-v-00d7c456]{display:flex;justify-content:space-between}.head ul li[data-v-00d7c456]{display:flex;align-items:center}.head ul li .right[data-v-00d7c456]{margin-left:20px}.head ul li .token[data-v-00d7c456]{cursor:pointer}.el-aside[data-v-00d7c456]{background:#282c34;box-shadow:2px 0 6px rgba(0,21,41,.35)}[data-v-00d7c456] .el-menu{border:none}.el-menu-item[data-v-00d7c456]:hover{outline:0!important;background:#5470c6!important;border-radius:5px!important}.el-menu-item.is-active[data-v-00d7c456]{color:#fff!important;background:#5470c6!important;border-radius:5px!important}.el-menu-item-group__title[data-v-00d7c456]{padding:0 0!important}

1
public/dist/css/949.3d2ed25d.css vendored Normal file
View File

@ -0,0 +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)}}.block[data-v-26e9f73c]{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><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.c0ecb7b8.js"></script><link href="css/chunk-vendors.77489a8d.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.04652b46.js"></script><script defer="defer" src="js/app.5724815c.js"></script><link href="css/chunk-vendors.77489a8d.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>

View File

@ -1,4 +1,4 @@
(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[850],{5850:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=function(){var e=this,t=e._self._c;return t("div",[t("el-container",[t("el-container",[t("el-aside",{class:e.show?"width":"width1"},[t("el-menu",{attrs:{router:"","background-color":"#282c34","text-color":"#fff","default-active":e.$route.path,"default-openeds":e.openeds}},e._l(e.menu,(function(n){return t("div",{key:n.id},[n.children?t("el-submenu",{attrs:{index:n.code}},[t("template",{slot:"title"},[t("span",[e._v(e._s(n.name))])]),e._l(n.children,(function(n){return t("el-menu-item",{key:n.id,attrs:{index:n.code}},[e._v(e._s(n.name)+" ")])}))],2):t("el-menu-item",{attrs:{index:n.code}},[t("span",[e._v(e._s(n.name))])])],1)})),0)],1),t("el-main",[t("div",{staticClass:"head"},[t("ul",[t("li",[t("div",{staticClass:"add",on:{click:e.add}},[e.show?t("i",{staticClass:"el-icon-s-unfold"}):t("i",{staticClass:"el-icon-s-fold"})]),t("div",{staticClass:"right"},[t("el-breadcrumb",{attrs:{"separator-class":"el-icon-arrow-right"}},e._l(e.titie,(function(n,r){return t("el-breadcrumb-item",{key:r},[e._v(e._s(n.name)+" ")])})),1)],1)]),t("li",[t("div",{staticStyle:{"margin-right":"10px"}},[e._v(e._s(e.usernmae))]),t("div",{staticClass:"token",on:{click:e.hanleLogout}},[e._v("登出")])])])]),t("div",{staticClass:"box-card"},[t("router-view")],1)])],1)],1)],1)},s=[],i=(n(560),n(6525)),a=n(422);function o(){return(0,a.Z)({url:"/api/menus",method:"get"})}var u={mounted(){o().then((e=>{this.menu=e.data.data})),this.usernmae=localStorage.getItem("userName")},data(){return{menu:[],show:!0,levelData:[],titie:[],head:"",onindex:0,openeds:["GOODS_MANAGE"],usernmae:""}},watch:{$route:{handler:function(e){this.titie=e.matched,this.head=e.name,this.levelData.push({name:e.name,path:e.path});const t=[],n={};for(var r=0;r<this.levelData.length;r++)n[this.levelData[r].name]||(t.push(this.levelData[r]),n[this.levelData[r].name]=!0);this.levelData=t},deep:!0,immediate:!0}},methods:{next(){this.hanletop()},hanletop(){document.getElementById("bottom").scrollIntoView({behavior:"smooth"})},hanlebottom(){document.getElementById("top").scrollIntoView({behavior:"smooth"})},hanleLogout(){(0,i.gy)(),this.$router.push({path:"/Login"})},handlerclick(e){this.$route.path!==e&&this.$router.push({path:e})},add(){this.show=!this.show},hanblDelete(e,t){var n=this.levelData[e].name;if(this.onindex=e,this.levelData.splice(this.onindex,1),t===this.head){var r,s;for(let e=0;e<this.levelData.length;e++)r=this.levelData[e].path,s=this.levelData[e].name;this.levelData.length&&s!==n&&this.$router.push({path:r})}}}},l=u,c=n(1001),d=(0,c.Z)(l,r,s,!1,null,"00d7c456",null),m=d.exports},6525:function(e,t,n){"use strict";n.d(t,{LP:function(){return s},gy:function(){return i}});const r="admin_token";function s(){return localStorage.getItem("token")}function i(){return localStorage.removeItem(r)}},422:function(e,t,n){"use strict";var r=n(9669),s=n.n(r),i=n(6525),a=n(4865),o=n.n(a),u=n(4720),l=s().create({timeout:36e4});l.interceptors.request.use((e=>(e.headers.Authorization="Bearer "+(0,i.LP)(),o().start(),e)),(e=>Promise.reject(e))),l.interceptors.response.use((e=>{o().done();const t=e.status;if(200===t||201===t)return e}),(e=>(o().done(),400===e.response.status&&(0,u.Message)({message:e.response.data.errorMessage,type:"error"}),500===e.response.status&&(0,u.Message)({message:e.response.data.message,type:"error"}),Promise.reject(e)))),t.Z=l},4865:function(e,t,n){var r,s;
(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[149],{6149:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=function(){var e=this,t=e._self._c;return t("div",[t("el-container",[t("el-container",[t("el-aside",{class:e.show?"aside-show":"aside-hide"},[t("el-menu",{attrs:{router:"","background-color":"#282c34","text-color":"#fff","default-active":e.$route.path,"default-openeds":e.openeds}},e._l(e.menu,(function(n){return t("div",{key:n.id},[n.children?t("el-submenu",{attrs:{index:n.code}},[t("template",{slot:"title"},[t("span",[e._v(e._s(n.name))])]),e._l(n.children,(function(n){return t("el-menu-item",{key:n.id,attrs:{index:n.code}},[e._v(e._s(n.name)+" ")])}))],2):t("el-menu-item",{attrs:{index:n.code}},[t("span",[e._v(e._s(n.name))])])],1)})),0)],1),t("el-main",[t("div",{staticClass:"head"},[t("ul",[t("li",[t("div",{staticClass:"add",on:{click:e.add}},[e.show?t("i",{staticClass:"el-icon-s-unfold"}):t("i",{staticClass:"el-icon-s-fold"})]),t("div",{staticClass:"right"},[t("el-breadcrumb",{attrs:{"separator-class":"el-icon-arrow-right"}},e._l(e.titie,(function(n,r){return t("el-breadcrumb-item",{key:r},[e._v(e._s(n.name)+" ")])})),1)],1)]),t("li",[t("div",{staticStyle:{"margin-right":"10px"}},[e._v(e._s(e.usernmae))]),t("div",{staticClass:"token",on:{click:e.hanleLogout}},[e._v("登出")])])])]),t("div",{staticClass:"box-card"},[t("router-view")],1)])],1)],1)],1)},s=[],i=(n(560),n(6525)),a=n(422);function o(){return(0,a.Z)({url:"/api/menus",method:"get"})}var u={mounted(){o().then((e=>{this.menu=e.data.data})),this.usernmae=localStorage.getItem("userName")},data(){return{menu:[],show:!0,levelData:[],titie:[],head:"",onindex:0,openeds:["GOODS_MANAGE"],usernmae:""}},watch:{$route:{handler:function(e){this.titie=e.matched,this.head=e.name,this.levelData.push({name:e.name,path:e.path});const t=[],n={};for(var r=0;r<this.levelData.length;r++)n[this.levelData[r].name]||(t.push(this.levelData[r]),n[this.levelData[r].name]=!0);this.levelData=t},deep:!0,immediate:!0}},methods:{next(){this.hanletop()},hanletop(){document.getElementById("bottom").scrollIntoView({behavior:"smooth"})},hanlebottom(){document.getElementById("top").scrollIntoView({behavior:"smooth"})},hanleLogout(){(0,i.gy)(),this.$router.push({path:"/Login"})},handlerclick(e){this.$route.path!==e&&this.$router.push({path:e})},add(){this.show=!this.show},hanblDelete(e,t){var n=this.levelData[e].name;if(this.onindex=e,this.levelData.splice(this.onindex,1),t===this.head){var r,s;for(let e=0;e<this.levelData.length;e++)r=this.levelData[e].path,s=this.levelData[e].name;this.levelData.length&&s!==n&&this.$router.push({path:r})}}}},l=u,c=n(1001),d=(0,c.Z)(l,r,s,!1,null,"c25279e8",null),m=d.exports},6525:function(e,t,n){"use strict";n.d(t,{LP:function(){return s},gy:function(){return i}});const r="admin_token";function s(){return localStorage.getItem("token")}function i(){return localStorage.removeItem(r)}},422:function(e,t,n){"use strict";var r=n(9669),s=n.n(r),i=n(6525),a=n(4865),o=n.n(a),u=n(4720),l=s().create({timeout:36e4});l.interceptors.request.use((e=>(e.headers.Authorization="Bearer "+(0,i.LP)(),o().start(),e)),(e=>Promise.reject(e))),l.interceptors.response.use((e=>{o().done();const t=e.status;if(200===t||201===t)return e}),(e=>(o().done(),400===e.response.status&&(0,u.Message)({message:e.response.data.errorMessage,type:"error"}),500===e.response.status&&(0,u.Message)({message:e.response.data.message,type:"error"}),Promise.reject(e)))),t.Z=l},4865:function(e,t,n){var r,s;
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */(function(i,a){r=a,s="function"===typeof r?r.call(t,n,t,e):r,void 0===s||(e.exports=s)})(0,(function(){var e={version:"0.2.0"},t=e.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function n(e,t,n){return e<t?t:e>n?n:e}function r(e){return 100*(-1+e)}function s(e,n,s){var i;return i="translate3d"===t.positionUsing?{transform:"translate3d("+r(e)+"%,0,0)"}:"translate"===t.positionUsing?{transform:"translate("+r(e)+"%,0)"}:{"margin-left":r(e)+"%"},i.transition="all "+n+"ms "+s,i}e.configure=function(e){var n,r;for(n in e)r=e[n],void 0!==r&&e.hasOwnProperty(n)&&(t[n]=r);return this},e.status=null,e.set=function(r){var o=e.isStarted();r=n(r,t.minimum,1),e.status=1===r?null:r;var u=e.render(!o),l=u.querySelector(t.barSelector),c=t.speed,d=t.easing;return u.offsetWidth,i((function(n){""===t.positionUsing&&(t.positionUsing=e.getPositioningCSS()),a(l,s(r,c,d)),1===r?(a(u,{transition:"none",opacity:1}),u.offsetWidth,setTimeout((function(){a(u,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){e.remove(),n()}),c)}),c)):setTimeout(n,c)})),this},e.isStarted=function(){return"number"===typeof e.status},e.start=function(){e.status||e.set(0);var n=function(){setTimeout((function(){e.status&&(e.trickle(),n())}),t.trickleSpeed)};return t.trickle&&n(),this},e.done=function(t){return t||e.status?e.inc(.3+.5*Math.random()).set(1):this},e.inc=function(t){var r=e.status;return r?("number"!==typeof t&&(t=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+t,0,.994),e.set(r)):e.start()},e.trickle=function(){return e.inc(Math.random()*t.trickleRate)},function(){var t=0,n=0;e.promise=function(r){return r&&"resolved"!==r.state()?(0===n&&e.start(),t++,n++,r.always((function(){n--,0===n?(t=0,e.done()):e.set((t-n)/t)})),this):this}}(),e.render=function(n){if(e.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var s=document.createElement("div");s.id="nprogress",s.innerHTML=t.template;var i,o=s.querySelector(t.barSelector),l=n?"-100":r(e.status||0),c=document.querySelector(t.parent);return a(o,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),t.showSpinner||(i=s.querySelector(t.spinnerSelector),i&&d(i)),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(s),s},e.remove=function(){l(document.documentElement,"nprogress-busy"),l(document.querySelector(t.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&d(e)},e.isRendered=function(){return!!document.getElementById("nprogress")},e.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var i=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),a=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;var r,s=e.length,i=t.charAt(0).toUpperCase()+t.slice(1);while(s--)if(r=e[s]+i,r in n)return r;return t}function s(e){return e=n(e),t[e]||(t[e]=r(e))}function i(e,t,n){t=s(t),e.style[t]=n}return function(e,t){var n,r,s=arguments;if(2==s.length)for(n in t)r=t[n],void 0!==r&&t.hasOwnProperty(n)&&i(e,n,r);else i(e,s[1],s[2])}}();function o(e,t){var n="string"==typeof e?e:c(e);return n.indexOf(" "+t+" ")>=0}function u(e,t){var n=c(e),r=n+t;o(n,t)||(e.className=r.substring(1))}function l(e,t){var n,r=c(e);o(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function c(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function d(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return e}))}}]);
//# sourceMappingURL=850.859881d2.js.map
//# sourceMappingURL=149.e30dbb84.js.map

1
public/dist/js/149.e30dbb84.js.map 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

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

2
public/dist/js/485.55972a3f.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/485.55972a3f.js.map 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

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

4
public/dist/js/550.5647f99e.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/550.5647f99e.js.map 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

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

@ -1,4 +1,4 @@
(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[637],{6637:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"conent"},[t("div",{staticClass:"from"},[t("el-dialog",{attrs:{title:"新增角色",visible:e.dialogVisible2,width:"30%","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible2=t}}},[t("div",[t("el-form",{attrs:{"label-width":"80px"}},[t("el-form-item",{attrs:{label:"角色名称"}},[t("el-input",{model:{value:e.newrole,callback:function(t){e.newrole=t},expression:"newrole"}})],1),t("div",{staticClass:"from-btn"},[t("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dialogVisible2=!1}}},[e._v("取消")]),t("el-button",{on:{click:e.onSubmit}},[e._v("确认")])],1)],1)],1)])],1),t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogVisible2=!0}}},[e._v("新增")]),t("div",{staticClass:"table",staticStyle:{"margin-top":"10px"}},[t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableList}},[t("el-table-column",{attrs:{prop:"id",label:"ID"}}),t("el-table-column",{attrs:{prop:"name",label:"角色名称"}}),t("el-table-column",{attrs:{label:"权限内容"},scopedSlots:e._u([{key:"default",fn:function(n){return e._l(n.row.permissions,(function(n){return t("span",{key:n.id},[e._v(e._s(n.name)+" ")])}))}}])}),t("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(n){return[t("el-button",{on:{click:function(t){return e.onEdit(n.row)}}},[e._v("编辑")])]}}])})],1)],1),t("el-dialog",{attrs:{title:"编辑权限",visible:e.dialogVisible,width:"30%","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible=t}}},[e.isShowtree?t("el-tree",{ref:"tree",attrs:{data:e.Role_Permission,"show-checkbox":"","default-expand-all":!1,"node-key":"id","highlight-current":"",props:e.defaultProps,"default-checked-keys":e.chekedKeys},model:{value:e.permissionIds,callback:function(t){e.permissionIds=t},expression:"permissionIds"}}):e._e(),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){return e.cancel()}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.getCheckedKeys()}}},[e._v("确 定")])],1)],1)],1)},i=[],r=n(422);function o(){return(0,r.Z)({url:"/api/roles",method:"get"})}function a(e){return(0,r.Z)({url:"/api/roles",method:"post",data:e})}function l(){return(0,r.Z)({url:"/api/permissions",method:"get"})}function u(e,t){return(0,r.Z)({url:`/api/roles/${e}/permissions`,method:"post",data:t})}var c={data(){return{id:"",loading:!0,tableList:[],rolePermissions:[],newrole:"",dialogVisible:!1,dialogVisible2:!1,permissionIds:[],allpermissionIds:{},Role_Permission:[],defaultProps:{children:"children",label:"name"},isShowtree:!1,chekedKeys:[]}},mounted(){this.getroleList(),this.getJurisdiction()},methods:{getroleList(){o().then((e=>{this.tableList=e.data.data})),this.loading=!1},getJurisdiction(){l().then((e=>{this.Role_Permission=e.data.data}))},onSubmit(){let e={name:this.newrole};a(e).then((e=>{this.dialogVisible2=!1,this.getroleList(),201==e.status&&this.$message({message:"角色添加成功!",type:"success"})}))},onEdit(e){this.id=e.id;let t=e.permissions.map((e=>e.id));this.chekedKeys=t,this.dialogVisible=!0,this.isShowtree=!0},cancel(){this.dialogVisible=!1,this.isShowtree=!1},getCheckedKeys(){let e=this.id;this.permissionIds=this.$refs.tree.getCheckedKeys(),this.allpermissionIds={permissionIds:this.permissionIds},u(e,this.allpermissionIds).then((e=>{200===e.status&&(this.dialogVisible=!1,this.getroleList(),this.$message({message:"权限修改成功!",type:"success"}))}))}}},d=c,m=n(1001),p=(0,m.Z)(d,s,i,!1,null,"7d26d779",null),f=p.exports},6525:function(e,t,n){"use strict";n.d(t,{LP:function(){return i},gy:function(){return r}});const s="admin_token";function i(){return localStorage.getItem("token")}function r(){return localStorage.removeItem(s)}},422:function(e,t,n){"use strict";var s=n(9669),i=n.n(s),r=n(6525),o=n(4865),a=n.n(o),l=n(4720),u=i().create({timeout:36e4});u.interceptors.request.use((e=>(e.headers.Authorization="Bearer "+(0,r.LP)(),a().start(),e)),(e=>Promise.reject(e))),u.interceptors.response.use((e=>{a().done();const t=e.status;if(200===t||201===t)return e}),(e=>(a().done(),400===e.response.status&&(0,l.Message)({message:e.response.data.errorMessage,type:"error"}),500===e.response.status&&(0,l.Message)({message:e.response.data.message,type:"error"}),Promise.reject(e)))),t.Z=u},4865:function(e,t,n){var s,i;
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */(function(r,o){s=o,i="function"===typeof s?s.call(t,n,t,e):s,void 0===i||(e.exports=i)})(0,(function(){var e={version:"0.2.0"},t=e.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function n(e,t,n){return e<t?t:e>n?n:e}function s(e){return 100*(-1+e)}function i(e,n,i){var r;return r="translate3d"===t.positionUsing?{transform:"translate3d("+s(e)+"%,0,0)"}:"translate"===t.positionUsing?{transform:"translate("+s(e)+"%,0)"}:{"margin-left":s(e)+"%"},r.transition="all "+n+"ms "+i,r}e.configure=function(e){var n,s;for(n in e)s=e[n],void 0!==s&&e.hasOwnProperty(n)&&(t[n]=s);return this},e.status=null,e.set=function(s){var a=e.isStarted();s=n(s,t.minimum,1),e.status=1===s?null:s;var l=e.render(!a),u=l.querySelector(t.barSelector),c=t.speed,d=t.easing;return l.offsetWidth,r((function(n){""===t.positionUsing&&(t.positionUsing=e.getPositioningCSS()),o(u,i(s,c,d)),1===s?(o(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){o(l,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){e.remove(),n()}),c)}),c)):setTimeout(n,c)})),this},e.isStarted=function(){return"number"===typeof e.status},e.start=function(){e.status||e.set(0);var n=function(){setTimeout((function(){e.status&&(e.trickle(),n())}),t.trickleSpeed)};return t.trickle&&n(),this},e.done=function(t){return t||e.status?e.inc(.3+.5*Math.random()).set(1):this},e.inc=function(t){var s=e.status;return s?("number"!==typeof t&&(t=(1-s)*n(Math.random()*s,.1,.95)),s=n(s+t,0,.994),e.set(s)):e.start()},e.trickle=function(){return e.inc(Math.random()*t.trickleRate)},function(){var t=0,n=0;e.promise=function(s){return s&&"resolved"!==s.state()?(0===n&&e.start(),t++,n++,s.always((function(){n--,0===n?(t=0,e.done()):e.set((t-n)/t)})),this):this}}(),e.render=function(n){if(e.isRendered())return document.getElementById("nprogress");l(document.documentElement,"nprogress-busy");var i=document.createElement("div");i.id="nprogress",i.innerHTML=t.template;var r,a=i.querySelector(t.barSelector),u=n?"-100":s(e.status||0),c=document.querySelector(t.parent);return o(a,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),t.showSpinner||(r=i.querySelector(t.spinnerSelector),r&&d(r)),c!=document.body&&l(c,"nprogress-custom-parent"),c.appendChild(i),i},e.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(t.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&d(e)},e.isRendered=function(){return!!document.getElementById("nprogress")},e.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var r=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),o=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function s(t){var n=document.body.style;if(t in n)return t;var s,i=e.length,r=t.charAt(0).toUpperCase()+t.slice(1);while(i--)if(s=e[i]+r,s in n)return s;return t}function i(e){return e=n(e),t[e]||(t[e]=s(e))}function r(e,t,n){t=i(t),e.style[t]=n}return function(e,t){var n,s,i=arguments;if(2==i.length)for(n in t)s=t[n],void 0!==s&&t.hasOwnProperty(n)&&r(e,n,s);else r(e,i[1],i[2])}}();function a(e,t){var n="string"==typeof e?e:c(e);return n.indexOf(" "+t+" ")>=0}function l(e,t){var n=c(e),s=n+t;a(n,t)||(e.className=s.substring(1))}function u(e,t){var n,s=c(e);a(e,t)&&(n=s.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function c(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function d(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return e}))}}]);
//# sourceMappingURL=637.dc023aa1.js.map
//# sourceMappingURL=637.b55d71e8.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[650],{1650:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return c}});var n=function(){var t=this,e=t._self._c;return e("div",[e("el-card",{staticClass:"box-card",attrs:{"body-style":{padding:"20px 20px 0 20px"}}},[e("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.formSearch}},[e("el-form-item",{attrs:{label:"团购状态"}},[e("el-select",{attrs:{placeholder:"团购状态"},model:{value:t.formSearch.status,callback:function(e){t.$set(t.formSearch,"status",e)},expression:"formSearch.status"}},[e("el-option",{attrs:{label:"未开始",value:"-5"}}),e("el-option",{attrs:{label:"跟团中",value:"1"}}),e("el-option",{attrs:{label:"预览中",value:"-10"}}),e("el-option",{attrs:{label:"已结束",value:"20"}})],1)],1),e("el-form-item",{attrs:{label:"活动标题"}},[e("el-input",{attrs:{placeholder:"活动标题"},model:{value:t.formSearch.title,callback:function(e){t.$set(t.formSearch,"title",e)},expression:"formSearch.title"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.getGroupList()}}},[t._v("查询")]),e("el-button",{attrs:{type:"success"},on:{click:function(e){return t.groupAdd()}}},[t._v("新增团购")])],1)],1)],1),e("el-card",{staticClass:"box-card",staticStyle:{"margin-top":"10px"}},[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"","row-key":"id","tree-props":{children:"children"}}},[e("el-table-column",{attrs:{prop:"shop.name",label:"店铺"}}),e("el-table-column",{attrs:{prop:"title",label:"活动标题"}}),e("el-table-column",{attrs:{prop:"status",label:"团购状态"}}),e("el-table-column",{attrs:{label:"开团时间"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("div",[t._v(t._s(r.row.start_time))]),e("div",[t._v("至")]),e("div",[t._v(t._s(r.row.end_time))])]}}])}),e("el-table-column",{attrs:{label:"手机查看"},scopedSlots:t._u([{key:"default",fn:function(t){return[e("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:t.row.qr_code_url}})]}}])}),e("el-table-column",{attrs:{prop:"create_status",label:"创建结果"}}),e("el-table-column",{attrs:{prop:"options",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(r){return[0==r.row.parent_id?e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.groupEdit(r.row.id)}}},[t._v("编辑")]):t._e()]}}])})],1)],1)],1)},o=[],s=(r(560),r(8159)),a={data(){return{formSearch:{status:"",title:"",page:1,per_page:20},loading:!0,tableData:[]}},mounted(){this.getGroupList()},methods:{getGroupList(){(0,s.X8)(this.formSearch).then((t=>{this.tableData=t.data.data,this.loading=!1}))},groupAdd(){this.$router.push({path:"GROUP_GOODS_ADD",query:{id:0}})},groupEdit(t){this.$router.push({path:"GROUP_GOODS_EDIT",query:{id:t}})}}},i=a,u=r(1001),l=(0,u.Z)(i,n,o,!1,null,null,null),c=l.exports},8159:function(t,e,r){"use strict";r.d(e,{Rp:function(){return s},Tv:function(){return i},X8:function(){return o},Y6:function(){return a},ni:function(){return l},sC:function(){return u}});var n=r(422);function o(t){return(0,n.Z)({url:"/api/group",method:"get",params:t})}function s(t){return(0,n.Z)({url:"/api/group",method:"post",data:t})}function a(t){return(0,n.Z)({url:`/api/group/${t}`,method:"get"})}function i(t,e){return(0,n.Z)({url:`/api/group/${t}`,method:"patch",data:e})}function u(t){return(0,n.Z)({url:"/api/groupGoods",method:"get",params:t})}function l(t){return(0,n.Z)({url:"/api/groupGoods",method:"post",params:t})}},6525:function(t,e,r){"use strict";r.d(e,{LP:function(){return o},gy:function(){return s}});const n="admin_token";function o(){return localStorage.getItem("token")}function s(){return localStorage.removeItem(n)}},422:function(t,e,r){"use strict";var n=r(9669),o=r.n(n),s=r(6525),a=r(4865),i=r.n(a),u=r(4720),l=o().create({timeout:36e4});l.interceptors.request.use((t=>(t.headers.Authorization="Bearer "+(0,s.LP)(),i().start(),t)),(t=>Promise.reject(t))),l.interceptors.response.use((t=>{i().done();const e=t.status;if(200===e||201===e)return t}),(t=>(i().done(),400===t.response.status&&(0,u.Message)({message:t.response.data.errorMessage,type:"error"}),500===t.response.status&&(0,u.Message)({message:t.response.data.message,type:"error"}),Promise.reject(t)))),e.Z=l},4865:function(t,e,r){var n,o;
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */(function(s,a){n=a,o="function"===typeof n?n.call(e,r,e,t):n,void 0===o||(t.exports=o)})(0,(function(){var t={version:"0.2.0"},e=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function r(t,e,r){return t<e?e:t>r?r:t}function n(t){return 100*(-1+t)}function o(t,r,o){var s;return s="translate3d"===e.positionUsing?{transform:"translate3d("+n(t)+"%,0,0)"}:"translate"===e.positionUsing?{transform:"translate("+n(t)+"%,0)"}:{"margin-left":n(t)+"%"},s.transition="all "+r+"ms "+o,s}t.configure=function(t){var r,n;for(r in t)n=t[r],void 0!==n&&t.hasOwnProperty(r)&&(e[r]=n);return this},t.status=null,t.set=function(n){var i=t.isStarted();n=r(n,e.minimum,1),t.status=1===n?null:n;var u=t.render(!i),l=u.querySelector(e.barSelector),c=e.speed,p=e.easing;return u.offsetWidth,s((function(r){""===e.positionUsing&&(e.positionUsing=t.getPositioningCSS()),a(l,o(n,c,p)),1===n?(a(u,{transition:"none",opacity:1}),u.offsetWidth,setTimeout((function(){a(u,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){t.remove(),r()}),c)}),c)):setTimeout(r,c)})),this},t.isStarted=function(){return"number"===typeof t.status},t.start=function(){t.status||t.set(0);var r=function(){setTimeout((function(){t.status&&(t.trickle(),r())}),e.trickleSpeed)};return e.trickle&&r(),this},t.done=function(e){return e||t.status?t.inc(.3+.5*Math.random()).set(1):this},t.inc=function(e){var n=t.status;return n?("number"!==typeof e&&(e=(1-n)*r(Math.random()*n,.1,.95)),n=r(n+e,0,.994),t.set(n)):t.start()},t.trickle=function(){return t.inc(Math.random()*e.trickleRate)},function(){var e=0,r=0;t.promise=function(n){return n&&"resolved"!==n.state()?(0===r&&t.start(),e++,r++,n.always((function(){r--,0===r?(e=0,t.done()):t.set((e-r)/e)})),this):this}}(),t.render=function(r){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var o=document.createElement("div");o.id="nprogress",o.innerHTML=e.template;var s,i=o.querySelector(e.barSelector),l=r?"-100":n(t.status||0),c=document.querySelector(e.parent);return a(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),e.showSpinner||(s=o.querySelector(e.spinnerSelector),s&&p(s)),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(o),o},t.remove=function(){l(document.documentElement,"nprogress-busy"),l(document.querySelector(e.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&p(t)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var s=function(){var t=[];function e(){var r=t.shift();r&&r(e)}return function(r){t.push(r),1==t.length&&e()}}(),a=function(){var t=["Webkit","O","Moz","ms"],e={};function r(t){return t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()}))}function n(e){var r=document.body.style;if(e in r)return e;var n,o=t.length,s=e.charAt(0).toUpperCase()+e.slice(1);while(o--)if(n=t[o]+s,n in r)return n;return e}function o(t){return t=r(t),e[t]||(e[t]=n(t))}function s(t,e,r){e=o(e),t.style[e]=r}return function(t,e){var r,n,o=arguments;if(2==o.length)for(r in e)n=e[r],void 0!==n&&e.hasOwnProperty(r)&&s(t,r,n);else s(t,o[1],o[2])}}();function i(t,e){var r="string"==typeof t?t:c(t);return r.indexOf(" "+e+" ")>=0}function u(t,e){var r=c(t),n=r+e;i(r,e)||(t.className=n.substring(1))}function l(t,e){var r,n=c(t);i(t,e)&&(r=n.replace(" "+e+" "," "),t.className=r.substring(1,r.length-1))}function c(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function p(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return t}))}}]);
//# sourceMappingURL=650.17113dd0.js.map
//# sourceMappingURL=650.4a6fd4cf.js.map

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

4
public/dist/js/674.126dda2f.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/674.126dda2f.js.map vendored Normal file

File diff suppressed because one or more lines are too long

4
public/dist/js/679.af96d243.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/679.af96d243.js.map 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

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

4
public/dist/js/949.aa6405fe.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/949.aa6405fe.js.map vendored Normal file

File diff suppressed because one or more lines are too long

2
public/dist/js/app.5724815c.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/app.5724815c.js.map 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

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@
"axios": "^0.21.1",
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"luxon": "^3.4.4",
"nprogress": "^0.2.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",

View File

@ -0,0 +1,9 @@
import http from "@/util/http.js";
export function getSalesReportData(params) {
return http({
url: "/api/data_center/sales_report",
method: "get",
params,
});
}

View File

@ -17,7 +17,7 @@ export function goods(params) {
params,
});
}
// 新建商品
// 新增商品/规格
export function addGoods(data) {
return http({
url: "/api/goods",
@ -186,4 +186,4 @@ export function delGoodsCombination(id) {
url: "/api/goods_combination/" + id,
method: "delete",
});
}
}

Some files were not shown because too many files have changed in this diff Show More