Commit 01b28486 by LJM

库存导入-新增字段

parent ebd8a0cb
......@@ -48,7 +48,8 @@
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="latest_notice" label="最新上传状态" min-width="20%" align="center"></el-table-column>
<el-table-column prop="count_success" label="导入成功" width="160" align="center"></el-table-column>
<el-table-column prop="count_pass" label="导入失败" width="160" align="center"></el-table-column>
<el-table-column prop="create_time" label="上传时间" width="160" align="center"></el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
......
......@@ -12,6 +12,9 @@
<el-button type="primary" @click="changeStatus(1)">上架</el-button>
<el-button type="primary" @click="changeStatus(3)">下架</el-button>
<a class="downTemplateExport" @click="exportChange">导出失败文件</a>
<el-upload :data="fileData" :action="uploadUrl" :on-success="uploadChange" :show-file-list="false">
<el-button type="primary">导入</el-button>
</el-upload>
<el-tooltip class="item" effect="dark" placement="top-start">
<i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i>
<div slot="content">导出失败数据:本次导入的数据,导入结果为成功,先上传提交审核,导入结果为失败,进行导出重新上传</div>
......@@ -49,13 +52,13 @@
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag,Tooltip} from 'element-ui'
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip,Upload} from 'element-ui'
import {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip);
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default {
name: "ListDetail",
data() {
......@@ -67,7 +70,12 @@ export default {
page: 1,
tableData: "",
maxPrice: [],
multipleSelection: []
multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: {
token: Tool.getCookie('token'),
type: 2//1覆盖 2新增
},
};
},
watch: {
......@@ -130,14 +138,34 @@ export default {
})
},
/**
* 导入
*/
uploadChange(file, fileList) {
var that = this;
if (file.code === 0) {
this.$message({
message: '导入成功',
type: 'success',
onClose() {
}
});
} else {
this.$message({
message: file.msg,
type: 'error'
});
}
},
/**
* 导出文件
*/
exportChange(){
exportChange() {
var url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.$route.query.sn + '&token=' + Tool.getCookie('token');
const newsUrl = this.$router.resolve(url);
window.open(url);
},
toUrl(url){
toUrl(url) {
var htmlArr = [];
htmlArr.push('<form action="' + url + '" method="post" id="form" style="display: none">' +
' <input type="submit" value="提交">' +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment