|
@@ -18,15 +18,13 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="官方分类">
|
|
|
- <el-cascader
|
|
|
- v-model="formInline.classifyId" :options="categoryList" clearable :props="{
|
|
|
- checkStrictly: true,
|
|
|
- expandTrigger: 'hover',
|
|
|
- label: 'categoryName',
|
|
|
- value: 'id',
|
|
|
- children: 'childs'
|
|
|
- }"
|
|
|
- />
|
|
|
+ <el-cascader v-model="formInline.classifyId" :options="categoryList" clearable :props="{
|
|
|
+ checkStrictly: true,
|
|
|
+ expandTrigger: 'hover',
|
|
|
+ label: 'categoryName',
|
|
|
+ value: 'id',
|
|
|
+ children: 'childs'
|
|
|
+ }" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" plain @click="search">查询</el-button>
|
|
@@ -42,10 +40,8 @@
|
|
|
</div>
|
|
|
<!-- 表格 -->
|
|
|
<div class="tableBox">
|
|
|
- <el-table
|
|
|
- ref="multipleTable" :data="tableData" border
|
|
|
- :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%"
|
|
|
- >
|
|
|
+ <el-table ref="multipleTable" :data="tableData" border
|
|
|
+ :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%">
|
|
|
<el-table-column prop="productId" label="商品id" show-overflow-tooltip />
|
|
|
<el-table-column label="商品主图" width="150" align="center">
|
|
|
<template slot-scope="scope">
|
|
@@ -88,23 +84,18 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div class="fenye">
|
|
|
- <el-pagination
|
|
|
- :current-page="formInline.page" :page-sizes="[10, 20, 50, 100]" :page-size="10"
|
|
|
+ <el-pagination :current-page="formInline.page" :page-sizes="[10, 20, 50, 100]" :page-size="10"
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- />
|
|
|
+ @current-change="handleCurrentChange" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 批量导入 -->
|
|
|
<el-dialog title="批量导入商品" :visible.sync="batchAdd" :close-on-click-modal="false" center width="400px">
|
|
|
<div class="uploadDialog">
|
|
|
- <el-upload
|
|
|
- drag :limit="1" :auto-upload="false" accept=".xlsx"
|
|
|
- :headers="headers" :action="UploadUrls"
|
|
|
+ <el-upload drag :limit="1" :auto-upload="false" accept=".xlsx" :headers="headers" :action="UploadUrls"
|
|
|
:before-upload="beforeUploadFile" :on-change="fileChange" :on-remove="batchRemove" :on-exceed="exceedFile"
|
|
|
- :on-success="handleSuccess" :on-error="handleError" :file-list="batchFileList"
|
|
|
- >
|
|
|
+ :on-success="handleSuccess" :on-error="handleError" :file-list="batchFileList">
|
|
|
<i class="el-icon-upload" />
|
|
|
<div class="el-upload__text">
|
|
|
<em>点击上传</em>
|
|
@@ -159,15 +150,10 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- 新增/修改商品弹窗 -->
|
|
|
- <el-dialog
|
|
|
- :title="!commId ? '新增商品' : '编辑商品'" :visible.sync="commidyVisible" width="74%" center
|
|
|
- top="10vh"
|
|
|
- :close-on-click-modal="false" @before-close="closeModal" @close="closeModal"
|
|
|
- >
|
|
|
- <CommAdd
|
|
|
- ref="child" :voucher-list="voucherList" :show-tinymce="showTinymce" :product-id="commId"
|
|
|
- @cancel="cancelForm"
|
|
|
- />
|
|
|
+ <el-dialog :title="!commId ? '新增商品' : '编辑商品'" :visible.sync="commidyVisible" width="74%" center top="10vh"
|
|
|
+ :close-on-click-modal="false" @before-close="closeModal" @close="closeModal">
|
|
|
+ <CommAdd ref="child" :voucher-list="voucherList" :show-tinymce="showTinymce" :product-id="commId"
|
|
|
+ @cancel="cancelForm" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -266,14 +252,13 @@ export default {
|
|
|
},
|
|
|
cancelForm() {
|
|
|
this.commidyVisible = false
|
|
|
- this.formInline = {
|
|
|
- search: '',
|
|
|
- shelveState: '',
|
|
|
- stock: '',
|
|
|
- classifyId: '',
|
|
|
- page: 1,
|
|
|
- pageSize: 10
|
|
|
- }
|
|
|
+ // this.formInline = {
|
|
|
+ // search: '',
|
|
|
+ // shelveState: '',
|
|
|
+ // stock: '',
|
|
|
+ // page: 1,
|
|
|
+ // pageSize: 10
|
|
|
+ // }
|
|
|
this.getAll(this.formInline)
|
|
|
this.closeModal()
|
|
|
},
|
|
@@ -332,7 +317,7 @@ export default {
|
|
|
})
|
|
|
const res = await productExport(this.formInline);
|
|
|
if (!res) { return }
|
|
|
- const blob = new Blob([ res ], { type: 'application/vnd.ms-excel' })
|
|
|
+ const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
|
|
const fileName = '商品数据明细表.xls'
|
|
|
if ('download' in document.createElement('a')) {
|
|
|
// 非IE下载
|
|
@@ -539,7 +524,7 @@ export default {
|
|
|
downloadTemplate().then((res) => {
|
|
|
console.log(res, 1111)
|
|
|
// const content = res
|
|
|
- const blob = new Blob([ res ])
|
|
|
+ const blob = new Blob([res])
|
|
|
const fileName = '批量导入商品模板.xlsx'
|
|
|
if ('download' in document.createElement('a')) {
|
|
|
// 非IE下载
|
|
@@ -627,78 +612,78 @@ export default {
|
|
|
@import url("../../../styles/elDialog.scss");
|
|
|
|
|
|
.pending {
|
|
|
- padding: 30px;
|
|
|
+ padding: 30px;
|
|
|
}
|
|
|
|
|
|
.fenye {
|
|
|
- margin-top: 20px;
|
|
|
+ margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.clickMe {
|
|
|
- color: #3a68f2;
|
|
|
- cursor: pointer;
|
|
|
+ color: #3a68f2;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.uploadDialog {
|
|
|
|
|
|
- // display: flex;
|
|
|
- // flex-direction: column;
|
|
|
- // justify-content: center;
|
|
|
- >>>.el-upload__tip {
|
|
|
- display: inline-block;
|
|
|
- width: 360px;
|
|
|
- margin: auto;
|
|
|
- }
|
|
|
+ // display: flex;
|
|
|
+ // flex-direction: column;
|
|
|
+ // justify-content: center;
|
|
|
+ >>>.el-upload__tip {
|
|
|
+ display: inline-block;
|
|
|
+ width: 360px;
|
|
|
+ margin: auto;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.vipDialog {
|
|
|
- .priceTable {
|
|
|
- table {
|
|
|
- width: 100%;
|
|
|
- text-align: center;
|
|
|
- border-left: 1px solid #EBEEF5;
|
|
|
- border-bottom: 1px solid #EBEEF5;
|
|
|
- font-size: 14px;
|
|
|
- color: #606266;
|
|
|
- border-collapse: collapse;
|
|
|
+ .priceTable {
|
|
|
+ table {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ border-left: 1px solid #EBEEF5;
|
|
|
+ border-bottom: 1px solid #EBEEF5;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #606266;
|
|
|
+ border-collapse: collapse;
|
|
|
|
|
|
- tr {
|
|
|
- border-top: 1px solid #EBEEF5;
|
|
|
+ tr {
|
|
|
+ border-top: 1px solid #EBEEF5;
|
|
|
|
|
|
- th {
|
|
|
- padding: 12px 0;
|
|
|
- background: #EEF3FF;
|
|
|
- color: #333;
|
|
|
- border-right: 1px solid #EBEEF5;
|
|
|
- }
|
|
|
+ th {
|
|
|
+ padding: 12px 0;
|
|
|
+ background: #EEF3FF;
|
|
|
+ color: #333;
|
|
|
+ border-right: 1px solid #EBEEF5;
|
|
|
+ }
|
|
|
|
|
|
- td {
|
|
|
- padding: 12px 0;
|
|
|
- border-right: 1px solid #EBEEF5;
|
|
|
+ td {
|
|
|
+ padding: 12px 0;
|
|
|
+ border-right: 1px solid #EBEEF5;
|
|
|
|
|
|
- &.td-input {
|
|
|
- .el-input {
|
|
|
- width: 80px;
|
|
|
- margin-right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
+ &.td-input {
|
|
|
+ .el-input {
|
|
|
+ width: 80px;
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- &:nth-child(1),
|
|
|
- &:nth-child(2) {
|
|
|
- width: 80px;
|
|
|
- }
|
|
|
+ &:nth-child(1),
|
|
|
+ &:nth-child(2) {
|
|
|
+ width: 80px;
|
|
|
+ }
|
|
|
|
|
|
- .el-input {
|
|
|
- width: 100px;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ .el-input {
|
|
|
+ width: 100px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .clearBtn {
|
|
|
- margin-top: 20px;
|
|
|
- }
|
|
|
+ .clearBtn {
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|