!250 修复bug
Merge pull request !250 from 杨建炊/fix-release-1.0.0/yjc-migrate
This commit is contained in:
commit
b68f0f7ed0
@ -38,7 +38,8 @@ class GoodsSkusExport implements FromCollection, ShouldAutoSize
|
||||
$headTitle = [
|
||||
'商品编码',
|
||||
'商品名称',
|
||||
'可售库存',
|
||||
'在售库存',
|
||||
"剩余库存",
|
||||
'创建时间',
|
||||
];
|
||||
$map = [
|
||||
@ -91,17 +92,18 @@ class GoodsSkusExport implements FromCollection, ShouldAutoSize
|
||||
foreach ($data as $item) {
|
||||
$arr[0] = $item['external_sku_id'];
|
||||
$arr[1] = $item['name'];
|
||||
$arr[2] = $item['sale_stock'] ?? 0;
|
||||
$arr[3] = $item['created_at'];
|
||||
$arr[2] = $item['sale_stock'] ?? '0';
|
||||
$arr[3] = $item['stock'] ?? '0';
|
||||
$arr[4] = $item['created_at'];
|
||||
if ('cost' === $this->type) {
|
||||
$arr[4] = (string)$item['cost'];
|
||||
$arr[5] = (string)$update[$item['id']]['before_update'];
|
||||
$arr[6] = (string)$update[$item['id']]['after_update'];
|
||||
$arr[5] = (string)$item['cost'];
|
||||
$arr[6] = (string)$update[$item['id']]['before_update'];
|
||||
$arr[7] = (string)$update[$item['id']]['after_update'];
|
||||
}
|
||||
if ('inventory' === $this->type) {
|
||||
$arr[4] = (string)$item['stock'];
|
||||
$arr[5] = (string)$update[$item['id']]['inventory'];
|
||||
$arr[6] = (string)$update[$item['id']]['arrived_today_num'];
|
||||
$arr[5] = (string)$item['stock'];
|
||||
$arr[6] = (string)$update[$item['id']]['inventory'];
|
||||
$arr[7] = (string)$update[$item['id']]['arrived_today_num'];
|
||||
}
|
||||
$bodyData[] = $arr;
|
||||
}
|
||||
|
||||
@ -42,4 +42,34 @@ class GoodsSkuFilter extends Filters
|
||||
$end = Carbon::parse($value)->endOfDay()->toDateTimeString();
|
||||
return $this->builder->where('created_at', "<=", $end);
|
||||
}
|
||||
|
||||
protected function minStock($value)
|
||||
{
|
||||
return $this->builder->where('stock',">=", $value);
|
||||
}
|
||||
|
||||
protected function maxStock($value)
|
||||
{
|
||||
return $this->builder->where('stock',"<=", $value);
|
||||
}
|
||||
|
||||
protected function minSaleStock($value)
|
||||
{
|
||||
return $this->builder->where('sale_stock',">=", $value);
|
||||
}
|
||||
|
||||
protected function maxSaleStock($value)
|
||||
{
|
||||
return $this->builder->where('sale_stock',"<=", $value);
|
||||
}
|
||||
|
||||
protected function neqSaleStock($value)
|
||||
{
|
||||
return $this->builder->where('sale_stock',"!=", $value);
|
||||
}
|
||||
|
||||
protected function neqStock($value)
|
||||
{
|
||||
return $this->builder->where('stock',"!=", $value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,8 +34,11 @@ class GoodsCombinationController extends Controller
|
||||
$orderRestTime = DeveloperConfig::query()
|
||||
->where('key', DeveloperConfig::$ORDER_RESET_TIME)
|
||||
->value('value');
|
||||
$time = date('Y-m-d 07:00:00');
|
||||
if (is_null($orderRestTime)) {
|
||||
$orderRestTime = date('Y-m-d 07:00:00');
|
||||
$orderRestTime = $time;
|
||||
} else {
|
||||
$orderRestTime = Carbon::parse($orderRestTime)->lt(Carbon::parse($time)) ? $time : $orderRestTime;
|
||||
}
|
||||
|
||||
$businessOrderItems = BusinessOrderItem::query()
|
||||
|
||||
@ -59,8 +59,11 @@ class GoodsSkusController extends Controller
|
||||
$orderRestTime = DeveloperConfig::query()
|
||||
->where('key', DeveloperConfig::$ORDER_RESET_TIME)
|
||||
->value('value');
|
||||
$time = date('Y-m-d 07:00:00');
|
||||
if (is_null($orderRestTime)) {
|
||||
$orderRestTime = date('Y-m-d 07:00:00');
|
||||
$orderRestTime = $time;
|
||||
} else {
|
||||
$orderRestTime = Carbon::parse($orderRestTime)->lt(Carbon::parse($time)) ? $time : $orderRestTime;
|
||||
}
|
||||
$businessOrderItems = BusinessOrderItem::query()
|
||||
->select(DB::raw($fields))
|
||||
@ -119,9 +122,9 @@ class GoodsSkusController extends Controller
|
||||
foreach ($ids as $id => $number) {
|
||||
$finalIds[] = $id;
|
||||
}
|
||||
if(empty($finalIds)){
|
||||
$goodsSkusBuilder->orderBy("id",$sortValue);
|
||||
}else{
|
||||
if (empty($finalIds)) {
|
||||
$goodsSkusBuilder->orderBy("id", $sortValue);
|
||||
} else {
|
||||
$idField = implode(',', $finalIds);
|
||||
$goodsSkusBuilder->orderByRaw("FIELD(id,{$idField}) {$sortValue}");
|
||||
}
|
||||
|
||||
@ -74,9 +74,10 @@ class CombinationGoodsStockUpdateListener implements ShouldQueue
|
||||
$goodsSku->stock = $stock;
|
||||
$goodsSku->sale_stock = $saleStock;
|
||||
$goodsSku->save();
|
||||
Log::info("sku 业务订单库存更:{$goodsSku->id},num:{$num}", [$stock, $saleStock]);
|
||||
$mainGoodsSku = GoodsSku::query()->find($item['goods_sku_id']);
|
||||
$mainGoodsSku->stock = min($mainGoodsSku->stock,(int)($stock / $item['item_num']));
|
||||
$mainGoodsSku->sale_stock = min($mainGoodsSku->sale_stock,(int)($saleStock / $item['item_num']));
|
||||
$mainGoodsSku->stock = min($mainGoodsSku->stock, (int)($stock / $item['item_num']));
|
||||
$mainGoodsSku->sale_stock = min($mainGoodsSku->sale_stock, (int)($saleStock / $item['item_num']));
|
||||
$mainGoodsSku->save();
|
||||
$updateIds[] = $goodsSku->id;
|
||||
});
|
||||
|
||||
@ -16,7 +16,13 @@ class GoodsSku extends Model
|
||||
'external_sku_id',
|
||||
'is_combination',
|
||||
"create_time_start",
|
||||
"create_time_end"
|
||||
"create_time_end",
|
||||
'min_stock',
|
||||
'max_stock',
|
||||
'min_sale_stock',
|
||||
'max_sale_stock',
|
||||
"neq_stock",
|
||||
"neq_sale_stock",
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
@ -28,8 +28,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
protected $listen = [
|
||||
BusinessOrdersUpdate::class => [
|
||||
UpdateBusinessGoodsStock::class,
|
||||
CombinationGoodsStockUpdateListener::class,
|
||||
BusinessOrderUpdateListener::class
|
||||
CombinationGoodsStockUpdateListener::class
|
||||
],
|
||||
BatchStockUpdateEvent::class => [
|
||||
BatchStockUpdateListener::class,
|
||||
|
||||
1
public/dist/css/282.feb6bf21.css
vendored
1
public/dist/css/282.feb6bf21.css
vendored
@ -1 +0,0 @@
|
||||
.skuBox[data-v-4de310da]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-4de310da]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.skuBox[data-v-3dbf163e]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-3dbf163e]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.table[data-v-3e0ef0c7]{margin-top:20px;position:relative}.btn[data-v-3e0ef0c7]{float:right}.flex[data-v-3e0ef0c7]{display:flex;align-items:center}.goodBox .Img[data-v-3e0ef0c7]{width:50px;height:50px;margin-right:12px;border-radius:4px}.goodBox .tit[data-v-3e0ef0c7]{color:#000;font-size:13px}.confirmbtn[data-v-3e0ef0c7]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-3e0ef0c7]{margin-top:30px}.import-right a[data-v-3e0ef0c7]{color:#409eff}[data-v-3e0ef0c7] .btn11{padding:0;width:14px;height:14px}[data-v-3e0ef0c7] .btn11 img{width:100%;height:100%}.page[data-v-3e0ef0c7]{margin-top:20px}.searchBox[data-v-3e0ef0c7]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-3e0ef0c7]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.titBox[data-v-3e0ef0c7]{display:flex;align-items:center}.red[data-v-3e0ef0c7]{color:red}
|
||||
1
public/dist/css/683.df205b2b.css
vendored
Normal file
1
public/dist/css/683.df205b2b.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skuBox[data-v-4de310da]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-4de310da]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.skuBox[data-v-3dbf163e]{border:1px solid #e5e5e5;border-radius:5px;padding:15px 0;margin-bottom:15px;background-color:#f3f3f3}.skuBox .tit[data-v-3dbf163e]{padding-left:40px;font-weight:600;font-size:15px;margin-bottom:15px}.table[data-v-5670c00d]{margin-top:20px;position:relative}.btn[data-v-5670c00d]{float:right}.flex[data-v-5670c00d]{display:flex;align-items:center}.goodBox .Img[data-v-5670c00d]{width:50px;height:50px;margin-right:12px;border-radius:4px}.goodBox .tit[data-v-5670c00d]{color:#000;font-size:13px}.confirmbtn[data-v-5670c00d]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-5670c00d]{margin-top:30px}.import-right a[data-v-5670c00d]{color:#409eff}[data-v-5670c00d] .btn11{padding:0;width:14px;height:14px}[data-v-5670c00d] .btn11 img{width:100%;height:100%}.page[data-v-5670c00d]{margin-top:20px}.searchBox[data-v-5670c00d]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-5670c00d]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.titBox[data-v-5670c00d]{display:flex;align-items:center}.red[data-v-5670c00d]{color:red}
|
||||
2
public/dist/index.html
vendored
2
public/dist/index.html
vendored
@ -1 +1 @@
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.a4f4a4ff.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.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.eb0ff1e5.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.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>
|
||||
2
public/dist/js/282.98d58958.js
vendored
2
public/dist/js/282.98d58958.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/282.98d58958.js.map
vendored
1
public/dist/js/282.98d58958.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/683.0997409c.js
vendored
Normal file
2
public/dist/js/683.0997409c.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/683.0997409c.js.map
vendored
Normal file
1
public/dist/js/683.0997409c.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
@ -45,6 +45,14 @@
|
||||
style="width: 250px;"
|
||||
@change="handleChoose()">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>剩余库存≠:</span>
|
||||
<el-input v-model="form.neq_stock" @keyup.enter.native="handleChoose" placeholder="剩余库存" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>在售库存≠:</span>
|
||||
<el-input v-model="form.neq_sale_stock" @keyup.enter.native="handleChoose" placeholder="在售库存" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button type="primary" @click="handleChoose()" icon="el-icon-search">筛选</el-button>
|
||||
@ -59,6 +67,7 @@
|
||||
<div>
|
||||
<span>全部商品(共{{ total }}条)</span>
|
||||
<div class="btn">
|
||||
<el-button @click="resetOrderCount" icon="el-icon-refresh">订单重置</el-button>
|
||||
<el-button type="primary" @click="petchEditStock" icon="el-icon-edit" :disabled="!chooseList.length">批量更新在售库存</el-button>
|
||||
<el-button type="primary" v-if="is_admin" @click="addNewgoods" icon="el-icon-plus">新增商品</el-button>
|
||||
<el-button type="primary" plain v-if="is_admin" @click="handleImport" icon="el-icon-upload2">在售库存导入</el-button>
|
||||
@ -290,8 +299,8 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import { goods_types, Brand_goods_types } from '@/api/rankingData.js'
|
||||
import { goods, update, singleUpdate, getStockNum, updateSaleStock, goodsSkuExport } from '@/api/goods'
|
||||
import { goods_types } from '@/api/rankingData.js'
|
||||
import { goods, update, singleUpdate, getStockNum, updateSaleStock } from '@/api/goods'
|
||||
import { orderRest } from "@/api/shop"
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
@ -333,6 +342,8 @@
|
||||
],
|
||||
form: {
|
||||
external_sku_id: '',
|
||||
neq_stock: '',
|
||||
neq_sale_stock: '',
|
||||
goods_title: '', // 商品名称
|
||||
type_id: null, // 商品种类id
|
||||
brand_id: '', // 商品品牌id
|
||||
@ -465,7 +476,9 @@
|
||||
type_id: null,
|
||||
brand_id: '',
|
||||
sku_title: '',
|
||||
status: ''
|
||||
status: '',
|
||||
neq_stock: '',
|
||||
neq_sale_stock: ''
|
||||
}
|
||||
this.filterTime = []
|
||||
},
|
||||
@ -490,13 +503,14 @@
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
orderRest().then((res) => {
|
||||
console.log(res)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.data.message
|
||||
})
|
||||
this.getList()
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
},
|
||||
// 点击上新
|
||||
@ -539,6 +553,8 @@
|
||||
exportType: 'goods_sku',
|
||||
external_sku_id: this.form.external_sku_id,
|
||||
goods_title: this.form.goods_title,
|
||||
neq_stock: this.form.neq_stock,
|
||||
neq_sale_stock: this.form.neq_sale_stock,
|
||||
type_id: this.form.type_id || '',
|
||||
status: this.form.status,
|
||||
keyword_type: 'stock',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user