|
@@ -1,48 +1,81 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="app-container calendar-list-container">
|
|
|
|
|
-
|
|
|
|
|
- <!-- 查询和其他操作 -->
|
|
|
|
|
- <div class="filter-container">
|
|
|
|
|
- <el-input clearable class="filter-item" style="width: 200px;" placeholder="商品名称"
|
|
|
|
|
- v-model="listQuery.productName"></el-input>
|
|
|
|
|
- <el-input clearable class="filter-item" style="width: 200px;" placeholder="商品简称"
|
|
|
|
|
- v-model="listQuery.productShortForm"></el-input>
|
|
|
|
|
-
|
|
|
|
|
- <!-- <treeselect class="filter-item" default-expand-all v-model="listQuery.categoryId" :options="categoryOptions"
|
|
|
|
|
- :normalizer="normalizer" placeholder="商品类别" style="width: 200px" /> -->
|
|
|
|
|
- <el-cascader
|
|
|
|
|
- clearable
|
|
|
|
|
- class="filter-item"
|
|
|
|
|
- placeholder="商品类别"
|
|
|
|
|
- style="width: 200px"
|
|
|
|
|
- v-model="listQuery.categoryId"
|
|
|
|
|
- :options="categoryOptions"
|
|
|
|
|
- :props="{
|
|
|
|
|
- label: 'categoryName',
|
|
|
|
|
- value: 'id',
|
|
|
|
|
- emitPath: false,
|
|
|
|
|
- checkStrictly: true
|
|
|
|
|
- }"
|
|
|
|
|
- />
|
|
|
|
|
- <el-select class="filter-item" style="width: 200px" v-model="listQuery.brandId" filterable placeholder="品牌">
|
|
|
|
|
- <el-option v-for="item in brandOptions" :key="item.value" :label="item.label" :value="item.value">
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- <el-select v-model="listQuery.status" clearable placeholder="状态" class="filter-item" style="width: 200px;">
|
|
|
|
|
- <el-option :key="item.type" v-for="item in goodsStatusList" :label="item.name" :value="item.type">
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <div class="app-container">
|
|
|
|
|
+ <el-form :model="listQuery" size="small" :inline="true" label-position="top">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="商品名称">
|
|
|
|
|
+ <el-input clearable placeholder="商品名称" v-model="listQuery.productName"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="商品简称">
|
|
|
|
|
+ <el-input clearable placeholder="商品简称" v-model="listQuery.productShortForm"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="商品类别">
|
|
|
|
|
+ <el-cascader clearable placeholder="商品类别" style="width: 100%" v-model="listQuery.categoryId"
|
|
|
|
|
+ :options="categoryOptions" :props="{
|
|
|
|
|
+ label: 'categoryName',
|
|
|
|
|
+ value: 'id',
|
|
|
|
|
+ emitPath: false,
|
|
|
|
|
+ checkStrictly: true
|
|
|
|
|
+ }" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="品牌">
|
|
|
|
|
+ <el-select v-model="listQuery.brandId" filterable placeholder="品牌" style="width: 100%">
|
|
|
|
|
+ <el-option v-for="item in brandOptions" :key="item.value" :label="item.label"
|
|
|
|
|
+ :value="item.value">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
|
|
|
- <el-button class="filter-item" type="primary" v-waves icon="el-icon-search"
|
|
|
|
|
- @click="handleQuery">查找</el-button>
|
|
|
|
|
- <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
|
|
- <el-button class="filter-item" type="primary" @click="handleAdd" icon="el-icon-plus">添加</el-button>
|
|
|
|
|
- <el-button class="filter-item" type="info" @click="handleImport" icon="el-icon-upload2">导入</el-button>
|
|
|
|
|
- <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownLoad">导出</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="状态">
|
|
|
|
|
+ <el-select v-model="listQuery.status" clearable placeholder="状态" style="width: 100%">
|
|
|
|
|
+ <el-option :key="item.type" v-for="item in goodsStatusList" :label="item.name"
|
|
|
|
|
+ :value="item.type">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
|
|
|
- <!-- 查询结果 -->
|
|
|
|
|
- <el-table size="small" :data="list" v-loading="listLoading" element-loading-text="正在查询中。。。" border fit
|
|
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="搜索">
|
|
|
|
|
+ <el-button style="width: 100%;" type="primary" icon="el-icon-search"
|
|
|
|
|
+ @click="handleQuery">搜索</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="重置">
|
|
|
|
|
+ <el-button style="width: 100%;" icon="el-icon-refresh" type="primary"
|
|
|
|
|
+ @click="resetQuery">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="primary" class="editButton" size="small" icon="el-icon-plus"
|
|
|
|
|
+ @click="handleAdd">添加</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="info" icon="el-icon-upload2" size="small" @click="handleImport">导入</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="warning" icon="el-icon-download" size="small" @click="handleDownLoad">导出</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <div class="border-card">
|
|
|
|
|
+ <!-- 查询结果 -->
|
|
|
|
|
+ <el-table height="450" size="small" :data="list" v-loading="listLoading" element-loading-text="正在查询中。。。" border fit
|
|
|
highlight-current-row>
|
|
highlight-current-row>
|
|
|
<el-table-column type="index" label="序号" header-align="center" align="center">
|
|
<el-table-column type="index" label="序号" header-align="center" align="center">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -69,8 +102,8 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
<el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
|
|
- <el-button type="danger" size="small" @click="handleDelete(scope.row.id)">删除</el-button>
|
|
|
|
|
|
|
+ <el-button type="text" icon="el-icon-edit" class="editText" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
|
|
+ <el-button type="text" icon="el-icon-delete" class="deleteText" size="small" @click="handleDelete(scope.row.id)">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -82,6 +115,8 @@
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
|
</el-pagination>
|
|
</el-pagination>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<!-- 添加或修改对话框 -->
|
|
<!-- 添加或修改对话框 -->
|
|
|
<el-dialog :close-on-click-modal="false" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"
|
|
<el-dialog :close-on-click-modal="false" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"
|
|
|
width="70%">
|
|
width="70%">
|
|
@@ -101,25 +136,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="商品类别" prop="categoryId">
|
|
<el-form-item label="商品类别" prop="categoryId">
|
|
|
- <el-cascader
|
|
|
|
|
- placeholder="请选择商品类别"
|
|
|
|
|
- style="width: 100%;"
|
|
|
|
|
- v-model="dataForm.categoryId"
|
|
|
|
|
- :options="categoryOptions"
|
|
|
|
|
- :props="{
|
|
|
|
|
- label: 'categoryName',
|
|
|
|
|
- value: 'id',
|
|
|
|
|
- emitPath: false,
|
|
|
|
|
- checkStrictly: true
|
|
|
|
|
- }"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-cascader placeholder="请选择商品类别" style="width: 100%;" v-model="dataForm.categoryId"
|
|
|
|
|
+ :options="categoryOptions" :props="{
|
|
|
|
|
+ label: 'categoryName',
|
|
|
|
|
+ value: 'id',
|
|
|
|
|
+ emitPath: false,
|
|
|
|
|
+ checkStrictly: true
|
|
|
|
|
+ }" />
|
|
|
<!-- <treeselect default-expand-all v-model="dataForm.categoryId" :options="categoryOptions"
|
|
<!-- <treeselect default-expand-all v-model="dataForm.categoryId" :options="categoryOptions"
|
|
|
:normalizer="normalizer" placeholder="请选择商品类别" /> -->
|
|
:normalizer="normalizer" placeholder="请选择商品类别" /> -->
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="品牌" prop="brandId">
|
|
<el-form-item label="品牌" prop="brandId">
|
|
|
<el-select style="width: 100%" v-model="dataForm.brandId" filterable placeholder="请选择品牌">
|
|
<el-select style="width: 100%" v-model="dataForm.brandId" filterable placeholder="请选择品牌">
|
|
|
- <el-option v-for="item in brandOptions" :key="item.value" :label="item.label" :value="item.value">
|
|
|
|
|
|
|
+ <el-option v-for="item in brandOptions" :key="item.value" :label="item.label"
|
|
|
|
|
+ :value="item.value">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -167,7 +198,8 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="茶叶系列">
|
|
<el-form-item label="茶叶系列">
|
|
|
- <el-select v-model="dataForm.teaSeries" filterable placeholder="请选择茶叶系列" style="width: 100%">
|
|
|
|
|
|
|
+ <el-select v-model="dataForm.teaSeries" filterable placeholder="请选择茶叶系列"
|
|
|
|
|
+ style="width: 100%">
|
|
|
<el-option :key="item.dictLabel" v-for="item in tea_series" :label="item.dictLabel"
|
|
<el-option :key="item.dictLabel" v-for="item in tea_series" :label="item.dictLabel"
|
|
|
:value="item.dictLabel">
|
|
:value="item.dictLabel">
|
|
|
</el-option>
|
|
</el-option>
|
|
@@ -176,8 +208,8 @@
|
|
|
<el-form-item label="包装形式">
|
|
<el-form-item label="包装形式">
|
|
|
<el-select v-model="dataForm.teaPackageFormat" multiple filterable placeholder="请选择包装形式"
|
|
<el-select v-model="dataForm.teaPackageFormat" multiple filterable placeholder="请选择包装形式"
|
|
|
style="width: 100%">
|
|
style="width: 100%">
|
|
|
- <el-option :key="item.dictLabel" v-for="item in tea_package_format" :label="item.dictLabel"
|
|
|
|
|
- :value="item.dictLabel">
|
|
|
|
|
|
|
+ <el-option :key="item.dictLabel" v-for="item in tea_package_format"
|
|
|
|
|
+ :label="item.dictLabel" :value="item.dictLabel">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -186,11 +218,13 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="采摘季节">
|
|
<el-form-item label="采摘季节">
|
|
|
<el-radio-group v-model="dataForm.teaGetSeason">
|
|
<el-radio-group v-model="dataForm.teaGetSeason">
|
|
|
- <el-radio v-for="item in tea_get_season" :key="item.dictLabel" :label="item.dictLabel"></el-radio>
|
|
|
|
|
|
|
+ <el-radio v-for="item in tea_get_season" :key="item.dictLabel"
|
|
|
|
|
+ :label="item.dictLabel"></el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="保质期">
|
|
<el-form-item label="保质期">
|
|
|
- <el-input placeholder="数值" v-model="dataForm.teaGuaranteeNumber" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" class="input-with-select">
|
|
|
|
|
|
|
+ <el-input placeholder="数值" v-model="dataForm.teaGuaranteeNumber"
|
|
|
|
|
+ onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" class="input-with-select">
|
|
|
<el-select style="width: 100px;" v-model="dataForm.teaGuaranteeUnit" slot="prepend"
|
|
<el-select style="width: 100px;" v-model="dataForm.teaGuaranteeUnit" slot="prepend"
|
|
|
placeholder="请选择">
|
|
placeholder="请选择">
|
|
|
<el-option label="年" value="年"></el-option>
|
|
<el-option label="年" value="年"></el-option>
|
|
@@ -204,18 +238,21 @@
|
|
|
placeholder="选择日期" value-format="yyyy-MM-dd"></el-date-picker>
|
|
placeholder="选择日期" value-format="yyyy-MM-dd"></el-date-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="年份">
|
|
<el-form-item label="年份">
|
|
|
- <el-input v-model="dataForm.teaAgingYear" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" placeholder="请输入年份"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="dataForm.teaAgingYear" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
|
|
|
|
|
+ placeholder="请输入年份"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="溯源信息" prop="teaFiles">
|
|
<el-form-item label="溯源信息" prop="teaFiles">
|
|
|
- <el-upload :limit="1" :action="fileImgUrl" :file-list="dataForm.files" :on-success="handleFileSuccess"
|
|
|
|
|
- :before-upload="beforeUploadFile" :on-remove="handleRemoveFile">
|
|
|
|
|
|
|
+ <el-upload :limit="1" :action="fileImgUrl" :file-list="dataForm.files"
|
|
|
|
|
+ :on-success="handleFileSuccess" :before-upload="beforeUploadFile"
|
|
|
|
|
+ :on-remove="handleRemoveFile">
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
<span style="color: #F56C6C;">备注:如有机认证、质检报告等</span>
|
|
<span style="color: #F56C6C;">备注:如有机认证、质检报告等</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="存储要求">
|
|
<el-form-item label="存储要求">
|
|
|
<el-checkbox-group v-model="dataForm.teaStorageRequire">
|
|
<el-checkbox-group v-model="dataForm.teaStorageRequire">
|
|
|
- <el-checkbox v-for="item in tea_storage_require" :key="item.dictLabel" :label="item.dictLabel" name="type"></el-checkbox>
|
|
|
|
|
|
|
+ <el-checkbox v-for="item in tea_storage_require" :key="item.dictLabel"
|
|
|
|
|
+ :label="item.dictLabel" name="type"></el-checkbox>
|
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
@@ -230,18 +267,21 @@
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<!-- 商品导入对话框 -->
|
|
<!-- 商品导入对话框 -->
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
- <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleProductTemplate" :auto-upload="false" drag>
|
|
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
|
|
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
- <div class="el-upload__tip text-center" slot="tip">
|
|
|
|
|
- <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
|
- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
|
|
|
|
|
|
+ <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"
|
|
|
|
|
+ :disabled="upload.isUploading" :on-progress="handleFileUploadProgress"
|
|
|
|
|
+ :on-success="handleProductTemplate" :auto-upload="false" drag>
|
|
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
+ <div class="el-upload__tip text-center" slot="tip">
|
|
|
|
|
+ <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
|
+ <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
|
|
|
|
|
+ @click="importTemplate">下载模板</el-link>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-upload>
|
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
|
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
|
- <el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -275,12 +315,12 @@ export default {
|
|
|
// 上传的地址
|
|
// 上传的地址
|
|
|
url: process.env.BASE_API + "/product/import"
|
|
url: process.env.BASE_API + "/product/import"
|
|
|
},
|
|
},
|
|
|
- tea_type:[],
|
|
|
|
|
- tea_level:[],
|
|
|
|
|
- tea_series:[],
|
|
|
|
|
- tea_package_format:[],
|
|
|
|
|
- tea_get_season:[],
|
|
|
|
|
- tea_storage_require:[],
|
|
|
|
|
|
|
+ tea_type: [],
|
|
|
|
|
+ tea_level: [],
|
|
|
|
|
+ tea_series: [],
|
|
|
|
|
+ tea_package_format: [],
|
|
|
|
|
+ tea_get_season: [],
|
|
|
|
|
+ tea_storage_require: [],
|
|
|
// 树选项
|
|
// 树选项
|
|
|
categoryOptions: [],
|
|
categoryOptions: [],
|
|
|
activeName: 'first',
|
|
activeName: 'first',
|
|
@@ -394,31 +434,31 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/** 导入按钮操作 */
|
|
/** 导入按钮操作 */
|
|
|
- handleImport() {
|
|
|
|
|
- this.upload.title = "商品导入";
|
|
|
|
|
- this.upload.open = true;
|
|
|
|
|
- },
|
|
|
|
|
- /** 下载模板操作 */
|
|
|
|
|
- importTemplate() {
|
|
|
|
|
- window.location.href = process.env.BASE_API + '/product/down/productTemplate';
|
|
|
|
|
- },
|
|
|
|
|
- // 文件上传中处理
|
|
|
|
|
- handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
- this.upload.isUploading = true;
|
|
|
|
|
- },
|
|
|
|
|
- // 文件上传成功处理
|
|
|
|
|
- handleProductTemplate(response, file, fileList) {
|
|
|
|
|
- this.upload.open = false;
|
|
|
|
|
- this.upload.isUploading = false;
|
|
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
|
|
- this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.data + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
|
|
- this.getList();
|
|
|
|
|
- },
|
|
|
|
|
- // 提交上传文件
|
|
|
|
|
- submitFileForm() {
|
|
|
|
|
- this.$refs.upload.submit();
|
|
|
|
|
- },
|
|
|
|
|
- handleDownLoad(){
|
|
|
|
|
|
|
+ handleImport() {
|
|
|
|
|
+ this.upload.title = "商品导入";
|
|
|
|
|
+ this.upload.open = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 下载模板操作 */
|
|
|
|
|
+ importTemplate() {
|
|
|
|
|
+ window.location.href = process.env.BASE_API + '/product/down/productTemplate';
|
|
|
|
|
+ },
|
|
|
|
|
+ // 文件上传中处理
|
|
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
+ this.upload.isUploading = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 文件上传成功处理
|
|
|
|
|
+ handleProductTemplate(response, file, fileList) {
|
|
|
|
|
+ this.upload.open = false;
|
|
|
|
|
+ this.upload.isUploading = false;
|
|
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
|
|
+ this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.data + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 提交上传文件
|
|
|
|
|
+ submitFileForm() {
|
|
|
|
|
+ this.$refs.upload.submit();
|
|
|
|
|
+ },
|
|
|
|
|
+ handleDownLoad() {
|
|
|
window.location.href = process.env.BASE_API + '/product/export?productName=' + this.listQuery.productName + '&productShortForm=' + this.listQuery.productShortForm;
|
|
window.location.href = process.env.BASE_API + '/product/export?productName=' + this.listQuery.productName + '&productShortForm=' + this.listQuery.productShortForm;
|
|
|
},
|
|
},
|
|
|
getListCategory() {
|
|
getListCategory() {
|
|
@@ -440,7 +480,7 @@ export default {
|
|
|
handleClick(tab, event) {
|
|
handleClick(tab, event) {
|
|
|
console.log(tab, event);
|
|
console.log(tab, event);
|
|
|
},
|
|
},
|
|
|
- getDictType(){
|
|
|
|
|
|
|
+ getDictType() {
|
|
|
//茶叶品牌tea_type
|
|
//茶叶品牌tea_type
|
|
|
dataTypeList({ dictType: 'tea_type' }).then(response => {
|
|
dataTypeList({ dictType: 'tea_type' }).then(response => {
|
|
|
this.tea_type = response.data.data;
|
|
this.tea_type = response.data.data;
|
|
@@ -493,12 +533,12 @@ export default {
|
|
|
for (let i in fileList) {
|
|
for (let i in fileList) {
|
|
|
let response = fileList[i].response;
|
|
let response = fileList[i].response;
|
|
|
if (response.errno && response.errno != "0") {
|
|
if (response.errno && response.errno != "0") {
|
|
|
- this.$message.error("该文件上传失败,已被移除,请重新上传!");
|
|
|
|
|
- // 上传失败移除该 file 对象
|
|
|
|
|
- fileList.splice(i, 1);
|
|
|
|
|
|
|
+ this.$message.error("该文件上传失败,已被移除,请重新上传!");
|
|
|
|
|
+ // 上传失败移除该 file 对象
|
|
|
|
|
+ fileList.splice(i, 1);
|
|
|
} else {
|
|
} else {
|
|
|
- let id = fileList[i].response.data.id;
|
|
|
|
|
- teaFiles.push(id);
|
|
|
|
|
|
|
+ let id = fileList[i].response.data.id;
|
|
|
|
|
+ teaFiles.push(id);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.dataForm.teaFiles = teaFiles.join(",");
|
|
this.dataForm.teaFiles = teaFiles.join(",");
|
|
@@ -629,7 +669,7 @@ export default {
|
|
|
this.dataForm.files.push({
|
|
this.dataForm.files.push({
|
|
|
name: name,
|
|
name: name,
|
|
|
url: url,
|
|
url: url,
|
|
|
- response: { error: "0", data: { url: url,id:id } },
|
|
|
|
|
|
|
+ response: { error: "0", data: { url: url, id: id } },
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|