Commit 8302466e by LJM

css

parent 716e227a
No preview for this file type
...@@ -12,6 +12,7 @@ const List = resolve => require(['@/views/Store/list.vue'], resolve); ...@@ -12,6 +12,7 @@ const List = resolve => require(['@/views/Store/list.vue'], resolve);
const ListDetail = resolve => require(['@/views/Store/listDetail.vue'], resolve); const ListDetail = resolve => require(['@/views/Store/listDetail.vue'], resolve);
const Enter = resolve => require(['@/views/Store/enter.vue'], resolve); const Enter = resolve => require(['@/views/Store/enter.vue'], resolve);
const Goodslist = resolve => require(['@/views/Store/goodslist.vue'], resolve); const Goodslist = resolve => require(['@/views/Store/goodslist.vue'], resolve);
const GoodDetail = resolve => require(['@/views/Store/goodDetail.vue'], resolve);
const Goods = resolve => require(['@/views/Goods/goods.vue'], resolve); const Goods = resolve => require(['@/views/Goods/goods.vue'], resolve);
const Message = resolve => require(['@/views/Info/message.vue'], resolve); const Message = resolve => require(['@/views/Info/message.vue'], resolve);
const Login = resolve => require(['@/views/User/login.vue'], resolve); const Login = resolve => require(['@/views/User/login.vue'], resolve);
...@@ -102,6 +103,14 @@ const routes = [ ...@@ -102,6 +103,14 @@ const routes = [
component: Goodslist component: Goodslist
}, },
{ {
path: '/goodDetail',
name: 'goodDetail',
meta: {
title: '导入详情'
},
component: GoodDetail
},
{
path: '/goods', path: '/goods',
name: 'Goods', name: 'Goods',
meta: { meta: {
......
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
</div> </div>
<div slot="footer" class="dialog-footer row" style="text-align: right;justify-content: flex-end;"> <div slot="footer" class="dialog-footer row" style="text-align: right;justify-content: flex-end;">
<el-button @click="dialogVisible = false" style="margin-right: 10px;">取 消</el-button> <el-button @click="dialogVisible = false" style="margin-right: 10px;">取 消</el-button>
<el-upload :data="fileData" :action="uploadUrl" :on-change="handleChange" multiple> <el-upload :data="fileData" :action="uploadUrl" :on-success="handleChange" multiple>
<el-button type="primary" @click="uploadChange">确 定</el-button> <el-button type="primary">确 定</el-button>
</el-upload> </el-upload>
</div> </div>
</div> </div>
...@@ -84,10 +84,10 @@ import Vue from 'vue'; ...@@ -84,10 +84,10 @@ import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import Tool from '../../tool' import Tool from '../../tool'
import {NODE_ENVS} from "../../ajax"; import {NODE_ENVS} from "../../ajax";
import {Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Radio, Select, Table, TableColumn, Tag, Upload} from 'element-ui' import {Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Radio, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Tag); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Tag).use(Tooltip);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio);
export default { export default {
name: "enter", name: "enter",
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
uploadUrl: NODE_ENVS + '/api/uploadSku/import', uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: { fileData: {
token: Tool.getCookie('token'), token: Tool.getCookie('token'),
type:"1"//1覆盖 2新增 type: "1"//1覆盖 2新增
}, },
formParam: { formParam: {
status: '', status: '',
...@@ -165,10 +165,7 @@ export default { ...@@ -165,10 +165,7 @@ export default {
* @returns {boolean} * @returns {boolean}
*/ */
handleChange(file, fileList) { handleChange(file, fileList) {
if (!file.response) { if (file.code === 0) {
return false;
}
if (file.response.code === 0) {
this.$message({ this.$message({
message: '导入成功', message: '导入成功',
type: 'success' type: 'success'
...@@ -177,7 +174,7 @@ export default { ...@@ -177,7 +174,7 @@ export default {
this.getData(); this.getData();
} else { } else {
this.$message({ this.$message({
message: res.msg, message: file.msg,
type: 'warning' type: 'warning'
}); });
} }
...@@ -220,12 +217,6 @@ export default { ...@@ -220,12 +217,6 @@ export default {
}) })
}, },
/**
* 导入数据确认提交
*/
uploadChange() {
},
handleSizeChange(val) { handleSizeChange(val) {
this.limit = val; this.limit = val;
this.getData(); this.getData();
......
<template>
<div class="listDetail pagex">
<el-descriptions style="width: 600px" :column="4">
<el-descriptions-item label="导入总数">{{ importDetail.count }}</el-descriptions-item>
<el-descriptions-item label="导入成功"><span class="alink">{{ importDetail.success_count }}</span></el-descriptions-item>
<el-descriptions-item label="导入失败"><span style="color: red">{{ importDetail.failed_count }}</span></el-descriptions-item>
<el-descriptions-item label="导入时间">{{ importDetail.import_time }}</el-descriptions-item>
</el-descriptions>
<!--操作区-->
<div class="operation-area row" style="margin-top: 10px;">
<div class="operation-button row verCenter">
<a class="downTemplateExport" @click="exportChange">导出失败数据</a>
<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>
</el-tooltip>
</div>
</div>
<!--列表区-->
<div class="data-box" v-if="tableData">
<el-table :data="tableData" border max-height="600">
<el-table-column prop="import_res" label="导入结果" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.import_res == 1" class="f-blue">成功</span>
<span v-else-if="scope.row.import_res == 2" class="f-red1">失败</span>
<span v-else-if="scope.row.import_res == 3" class="f-yellow1">导入中</span>
</template>
</el-table-column>
<el-table-column prop="failed_reason" label="失败原因" min-width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_name" label="型号" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brand_name" label="品牌" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="start_order_number" label="起订量" width="100" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="currency" label="币种" width="120" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="price_origin" label="价格" width="120" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="batch" label="批次" width="100" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="stock_number" label="库存" width="100" :show-overflow-tooltip="true"></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>
</div>
<Menu/>
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip} 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);
export default {
name: "goodDetail",
data() {
return {
total: 0,
limit: 10,
page: 1,
importDetail: {},
tableData: [],
multipleSelection: []
};
},
watch: {
$route(to, from) {
if (to.path == from.path) {
this.getData()
}
}
},
created() {
this.getData()
},
methods: {
/**
* 获取列表数据
*/
getData() {
this.$http('GET', "/api/bestgoods/importDetail", {
page: this.page,
limit: this.limit,
import_sn: this.$route.query.import_sn
}).then(res => {
if (res.code === 0) {
this.importDetail = res.data;
this.tableData = res.data.list;
this.total = res.data.count || 0;
} else {
this.$message(res.msg);
}
})
},
/**
* 导出文件
*/
exportChange() {
var url = NODE_ENVS + '/api/bestgoods/exportFailedGoods?import_sn=' + this.$route.query.import_sn + '&token=' + Tool.getCookie('token');
const newsUrl = this.$router.resolve(url);
window.open(url);
},
handleSizeChange(val) {
this.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.page = val;
this.getList();
},
},
components: {
Menu
}
};
</script>
<style scoped>
@import "../../assets/css/store/listDetail.min.css";
.btn-nav {
background: #FFFFFF;
padding: 0 0 20px 20px;
}
::v-deep .el-descriptions-item__label {
white-space: nowrap;
}
::v-deep .el-descriptions-item__content {
white-space: nowrap;
}
.downTemplateExport {
width: 92px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-right: 10px;
display: block;
cursor: pointer;
}
</style>
\ No newline at end of file
...@@ -153,8 +153,10 @@ ...@@ -153,8 +153,10 @@
<el-button type="danger" @click="delBestgoods">删除</el-button> <el-button type="danger" @click="delBestgoods">删除</el-button>
<el-button type="primary" @click="isJoinInquiryChange(1)">参与询价</el-button> <el-button type="primary" @click="isJoinInquiryChange(1)">参与询价</el-button>
<el-button type="primary" @click="isJoinInquiryChange(2)">不参与询价</el-button> <el-button type="primary" @click="isJoinInquiryChange(2)">不参与询价</el-button>
<el-button type="primary">下载模板</el-button> <a href="/云芯-优势货源导入模板.xlsx" class="downTemplate">下载模版</a>
<el-button type="primary">批量导入</el-button> <el-upload :data="fileData" :action="uploadUrl" :on-success="importTemplate" :show-file-list="false">
<el-button type="primary">批量导入</el-button>
</el-upload>
</div> </div>
<div class="text-tip row verCenter"> <div class="text-tip row verCenter">
<i class="el-icon-warning"></i> <i class="el-icon-warning"></i>
...@@ -494,15 +496,17 @@ ...@@ -494,15 +496,17 @@
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip,Upload} from 'element-ui'
import {NODE_ENVS} from "../../ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag) Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag)
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination) Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Upload)
export default { export default {
name: "list", name: "goodslisr",
data() { data() {
return { return {
logs: [], logs: [],
...@@ -510,6 +514,10 @@ export default { ...@@ -510,6 +514,10 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
uploadUrl: NODE_ENVS + '/api/bestgoods/importTemplate',
fileData: {
token: Tool.getCookie('token')
},
dialogVisible: false, dialogVisible: false,
visible: [false],//批次弹窗 visible: [false],//批次弹窗
visibleUpdate: [false],//更新批次弹窗 visibleUpdate: [false],//更新批次弹窗
...@@ -590,6 +598,31 @@ export default { ...@@ -590,6 +598,31 @@ export default {
}) })
}, },
/** /**
* 批量导入
* @param file
* @param fileList
*/
importTemplate(file, fileList) {
var that=this;
if (file.code === 0) {
this.$message({
message: '导入成功',
type: 'success',
onClose(){
that.$router.push({
path: "/goodDetail",
query: { import_sn: file.data.import_sn},
});
}
});
} else {
this.$message({
message: file.msg,
type: 'warning'
});
}
},
/**
* 统计查看 * 统计查看
* @param val * @param val
*/ */
...@@ -1123,5 +1156,20 @@ export default { ...@@ -1123,5 +1156,20 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.downTemplate {
width: 68px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
}
@import "../../assets/css/store/goodslist.min.css"; @import "../../assets/css/store/goodslist.min.css";
</style> </style>
\ No newline at end of file
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
<el-button type="primary" @click="changeStatus(1)">上架</el-button> <el-button type="primary" @click="changeStatus(1)">上架</el-button>
<el-button type="primary" @click="changeStatus(3)">下架</el-button> <el-button type="primary" @click="changeStatus(3)">下架</el-button>
<a class="downTemplateExport" @click="exportChange">导出失败文件</a> <a class="downTemplateExport" @click="exportChange">导出失败文件</a>
<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>
</el-tooltip>
</div> </div>
</div> </div>
<!--列表区--> <!--列表区-->
...@@ -45,13 +49,13 @@ ...@@ -45,13 +49,13 @@
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag} from 'element-ui' import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag,Tooltip} from 'element-ui'
import {NODE_ENVS} from "@/ajax"; import {NODE_ENVS} from "@/ajax";
import Tool from "@/tool"; import Tool from "@/tool";
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem); Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip);
export default { export default {
name: "ListDetail", name: "ListDetail",
data() { data() {
...@@ -129,19 +133,9 @@ export default { ...@@ -129,19 +133,9 @@ export default {
* 导出文件 * 导出文件
*/ */
exportChange(){ exportChange(){
var up_sn = this.tableData[0].up_sn; var url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.$route.query.sn + '&token=' + Tool.getCookie('token');
this.$http('GET', "/api/uploadSku/exportErrorItemList",{ const newsUrl = this.$router.resolve(url);
up_sn:up_sn window.open(url);
}).then(res => {
if (res.code === 0) {
this.toUrl( NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + up_sn + '&token=' + Tool.getCookie('token'));
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
}, },
toUrl(url){ toUrl(url){
var htmlArr = []; var htmlArr = [];
......
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