mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
feat: 基础完成
This commit is contained in:
parent
1b02f90047
commit
feddef6278
@ -170,6 +170,7 @@ class DailySalesReport extends Command
|
|||||||
$s => $sVal,
|
$s => $sVal,
|
||||||
$sRate => $sRateVal,
|
$sRate => $sRateVal,
|
||||||
'already_cancel_number' => $datum['total_already_cancel_number'],
|
'already_cancel_number' => $datum['total_already_cancel_number'],
|
||||||
|
'goal_rate' => $goodsSkus[$externalSkuId]['goal_rate'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console;
|
namespace App\Console;
|
||||||
|
|
||||||
|
use App\Console\Commands\DailySalesReport;
|
||||||
use App\Console\Commands\GoodsSkuDailyReport;
|
use App\Console\Commands\GoodsSkuDailyReport;
|
||||||
use App\Console\Commands\Inventory;
|
use App\Console\Commands\Inventory;
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
@ -30,9 +31,19 @@ class Kernel extends ConsoleKernel
|
|||||||
{
|
{
|
||||||
// 服务器/etc/crontab添加cron入口
|
// 服务器/etc/crontab添加cron入口
|
||||||
// * * * * * cd /home/wwwroot/erp.chutang66.com && php artisan schedule:run >> /dev/null 2>&1
|
// * * * * * 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(GoodsSkuDailyReport::class)->dailyAt('06:00');
|
||||||
$schedule->command(Inventory::class)->dailyAt('07: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();
|
$schedule->command(DeleteKttQuery::class)->daily();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -121,6 +121,7 @@ class GoodsSkusController extends Controller
|
|||||||
$sku['order_detail'] = [];
|
$sku['order_detail'] = [];
|
||||||
$sku['order_goods_num'] = 0;
|
$sku['order_goods_num'] = 0;
|
||||||
}
|
}
|
||||||
|
$sku['order_goods_num'] -= $sku['daily']['reissue_num'];
|
||||||
$sku['inventory_time'] = $lastInventoryTime;
|
$sku['inventory_time'] = $lastInventoryTime;
|
||||||
if ('销售' === $rolesName[0]) {
|
if ('销售' === $rolesName[0]) {
|
||||||
$sku['cost'] = 0;
|
$sku['cost'] = 0;
|
||||||
@ -436,7 +437,7 @@ class GoodsSkusController extends Controller
|
|||||||
$rules = [
|
$rules = [
|
||||||
'updateField' => [
|
'updateField' => [
|
||||||
'required',
|
'required',
|
||||||
Rule::in(['reference_price', 'reserve', 'loss_num', 'status'])
|
Rule::in(['reference_price', 'reserve', 'loss_num', 'status', 'goal_rate'])
|
||||||
],
|
],
|
||||||
'reference_price' => [
|
'reference_price' => [
|
||||||
'sometimes',
|
'sometimes',
|
||||||
@ -460,7 +461,13 @@ class GoodsSkusController extends Controller
|
|||||||
'sometimes',
|
'sometimes',
|
||||||
'required',
|
'required',
|
||||||
'integer',
|
'integer',
|
||||||
Rule::in([0, 1, 2])],
|
Rule::in([0, 1, 2])
|
||||||
|
],
|
||||||
|
'goal_rate' => [
|
||||||
|
'sometimes',
|
||||||
|
'numeric',
|
||||||
|
'gt:0'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
$validator = Validator::make($request->all(), $rules);
|
$validator = Validator::make($request->all(), $rules);
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@ -477,6 +484,9 @@ class GoodsSkusController extends Controller
|
|||||||
$this->log->message = $request->get('reason');
|
$this->log->message = $request->get('reason');
|
||||||
$this->setBeforeUpdateForLog($record->loss_num);
|
$this->setBeforeUpdateForLog($record->loss_num);
|
||||||
$record->loss_num += $request->loss_num;
|
$record->loss_num += $request->loss_num;
|
||||||
|
if ('补发' === $request->get('reason')) {
|
||||||
|
$record->reissue_num += $request->loss_num;
|
||||||
|
}
|
||||||
$record->save();
|
$record->save();
|
||||||
$this->setAfterUpdateForLog($record->loss_num);
|
$this->setAfterUpdateForLog($record->loss_num);
|
||||||
$sku->stock -= $request->loss_num;
|
$sku->stock -= $request->loss_num;
|
||||||
|
|||||||
@ -41,6 +41,11 @@ class GoodsSkuRequest extends FormRequest
|
|||||||
'sometimes',
|
'sometimes',
|
||||||
'integer',
|
'integer',
|
||||||
],
|
],
|
||||||
|
'goal_rate' => [
|
||||||
|
'sometimes',
|
||||||
|
'numeric',
|
||||||
|
'gt:0'
|
||||||
|
],
|
||||||
'loss_num' => [
|
'loss_num' => [
|
||||||
'sometimes',
|
'sometimes',
|
||||||
'integer',
|
'integer',
|
||||||
|
|||||||
@ -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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -22,28 +22,30 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品编码:">
|
<el-form-item label="商品编码:">
|
||||||
<el-input v-model="form.external_sku_id" placeholder="商品编码" style="width: 100px">
|
<el-input v-model="form.external_sku_id" placeholder="商品编码" style="width: 125px">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品状态:">
|
<el-form-item label="商品状态:">
|
||||||
<el-select v-model="form.status" placeholder="商品状态" style="width: 115px">
|
<el-select v-model="form.status" placeholder="商品状态" style="width: 125px">
|
||||||
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id">
|
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="form.keyword_type" style="width: 80px; margin-right: 5px; margin-left: 10px">
|
<el-select v-model="form.keyword_type"
|
||||||
<el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value">
|
style="width: 80px; margin-right: 5px; margin-left: 10px">
|
||||||
|
<el-option v-for="item in options3" :key="item.value" :label="item.label"
|
||||||
|
:value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-date-picker v-model="value1" type="datetimerange" range-separator="-" start-placeholder="开始时间"
|
<el-date-picker v-model="datePicker" type="datetimerange" range-separator="-"
|
||||||
end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss" @change="getSTime"
|
start-placeholder="开始时间" end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
style="width: 300px">
|
@change="getSTime" style="width: 300px">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleChoose(1)">筛选</el-button>
|
<el-button type="primary" @click="handleChoose(1)">筛选</el-button>
|
||||||
<el-button plain @click="handleReChoose()">重置筛选</el-button>
|
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -57,22 +59,23 @@
|
|||||||
<span> 玫瑰合计: {{ rose_num }}</span>
|
<span> 玫瑰合计: {{ rose_num }}</span>
|
||||||
<span> 其它合计: {{ other_num }}</span>
|
<span> 其它合计: {{ other_num }}</span>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-button type="primary" plain @click="resetOrderCount()">订单重置</el-button>
|
<el-button type="primary" plain @click="resetOrderCount">订单重置</el-button>
|
||||||
<el-button type="primary" plain @click="update()">上新</el-button>
|
<el-button type="primary" plain @click="update">上新</el-button>
|
||||||
<el-upload ref="newset" action="/api/new/set/goods_skus" :multiple="false" name="newSetFile"
|
<el-upload ref="newset" action="/api/new/set/goods_skus" :multiple="false" name="newSetFile"
|
||||||
:show-file-list="false" :on-success="inventorySuccess" :before-upload="beforeInventory"
|
:show-file-list="false" :on-success="inventorySuccess" :before-upload="beforeInventory"
|
||||||
:on-error="inventoryError" style="display:inline-block;margin: 0 10px 0 10px;">
|
:on-error="inventoryError" style="display:inline-block;margin: 0 10px 0 10px;">
|
||||||
<el-button type="primary" plain>上新导入</el-button>
|
<el-button type="primary" plain>上新导入</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-upload ref="myUpload" action="/api/inventory/goods_skus" :multiple="false" name="inventoryFile"
|
<el-upload ref="myUpload" action="/api/inventory/goods_skus" :multiple="false"
|
||||||
:show-file-list="false" :on-success="inventorySuccess" :before-upload="beforeInventory"
|
name="inventoryFile" :show-file-list="false" :on-success="inventorySuccess"
|
||||||
:on-error="inventoryError" style="display:inline-block;margin: 0 10px 0 10px;">
|
:before-upload="beforeInventory" :on-error="inventoryError"
|
||||||
|
style="display:inline-block;margin: 0 10px 0 10px;">
|
||||||
<el-button type="primary" plain>盘点导入</el-button>
|
<el-button type="primary" plain>盘点导入</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button type="primary" plain @click="addNewgoods">新增商品</el-button>
|
<el-button type="primary" plain @click="addNewgoods">新增商品</el-button>
|
||||||
<el-button type="primary" plain @click="handleImport()">导入商品</el-button>
|
<el-button type="primary" plain @click="handleImport">导入商品</el-button>
|
||||||
<el-button type="primary" plain @click="handleExport()">表格导出</el-button>
|
<el-button type="primary" plain @click="handleExport">表格导出</el-button>
|
||||||
<el-button type="primary" plain @click="onCount()">库存盘点</el-button>
|
<el-button type="primary" plain @click="onCount">库存盘点</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -88,34 +91,25 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>{{ scope.row.name }}</p>
|
<p>{{ scope.row.name }}</p>
|
||||||
<p>
|
<p>{{ scope.row.external_sku_id }}</p>
|
||||||
{{ scope.row.goods.goods_code + "_" + scope.row.sku_code }}
|
<p>{{ scope.row.goods.updated_at }}</p>
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
{{ scope.row.goods.updated_at }}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="品类">
|
<el-table-column label="品类">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>{{ scope.row.goods.type ? scope.row.goods.type.name : "" }}</div>
|
||||||
{{ scope.row.goods.type ? scope.row.goods.type.name : "" }}
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="规格" prop="title"></el-table-column>
|
<el-table-column label="规格" prop="title"></el-table-column>
|
||||||
<el-table-column label="品牌">
|
<el-table-column label="品牌">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>{{ scope.row.goods.brand ? scope.row.goods.brand.name : "" }}</div>
|
||||||
{{ scope.row.goods.brand ? scope.row.goods.brand.name : "" }}
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column prop="two_days_ago_num" sortable label="2T">
|
<!-- <el-table-column prop="two_days_ago_num" sortable label="2T">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column prop="yesterday_num" sortable label="1T">
|
<el-table-column prop="yesterday_num" sortable label="1T"></el-table-column>
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column sortable label="0T">
|
<el-table-column sortable label="0T">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -139,101 +133,109 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="reference_price" sortable label="售价">
|
<!-- <el-table-column prop="reference_price" sortable label="售价">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.id === id">
|
<div v-if="scope.row.id === editPriceId">
|
||||||
<el-input v-model="scope.row.reference_price" @blur="reference_priceBlur(scope.row)">
|
<el-input v-model="scope.row.reference_price" @blur="referencePriceBlur(scope.row)">
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ scope.row.reference_price }}
|
{{ scope.row.reference_price }}
|
||||||
<el-button slot="reference" class="btn11" @click="reference_priceClick(scope.row.id)">
|
<el-button slot="reference" class="btn11" @click="referencePriceClick(scope.row.id)">
|
||||||
<img src="../../css/img/编辑.png" />
|
<img src="../../css/img/编辑.png" />
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<!-- <el-table-column prop="num" sortable label="总量">
|
<!-- <el-table-column prop="num" sortable label="总量">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
<el-table-column prop="goal_rate" sortable label="目标去化率">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-if="scope.row.id === editGoalId">
|
||||||
|
<el-input v-model="scope.row.goal_rate" autofocus @blur="blurGoal"
|
||||||
|
@change="changeGoal(scope.row)"></el-input>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
{{ scope.row.goal_rate }}
|
||||||
|
</div>
|
||||||
|
<i class="el-icon-edit" @click="onGoal(scope.row)" style="padding-left: 5px;"></i>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column prop="reserve" sortable label="预留">
|
<el-table-column prop="reserve" sortable label="预留">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.id === id1">
|
<div v-if="scope.row.id === editReserveId">
|
||||||
<el-input v-model="scope.row.reserve" @blur="reservebBlur(scope.row)"></el-input>
|
<el-input v-model="scope.row.reserve" autofocus @blur="cancelReserve"
|
||||||
|
@change="reservebBlur(scope.row)"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ scope.row.reserve }}
|
{{ scope.row.reserve }}
|
||||||
</div>
|
</div>
|
||||||
<el-button slot="reference" class="btn11" @click="onreserve(scope.row.id)"><img
|
<i class="el-icon-edit" @click="onreserve(scope.row)" style="padding-left: 5px;"></i>
|
||||||
src="../../css/img/编辑.png" alt="" /></el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column sortable label="销量">
|
<el-table-column sortable label="销量">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>{{ scope.row.order_goods_num }}</div>
|
||||||
<span>{{ scope.row.order_goods_num }}</span>
|
<el-popover placement="right-start" trigger="hover"
|
||||||
</div>
|
v-if="scope.row.order_detail.length !== 0">
|
||||||
<el-popover placement="right-start" trigger="hover" v-if="scope.row.order_detail.length !== 0">
|
|
||||||
<div>
|
<div>
|
||||||
<span v-for="(j, index) in scope.row.order_detail" :key="index">
|
<span v-for="(j, index) in scope.row.order_detail" :key="index">
|
||||||
<div>{{ j.shop.name }}:{{ j.number }}</div>
|
<div>{{ j.shop.name }}:{{ j.number }}</div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button class="btn11" type="text" slot="reference"><img src="../../css/img/眼睛.png"
|
<i class="el-icon-view" slot="reference" style="padding-left: 5px;"></i>
|
||||||
alt="" />
|
|
||||||
</el-button>
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column sortable label="损耗">
|
<el-table-column sortable label="损耗">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.id === id2">
|
<div v-if="scope.row.id === editLossId">
|
||||||
<el-input v-model="scope.row.daily.loss_num"></el-input>
|
<el-input v-model="scope.row.daily.loss_num"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ scope.row.daily.loss_num }}
|
{{ scope.row.daily.loss_num }}
|
||||||
</div>
|
</div>
|
||||||
<el-popover placement="right-start" trigger="click" @hide="noBubbles" width="264">
|
|
||||||
<div>
|
|
||||||
<span>损耗数量: </span>
|
|
||||||
<el-input v-model="scope.row.daily.loss_num" style="width: 200px;"></el-input>
|
|
||||||
</div>
|
|
||||||
<div style="margin-top: 10px;">
|
|
||||||
<span>原因: </span>
|
|
||||||
<el-radio-group v-model="radio" style="width: 220px;">
|
|
||||||
<el-radio label="48h以上">48h以上</el-radio>
|
|
||||||
<el-radio label="到货错误">到货错误</el-radio>
|
|
||||||
<el-radio label="灰霉">灰霉</el-radio>
|
|
||||||
<el-radio label="长度">长度</el-radio>
|
|
||||||
<el-radio label="花朵">花朵</el-radio>
|
|
||||||
<el-radio label="其他">其他</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
<div style="margin-top: 10px;">
|
|
||||||
<el-button type="primary" @click="onLoss(scope.row)" size="mini">保存</el-button>
|
|
||||||
<!-- <el-button size="mini" type="primary" plain @click="closeLossPopover()">取消
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-button slot="reference" class="btn11" @click="loss(scope.row.id)">
|
<el-popover placement="right-start" trigger="click" @hide="noBubbles">
|
||||||
<img src="../../css/img/编辑.png" alt="" />
|
<el-form ref="lossForm" size="mini" label-width="80px">
|
||||||
</el-button>
|
<el-form-item label="损耗数量">
|
||||||
|
<el-input v-model="scope.row.daily.loss_num"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原因">
|
||||||
|
<el-radio-group v-model="radio">
|
||||||
|
<el-radio label="48h以上">48h以上</el-radio>
|
||||||
|
<el-radio label="到货错误">到货错误</el-radio>
|
||||||
|
<el-radio label="灰霉">灰霉</el-radio>
|
||||||
|
<el-radio label="长度">长度</el-radio>
|
||||||
|
<el-radio label="花朵">花朵</el-radio>
|
||||||
|
<el-radio label="其他">其他</el-radio>
|
||||||
|
<el-radio label="补发">补发</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onLoss(scope.row.id)">保存</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<i class="el-icon-edit" @click="loss(scope.row)" slot="reference"
|
||||||
|
style="padding-left: 5px;"></i>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="stock" sortable label="库存">
|
|
||||||
</el-table-column>
|
<el-table-column prop="stock" sortable label="库存"></el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="address" sortable label="盘点">
|
<el-table-column prop="address" sortable label="盘点">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="stock">
|
<div v-if="stock">
|
||||||
<el-input v-model="scope.row.daily.inventory"></el-input>
|
<el-input v-model="scope.row.daily.inventory"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<el-popover placement="right-start" trigger="hover" :content="scope.row.daily.inventory_time
|
<el-popover placement="right-start" trigger="hover"
|
||||||
? scope.row.daily.inventory_time
|
:content="scope.row.daily.inventory_time ?? ''">
|
||||||
: ''
|
|
||||||
">
|
|
||||||
<div v-if="!stock" slot="reference">
|
<div v-if="!stock" slot="reference">
|
||||||
{{ scope.row.daily.inventory }}
|
{{ scope.row.daily.inventory }}
|
||||||
</div>
|
</div>
|
||||||
@ -309,27 +311,36 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 参考售价弹出确认框 -->
|
<!-- 参考售价弹出确认框 -->
|
||||||
<el-dialog :visible.sync="dialogVisible3" width="20%" :close-on-click-modal="false">
|
<el-dialog title="提示" :visible.sync="dialogVisible3" width="20%" :close-on-click-modal="false">
|
||||||
<span>您确定要修改吗?</span>
|
<span>确定要修改售价吗?</span>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible3 = false">取 消</el-button>
|
<el-button @click="dialogVisible3 = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="reference_priceRequest()">确 定</el-button>
|
<el-button type="primary" @click="referencePriceRequest()">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 预留量弹出框 -->
|
<!-- 预留量弹出框 -->
|
||||||
<el-dialog :visible.sync="dialogVisible4" width="20%" :close-on-click-modal="false">
|
<el-dialog title="提示" :visible.sync="dialogVisible4" width="20%" :close-on-click-modal="false">
|
||||||
<span>您确定要修改吗?</span>
|
<span>确定要修改预留量吗?</span>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible4 = false">取 消</el-button>
|
<el-button @click="reserveCancel">取 消</el-button>
|
||||||
<el-button type="primary" @click="reserveRequest()">确 定</el-button>
|
<el-button type="primary" @click="reserveRequest()">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 目标去化率弹出框 -->
|
||||||
|
<el-dialog title="提示" :visible.sync="dialogVisible5" width="20%" :close-on-click-modal="false">
|
||||||
|
<span>确定要修改目标去化率吗?</span>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancelGoal">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="confirmGoal()">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 点击表格导出弹出框 -->
|
<!-- 点击表格导出弹出框 -->
|
||||||
<el-dialog title="表格导出" :visible.sync="Tableexport" width="30%" :close-on-click-modal="false">
|
<el-dialog title="表格导出" :visible.sync="Tableexport" width="30%" :close-on-click-modal="false">
|
||||||
<div>
|
<div>
|
||||||
选择:
|
<span>选择:</span>
|
||||||
<template>
|
<template>
|
||||||
<el-select v-model="value" placeholder="盘点表/成本表/周数据">
|
<el-select v-model="value" placeholder="盘点表/成本表/周数据">
|
||||||
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
|
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
|
||||||
@ -346,7 +357,7 @@
|
|||||||
|
|
||||||
<!-- 点击商品文件导入弹出框 -->
|
<!-- 点击商品文件导入弹出框 -->
|
||||||
<el-dialog title="导入商品" :visible.sync="docImportDrawer" direction="rtl" custom-class="demo-drawer" ref="drawer"
|
<el-dialog title="导入商品" :visible.sync="docImportDrawer" direction="rtl" custom-class="demo-drawer" ref="drawer"
|
||||||
size="20%" width="30%" @close="importForm.imFileList = []" :close-on-click-modal="false">
|
width="30%" @close="importForm.imFileList = []" :close-on-click-modal="false">
|
||||||
<div class="demo-drawer__content">
|
<div class="demo-drawer__content">
|
||||||
<el-form :model="importForm" :rules="improtRules" ref="importForm">
|
<el-form :model="importForm" :rules="improtRules" ref="importForm">
|
||||||
<el-form-item label="上传文件" label-width="100px" prop="fileList">
|
<el-form-item label="上传文件" label-width="100px" prop="fileList">
|
||||||
@ -379,9 +390,10 @@ import { orderRest } from "../../api/shop";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: "", //参考售价的id
|
editPriceId: "", //参考售价的id
|
||||||
id1: "", //预留量的id
|
editGoalId: "",
|
||||||
id2: "", //损耗的id
|
editReserveId: "", //预留量的id
|
||||||
|
editLossId: "", //损耗的id
|
||||||
total: 0, // 总条数
|
total: 0, // 总条数
|
||||||
rose_num: 0, // 玫瑰数量
|
rose_num: 0, // 玫瑰数量
|
||||||
other_num: 0, // 其它数量
|
other_num: 0, // 其它数量
|
||||||
@ -487,18 +499,19 @@ export default {
|
|||||||
excelTemplatePath: "", // 数据导入Excel模板下载地址 - 调接口获取
|
excelTemplatePath: "", // 数据导入Excel模板下载地址 - 调接口获取
|
||||||
visible: false,
|
visible: false,
|
||||||
updateField: "", //reference_price-参考售价, reserve-预留量, loss_num-损耗, status-状态
|
updateField: "", //reference_price-参考售价, reserve-预留量, loss_num-损耗, status-状态
|
||||||
reference_priceShow: false,
|
|
||||||
reserveShow: false, //预留量-input显示变量
|
reserveShow: false, //预留量-input显示变量
|
||||||
value1: "", // 筛选的时间
|
datePicker: "", // 筛选的时间
|
||||||
ommodityInventory: [], //单个商品库存
|
ommodityInventory: [], //单个商品库存
|
||||||
dialogVisible: false, //上新按钮弹出框变量
|
dialogVisible: false, //上新按钮弹出框变量
|
||||||
dialogVisible2: false, //库存盘点弹出框变量
|
dialogVisible2: false, //库存盘点弹出框变量
|
||||||
dialogVisible3: false, //参考售价弹出框变量
|
dialogVisible3: false, //参考售价弹出框变量
|
||||||
dialogVisible4: false, //预留弹出框变量
|
dialogVisible4: false, //预留弹出框变量
|
||||||
publicId: "", //参考售价 预留量公用id
|
dialogVisible5: false,
|
||||||
reference_price: "", //参考价格修改传参
|
publicId: "",
|
||||||
reserve: "", //预留量修改传参
|
lastVal: 0,
|
||||||
loadingModule: ""
|
nowVal: 0,
|
||||||
|
loadingModule: "",
|
||||||
|
noRow: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -591,7 +604,7 @@ export default {
|
|||||||
sku_title: "", // 商品规格
|
sku_title: "", // 商品规格
|
||||||
status: "", // 商品状态
|
status: "", // 商品状态
|
||||||
};
|
};
|
||||||
this.value1 = "";
|
this.datePicker = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导入商品按钮
|
// 导入商品按钮
|
||||||
@ -826,29 +839,29 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 参考价格点击修改
|
// 参考价格点击修改
|
||||||
reference_priceClick(id) {
|
referencePriceClick(id) {
|
||||||
this.updateField = "reference_price";
|
this.updateField = "reference_price";
|
||||||
this.reference_priceShow = true;
|
this.editPriceId = id;
|
||||||
this.id = id;
|
this.editReserveId = id;
|
||||||
this.id1 = "";
|
this.editLossId = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 参考价格input框失去焦点弹出确认框
|
// 参考价格input框失去焦点弹出确认框
|
||||||
reference_priceBlur(row) {
|
referencePriceBlur(row) {
|
||||||
this.dialogVisible3 = true;
|
this.dialogVisible3 = true;
|
||||||
this.publicId = row.id;
|
this.publicId = row.id;
|
||||||
this.reference_price = row.reference_price;
|
this.reference_price = row.reference_price;
|
||||||
},
|
},
|
||||||
|
|
||||||
//参考价格弹出框确认修改请求
|
//参考价格弹出框确认修改请求
|
||||||
reference_priceRequest() {
|
referencePriceRequest() {
|
||||||
this.dialogVisible3 = false;
|
|
||||||
let reference_priceData = {
|
let reference_priceData = {
|
||||||
updateField: this.updateField,
|
updateField: this.updateField,
|
||||||
reference_price: this.reference_price,
|
reference_price: this.reference_price,
|
||||||
};
|
};
|
||||||
singleUpdate(this.publicId, reference_priceData).then((res) => {
|
singleUpdate(this.publicId, reference_priceData).then((res) => {
|
||||||
this.id = "";
|
this.editPriceId = "";
|
||||||
|
this.dialogVisible3 = false;
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "参考售价修改成功!",
|
message: "参考售价修改成功!",
|
||||||
type: "success",
|
type: "success",
|
||||||
@ -856,27 +869,86 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onreserve(id) {
|
onGoal(row) {
|
||||||
|
this.updateField = "goal_rate";
|
||||||
|
this.editGoalId = row.id;
|
||||||
|
this.lastVal = row.goal_rate;
|
||||||
|
this.editReserveId = "";
|
||||||
|
this.editLossId = "";
|
||||||
|
this.editPriceId = "";
|
||||||
|
},
|
||||||
|
|
||||||
|
blurGoal() {
|
||||||
|
this.updateField = "";
|
||||||
|
this.editGoalId = "";
|
||||||
|
},
|
||||||
|
|
||||||
|
changeGoal(row) {
|
||||||
|
this.noRow = row;
|
||||||
|
this.dialogVisible5 = true;
|
||||||
|
this.publicId = row.id;
|
||||||
|
this.nowVal = row.goal_rate;
|
||||||
|
},
|
||||||
|
|
||||||
|
cancelGoal() {
|
||||||
|
this.dialogVisible5 = false;
|
||||||
|
this.updateField = "goal_rate";
|
||||||
|
this.editGoalId = this.publicId;
|
||||||
|
this.noRow.goal_rate = this.lastVal;
|
||||||
|
},
|
||||||
|
|
||||||
|
confirmGoal() {
|
||||||
|
let data = {
|
||||||
|
updateField: 'goal_rate',
|
||||||
|
goal_rate: this.nowVal,
|
||||||
|
};
|
||||||
|
singleUpdate(this.publicId, data).then((res) => {
|
||||||
|
this.editGoalId = "";
|
||||||
|
this.dialogVisible5 = false;
|
||||||
|
this.$message({
|
||||||
|
message: "目标去化率修改成功!",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onreserve(row) {
|
||||||
this.updateField = "reserve";
|
this.updateField = "reserve";
|
||||||
this.id1 = id;
|
this.editReserveId = row.id;
|
||||||
this.id = "";
|
this.lastVal = row.reserve;
|
||||||
|
this.editLossId = "";
|
||||||
|
this.editPriceId = "";
|
||||||
|
this.editGoalId = "";
|
||||||
|
},
|
||||||
|
|
||||||
|
cancelReserve() {
|
||||||
|
this.updateField = "";
|
||||||
|
this.editReserveId = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 预留量 失去焦点触发确认框
|
// 预留量 失去焦点触发确认框
|
||||||
reservebBlur(row) {
|
reservebBlur(row) {
|
||||||
this.reserve = row.reserve;
|
this.noRow = row;
|
||||||
this.dialogVisible4 = true;
|
this.dialogVisible4 = true;
|
||||||
this.publicId = row.id;
|
this.publicId = row.id;
|
||||||
|
this.nowVal = row.reserve;
|
||||||
|
},
|
||||||
|
|
||||||
|
reserveCancel() {
|
||||||
|
this.dialogVisible4 = false;
|
||||||
|
this.updateField = "reserve";
|
||||||
|
this.editReserveId = this.publicId;
|
||||||
|
this.noRow.reserve = this.lastVal;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 预留量弹出框确认请求
|
// 预留量弹出框确认请求
|
||||||
reserveRequest() {
|
reserveRequest() {
|
||||||
let reservebData = {
|
let reservebData = {
|
||||||
updateField: this.updateField,
|
updateField: 'reserve',
|
||||||
reserve: this.reserve,
|
reserve: this.nowVal,
|
||||||
};
|
};
|
||||||
singleUpdate(this.publicId, reservebData).then((res) => {
|
singleUpdate(this.publicId, reservebData).then((res) => {
|
||||||
this.id1 = "";
|
this.editReserveId = "";
|
||||||
this.dialogVisible4 = false;
|
this.dialogVisible4 = false;
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "预留量修改成功!",
|
message: "预留量修改成功!",
|
||||||
@ -887,34 +959,35 @@ export default {
|
|||||||
|
|
||||||
loss(id) {
|
loss(id) {
|
||||||
this.updateField = "loss_num";
|
this.updateField = "loss_num";
|
||||||
this.id2 = id;
|
this.editLossId = id;
|
||||||
this.id = "";
|
|
||||||
this.id1 = "";
|
this.editPriceId = "";
|
||||||
|
this.editReserveId = "";
|
||||||
|
this.editGoalId = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 添加损耗
|
// 添加损耗
|
||||||
onLoss(row) {
|
onLoss(row) {
|
||||||
let id = row.id;
|
let id = row.id;
|
||||||
let lossData = {
|
let lossData = {
|
||||||
updateField: this.updateField,
|
updateField: 'loss_num',
|
||||||
reason: this.radio,
|
reason: this.radio,
|
||||||
loss_num: row.daily.loss_num,
|
loss_num: row.daily.loss_num,
|
||||||
};
|
};
|
||||||
singleUpdate(id, lossData).then((res) => {
|
singleUpdate(id, lossData).then((res) => {
|
||||||
this.getList();
|
this.editLossId = "";
|
||||||
this.id2 = "";
|
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "损耗添加成功!",
|
message: "损耗添加成功!",
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
|
this.getList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//损耗框取消
|
//损耗框取消
|
||||||
noBubbles() {
|
noBubbles() {
|
||||||
this.handleChoose(this.current_page);
|
|
||||||
this.updateField = "";
|
this.updateField = "";
|
||||||
this.id2 = "";
|
this.editLossId = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取商品种类
|
// 获取商品种类
|
||||||
@ -971,9 +1044,9 @@ export default {
|
|||||||
this.getStockInfo();
|
this.getStockInfo();
|
||||||
this.getgoodsType();
|
this.getgoodsType();
|
||||||
this.getbrandType();
|
this.getbrandType();
|
||||||
this.id = "";
|
this.editPriceId = "";
|
||||||
this.id1 = "";
|
this.editReserveId = "";
|
||||||
this.id2 = "";
|
this.editLossId = "";
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user