批量修改在售库存
This commit is contained in:
commit
e76f78dd8c
@ -12,6 +12,7 @@ use App\Http\Requests\GoodsRequest;
|
||||
use App\Http\Requests\GoodsSkuRequest;
|
||||
use App\Imports\InventoryImport;
|
||||
use App\Imports\NewSetImport;
|
||||
use App\Imports\SaleStockImport;
|
||||
use App\Models\BusinessOrderItem;
|
||||
use App\Models\DailySalesReport;
|
||||
use App\Models\DeveloperConfig;
|
||||
@ -37,7 +38,7 @@ use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Models\DailyStockRecord;
|
||||
use App\Models\Shop;
|
||||
|
||||
class GoodsSkusController extends Controller
|
||||
class gitGoodsSkusController extends Controller
|
||||
{
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
@ -731,7 +732,7 @@ class GoodsSkusController extends Controller
|
||||
];
|
||||
}
|
||||
try {
|
||||
$import = new InventoryImport();
|
||||
$import = new SaleStockImport();
|
||||
$path = $request->file(ExcelKeyEnum::SALE_STOCK_FILE);
|
||||
Excel::import($import, $path);
|
||||
$this->addLog(0, 'import', ExcelKeyEnum::SALE_STOCK_FILE);
|
||||
|
||||
@ -287,7 +287,7 @@ class PurchaseRecordController extends Controller
|
||||
}
|
||||
if (!empty($v['num'])) {
|
||||
$purchaseRecordBuilder->num = $v['num'];
|
||||
$purchaseRecords['num'] = $purchaseRecords;
|
||||
$purchaseRecords['num'] = $v['num'];
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
@ -20,6 +20,7 @@ class SaleStockImport implements ToArray, SkipsEmptyRows
|
||||
*/
|
||||
public function array(array $collection)
|
||||
{
|
||||
Log::info("collection",[$collection]);
|
||||
if (!empty($collection)) {
|
||||
unset($collection[0]);
|
||||
$externalSkuIds = [];
|
||||
@ -28,12 +29,11 @@ class SaleStockImport implements ToArray, SkipsEmptyRows
|
||||
$row = array_map(static function ($v) {
|
||||
return trim($v);
|
||||
}, $row);
|
||||
$inventoryKeyByExternalSkuIdMap[$row[0]] = $row[1];
|
||||
$inventoryKeyByExternalSkuIdMap[$row[0]] = $row[2];
|
||||
$externalSkuIds[] = $row[0];
|
||||
}
|
||||
unset($row);
|
||||
//新版盘点excel字段 编码 在售库存值 商品名称
|
||||
|
||||
$updateIds = [];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
@ -41,6 +41,7 @@ class SaleStockImport implements ToArray, SkipsEmptyRows
|
||||
foreach ($externalSkuIds as $externalSkuId) {
|
||||
// 成本
|
||||
$goodsSku = GoodsSku::query()->where('external_sku_id', $externalSkuId)->first(['id', 'cost', 'sale_stock']);
|
||||
Log::info("SKU",[$goodsSku]);
|
||||
if (empty($goodsSku)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -137,6 +137,7 @@ class GoodSkuService
|
||||
'stock' => $goodsSkuItem['stock'] + $changeData['num'],
|
||||
'sale_stock' => $goodsSkuItem['sale_stock'] + $changeData['num'],
|
||||
];
|
||||
|
||||
if ($targetType == TargetTypeEnum::PURCHASE) {
|
||||
$updateParam['cost'] = $changeData['cost'];
|
||||
}
|
||||
|
||||
1
public/dist/css/120.96a1d2eb.css
vendored
Normal file
1
public/dist/css/120.96a1d2eb.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-6afce68e]{margin-top:20px;position:relative}.btn[data-v-6afce68e]{float:right}.flex[data-v-6afce68e]{display:flex;align-items:center}.goodBox .Img[data-v-6afce68e]{width:50px;height:50px;margin-right:12px;border-radius:4px}.goodBox .tit[data-v-6afce68e]{color:#000;font-size:13px}.confirmbtn[data-v-6afce68e]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-6afce68e]{margin-top:30px}.import-right a[data-v-6afce68e]{color:#409eff}[data-v-6afce68e] .btn11{padding:0;width:14px;height:14px}[data-v-6afce68e] .btn11 img{width:100%;height:100%}.page[data-v-6afce68e]{margin-top:20px}.searchBox[data-v-6afce68e]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-6afce68e]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.titBox[data-v-6afce68e]{display:flex;align-items:center}.red[data-v-6afce68e]{color:red}
|
||||
@ -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)}}.searchBox[data-v-b907944a]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-b907944a]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.opaBox[data-v-b907944a]{margin-bottom:15px}.bgBox[data-v-b907944a]{position:relative;border-radius:5px;background-color:#f5f2f2;margin-bottom:15px;padding:15px 30px 15px 0}.bgBox .close[data-v-b907944a]{color:red;position:absolute;right:5px;top:5px;font-size:20px;cursor:pointer}.btn[data-v-b907944a]{display:flex;align-items:center;font-size:14px;color:#409eff;cursor:pointer;width:-moz-fit-content;width:fit-content}
|
||||
#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)}}.searchBox[data-v-453a2678]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-453a2678]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.opaBox[data-v-453a2678]{margin-bottom:15px}.bgBox[data-v-453a2678]{position:relative;border-radius:5px;background-color:#f5f2f2;margin-bottom:15px;padding:15px 30px 15px 0}.bgBox .close[data-v-453a2678]{color:red;position:absolute;right:5px;top:5px;font-size:20px;cursor:pointer}.btn[data-v-453a2678]{display:flex;align-items:center;font-size:14px;color:#409eff;cursor:pointer;width:-moz-fit-content;width:fit-content}
|
||||
@ -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)}}.searchBox[data-v-1f518a10]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-1f518a10]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.bgBox[data-v-1f518a10]{position:relative;border-radius:5px;background-color:#f5f2f2;margin-bottom:15px;padding:15px 30px 15px 0}.bgBox .close[data-v-1f518a10]{color:red;position:absolute;right:5px;top:5px;font-size:20px;cursor:pointer}.btn[data-v-1f518a10]{display:flex;align-items:center;font-size:14px;color:#409eff;cursor:pointer;width:-moz-fit-content;width:fit-content}
|
||||
#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)}}.searchBox[data-v-36908574]{display:flex;align-items:center;flex-wrap:wrap;white-space:nowrap}.searchBox .row[data-v-36908574]{font-size:14px;margin-bottom:20px;margin-right:15px;display:flex;align-items:center}.bgBox[data-v-36908574]{position:relative;border-radius:5px;background-color:#f5f2f2;margin-bottom:15px;padding:15px 30px 15px 0}.bgBox .close[data-v-36908574]{color:red;position:absolute;right:5px;top:5px;font-size:20px;cursor:pointer}.btn[data-v-36908574]{display:flex;align-items:center;font-size:14px;color:#409eff;cursor:pointer;width:-moz-fit-content;width:fit-content}
|
||||
@ -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)}}.opaBox[data-v-04f93eaa]{margin-bottom:15px}
|
||||
#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)}}.opaBox[data-v-23e43282]{margin-bottom:15px}
|
||||
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.92e29e47.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.c5751c2a.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/120.f9ba9a43.js
vendored
Normal file
2
public/dist/js/120.f9ba9a43.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/120.f9ba9a43.js.map
vendored
Normal file
1
public/dist/js/120.f9ba9a43.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/dist/js/147.97be836f.js
vendored
2
public/dist/js/147.97be836f.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/147.97be836f.js.map
vendored
1
public/dist/js/147.97be836f.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/292.25ac0e82.js
vendored
2
public/dist/js/292.25ac0e82.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/292.25ac0e82.js.map
vendored
1
public/dist/js/292.25ac0e82.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/401.7b4eec34.js
vendored
Normal file
2
public/dist/js/401.7b4eec34.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/401.7b4eec34.js.map
vendored
Normal file
1
public/dist/js/401.7b4eec34.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/dist/js/417.10d00a45.js
vendored
Normal file
2
public/dist/js/417.10d00a45.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/417.10d00a45.js.map
vendored
Normal file
1
public/dist/js/417.10d00a45.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/dist/js/874.68cfbbaf.js
vendored
2
public/dist/js/874.68cfbbaf.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/js/874.68cfbbaf.js.map
vendored
1
public/dist/js/874.68cfbbaf.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/931.c12ad990.js
vendored
Normal file
2
public/dist/js/931.c12ad990.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/dist/js/931.c12ad990.js.map
vendored
Normal file
1
public/dist/js/931.c12ad990.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/dist/js/app.c5751c2a.js
vendored
Normal file
2
public/dist/js/app.c5751c2a.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -23,12 +23,12 @@
|
||||
:on-error="uploadError" style="display:inline-block;margin: 0 15px 0 0;">
|
||||
<el-button type="warning" icon="el-icon-upload2">组合商品导入</el-button>
|
||||
</el-upload>
|
||||
<el-button type="primary" plain @click="addGoodsCombination" icon="el-icon-plus">新增组合商品</el-button>
|
||||
<el-button type="primary" plain @click="addGoodsCombination" icon="el-icon-plus" v-if="is_admin">新增组合商品</el-button>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" ref="multipleTable" :data="tableData" class="table" tooltip-effect="dark" border
|
||||
style="width: 100%" row-key="id" :tree-props="{ children: 'children' }">
|
||||
<el-table-column label="商品信息" width="400">
|
||||
<el-table-column label="商品信息" width="400" class-name="flex">
|
||||
<template slot-scope="scope">
|
||||
<div class="commodityimg">
|
||||
<img :src="scope.row.img_url" class="Img" />
|
||||
@ -40,8 +40,8 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="组合数量"></el-table-column>
|
||||
<el-table-column label="剩余库存">
|
||||
<el-table-column prop="num" label="组合数量" align="center"></el-table-column>
|
||||
<el-table-column label="剩余库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.children">{{ scope.row.stock }}</span>
|
||||
</template>
|
||||
@ -65,9 +65,9 @@
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column sortable prop="total_orders_num" label="累计订单"></el-table-column> -->
|
||||
<el-table-column sortable prop="sale_stock" label="可售库存"></el-table-column>
|
||||
<el-table-column prop="status" label="状态"></el-table-column>
|
||||
<el-table-column label="操作" width="130">
|
||||
<el-table-column sortable prop="sale_stock" label="可售库存" align="center"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" align="center"></el-table-column>
|
||||
<el-table-column label="操作" width="130" align="center" v-if="is_admin">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handleEdit(scope.row.id)">编辑</el-button>
|
||||
<!-- <el-button type="text" @click="handleDelete(scope.row.id)">删除</el-button> -->
|
||||
@ -148,6 +148,7 @@
|
||||
}]
|
||||
},
|
||||
skus: [],
|
||||
is_admin: false,
|
||||
remoteLoading: false
|
||||
}
|
||||
},
|
||||
@ -170,6 +171,7 @@
|
||||
this.Paginationdata = res.data.meta
|
||||
this.currentPage = res.data.meta.current_page
|
||||
this.per_page = parseInt(res.data.meta.per_page)
|
||||
this.is_admin = res.data.manage && res.data.manage.is_admin
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
@ -293,11 +295,6 @@
|
||||
float: right;
|
||||
}
|
||||
|
||||
::v-deep .cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.commodityimg {
|
||||
width: 59px;
|
||||
height: 59px;
|
||||
@ -306,12 +303,14 @@
|
||||
display: block;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.Img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
::v-deep .flex .cell{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
::v-deep .btn11 {
|
||||
padding: 0;
|
||||
width: 14px;
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
</el-upload> -->
|
||||
<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" v-if="is_admin" plain @click="handleImport" icon="el-icon-upload2">导入商品</el-button>
|
||||
<el-button type="primary" v-if="is_admin" plain @click="handleImport" icon="el-icon-upload2">在售库存导入</el-button>
|
||||
<el-button type="warning" @click="handleExport" icon="el-icon-download">表格导出</el-button>
|
||||
<!-- <el-button type="primary" plain @click="onCount">库存盘点</el-button> -->
|
||||
</div>
|
||||
@ -387,28 +387,25 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 点击商品文件导入弹出框 -->
|
||||
<el-dialog title="导入商品" :visible.sync="docImportDrawer" direction="rtl" custom-class="demo-drawer" ref="drawer"
|
||||
width="30%" @close="importForm.imFileList = []" :close-on-click-modal="false">
|
||||
<el-dialog title="在售库存导入" :visible.sync="docImportDrawer" direction="rtl" custom-class="demo-drawer" ref="drawer"
|
||||
width="450px" @close="importForm.imFileList = []" :close-on-click-modal="false">
|
||||
<div class="demo-drawer__content">
|
||||
<el-form :model="importForm" :rules="improtRules" ref="importForm">
|
||||
<el-form-item label="上传文件" label-width="100px" prop="fileList">
|
||||
<el-upload class="uploader" action="" :limit="1"
|
||||
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||
:file-list="importForm.fileList" :auto-upload="false" :on-change="importFileChange">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="demo-drawer__footer btn-style">
|
||||
<el-button @click="docImportDrawer = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveUpload">上 传</el-button>
|
||||
</div>
|
||||
<el-upload class="upload-demo" action="" :limit="1" drag ref="aupload"
|
||||
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||
:file-list="importForm.fileList" :auto-upload="false" :on-change="importFileChange">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="import-right">
|
||||
<el-button size="medium" class="button-query">
|
||||
<el-button size="medium" type="text">
|
||||
<a :href="`http://erp.chutang66.com/goods/import/template`">下载模板</a>
|
||||
</el-button>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="docImportDrawer = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveUpload">上 传</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="可售库存" :visible.sync="showUpdate" width="600px">
|
||||
@ -554,7 +551,7 @@
|
||||
chooseList: [],
|
||||
showUpdate: false,
|
||||
commitLoading: false,
|
||||
is_admin: localStorage.getItem('roleName') == '超级管理员' || localStorage.getItem('roleName') == '系统管理员',
|
||||
is_admin: false,
|
||||
showAdd: false,
|
||||
showEdit: false,
|
||||
curId: 0
|
||||
@ -599,6 +596,7 @@
|
||||
this.sku_code = {
|
||||
sku_code: this.shopsData
|
||||
}
|
||||
this.is_admin = res.data.manage && res.data.manage.is_admin
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
@ -658,7 +656,11 @@
|
||||
|
||||
// 导入商品按钮
|
||||
handleImport() {
|
||||
this.importForm.fileList = []
|
||||
this.docImportDrawer = true
|
||||
this.$nextTick(function () {
|
||||
this.$refs.aupload.clearFiles()
|
||||
})
|
||||
},
|
||||
// 导出商品按钮
|
||||
handleExport() {
|
||||
@ -833,28 +835,29 @@
|
||||
},
|
||||
// 确定上传
|
||||
saveUpload() {
|
||||
this.$refs.importForm.validate(async (isValid) => {
|
||||
if (!isValid) return
|
||||
try {
|
||||
// 主要是这二行代码
|
||||
const params = new FormData()
|
||||
params.append("goodsSkus", this.importForm.fileList[0].raw)
|
||||
|
||||
this.isLoadingDialog = true
|
||||
let token = localStorage.getItem("token")
|
||||
axios.post("/api/goods_skus", params, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.status === 200) {
|
||||
this.$message.success("模板导入成功")
|
||||
}
|
||||
})
|
||||
if(!this.importForm.fileList.length) {
|
||||
this.$message.error("请先上传文件")
|
||||
return
|
||||
}
|
||||
this.isLoadingDialog = true
|
||||
const params = new FormData()
|
||||
params.append("saleStockFile", this.importForm.fileList[0].raw)
|
||||
let token = localStorage.getItem("token")
|
||||
axios.post("/api/goods_skus/saleStockImport", params, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.status === 200) {
|
||||
this.$message.success("导入成功")
|
||||
this.handleChoose(1)
|
||||
this.commitloading = false
|
||||
this.docImportDrawer = false
|
||||
} finally {
|
||||
} else {
|
||||
this.isLoadingDialog = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.isLoadingDialog = false
|
||||
})
|
||||
},
|
||||
|
||||
@ -1155,7 +1158,7 @@
|
||||
this.getList()
|
||||
this.getStockInfo()
|
||||
this.getgoodsType()
|
||||
this.getbrandType()
|
||||
// this.getbrandType()
|
||||
this.editPriceId = ''
|
||||
this.editReserveId = ''
|
||||
this.editLossId = ''
|
||||
@ -1197,10 +1200,9 @@
|
||||
}
|
||||
.import-right {
|
||||
margin-top: 30px;
|
||||
}
|
||||
.import-right a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
a {
|
||||
color: #409EFF;
|
||||
}
|
||||
}
|
||||
::v-deep .btn11 {
|
||||
padding: 0;
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
<el-button type="primary" @click="handleChoose">筛选</el-button>
|
||||
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||
</el-form-item>
|
||||
<!-- <el-button type="primary" @click="print">打印</el-button> -->
|
||||
<el-button type="primary" @click="print">打印</el-button>
|
||||
<el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
@ -78,6 +78,9 @@
|
||||
|
||||
<el-dialog title="审核" :visible.sync="dialogVisible" width="500px">
|
||||
<el-form label-width="90px">
|
||||
<el-form-item label="采购数量:">
|
||||
<el-input v-model="curInfo.num" type="number" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态:">
|
||||
<el-radio-group v-model="curInfo.status">
|
||||
<el-radio :label="1">审核通过</el-radio>
|
||||
@ -165,7 +168,8 @@ export default {
|
||||
let params = {
|
||||
purchaseOrders: [{
|
||||
id: this.curInfo.id,
|
||||
status: this.curInfo.status
|
||||
status: this.curInfo.status,
|
||||
num: this.curInfo.num
|
||||
}]
|
||||
}
|
||||
examinePurchase(params).then((res) => {
|
||||
|
||||
@ -173,13 +173,13 @@
|
||||
<el-input v-model="curInfo.external_sku_id" disabled></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="数量">
|
||||
<el-input v-model="curInfo.num" disabled></el-input>
|
||||
<el-input v-model="curInfo.num" :disabled="curInfo.status == 1"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="成本">
|
||||
<el-input v-model="curInfo.cost" disabled></el-input>
|
||||
<el-input v-model="curInfo.cost" :disabled="curInfo.status == 1"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品总价">
|
||||
<el-input v-model="curInfo.total_price" disabled>
|
||||
<el-input v-model="curInfo.total_price" :disabled="curInfo.status == 1">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -300,7 +300,7 @@ export default {
|
||||
// 新增供应商
|
||||
handleAdd() {
|
||||
this.curInfo = {
|
||||
buyer_user_id: localStorage.getItem("userId"),
|
||||
buyer_user_id: localStorage.getItem("userId") * 1,
|
||||
supplier_id: ''
|
||||
}
|
||||
this.purchaseOrders = [{
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<el-table-column prop="id" label="ID"></el-table-column>
|
||||
<el-table-column prop="name" label="姓名"></el-table-column>
|
||||
<el-table-column label="角色">
|
||||
<template slot-scope="scope">{{ scope.row.roles[0].name }}</template>
|
||||
<template slot-scope="scope">{{ scope.row.roles && scope.row.roles[0].name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
|
||||
3
resources/frontend/vue.config.js
vendored
3
resources/frontend/vue.config.js
vendored
@ -9,7 +9,8 @@ module.exports = {
|
||||
"/api": {
|
||||
// target: "http://erp.local",
|
||||
// target: "http://erp.chutang66.com",
|
||||
target: "http://192.168.0.52:81",
|
||||
target: "http://world.dev.chutang66.com/",
|
||||
// target: "http://192.168.0.52:81",
|
||||
changeOrigin: true, // 开启代理
|
||||
pathRewrite: {
|
||||
// 重命名
|
||||
|
||||
@ -152,3 +152,7 @@ Route::post('supplier/loss_record/loss_import', [LossRecordController::class, 'l
|
||||
|
||||
//新版盘点导入
|
||||
Route::post('supplier/daily_stock_record/inventory_import', [DailyStockRecordController::class, 'inventoryImport'])->name('supplier.daily_stock_record.inventory_import');
|
||||
|
||||
//在售库存导入
|
||||
Route::post('goods_skus/saleStockImport', [GoodsSkusController::class, 'saleStockImport'])->name('goods_skus.saleStockImport');
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user