Commit c71b2add by LJM

add

parent 913d7f9f
......@@ -23,30 +23,82 @@
<!--操作区-->
<div class="operation-area row verCenter bothSide">
<div class="operation-button row verCenter">
<el-button type="primary">导入</el-button>
<el-button type="primary" @click="importChange">导入</el-button>
<a href="/寄售商品导入.csv" download style="text-decoration: none;margin-left: 10px;">
<el-button type="primary">下载模板</el-button>
</a>
</div>
</div>
<!--列表区-->
<div class="data-box">
<div class="data-box th-all">
<el-table :data="list" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" align="center" fixed></el-table-column>
<el-table-column prop="msg_sn" label="单号" :show-overflow-tooltip="true" align="center">
<el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column label="单号" min-width="20%" align="center">
<template slot-scope="scope">
<el-link type="primary" @click="$router.push('/consignmentImportDetail')">{{ scope.row.id }}</el-link>
<a :href="'/#/listDetail?sn='+scope.row.up_sn+'&id='+scope.row.id" class="alink">{{ scope.row.up_sn }}</a>
</template>
</el-table-column>
<el-table-column prop="msg_type" label="文件名字" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="状态" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="导入方式" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="id" label="导入成功" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="id" label="导入失败" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="create_time" label="上传时间" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="file_name" label="文件名字" min-width="20%" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="120" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status==1" type="primary">待处理</el-tag>
<el-tag v-else-if="scope.row.status==2" type="warning">处理中</el-tag>
<el-tag v-else-if="scope.row.status==3" type="success">已处理</el-tag>
<el-tag v-else-if="scope.row.status==4" type="danger">失败</el-tag>
<el-tooltip :aa="scope" 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">{{ scope.row.status_tips }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="import_way" label="导入方式" width="120" align="center"></el-table-column>
<el-table-column prop="count_success" label="导入成功" width="160" align="center"></el-table-column>
<el-table-column prop="count_error" 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>
</div>
<!--导入数据确认-->
<el-dialog title="导入数据确认" :close-on-click-modal="false" :visible.sync="dialogVisible" width="700px">
<div class="dialog-text">
<p class="tt" style="font-size: 13px;margin-bottom: 0;">
上架最高天数:现货:{{ cp_time_day == -1 ? '无限制' : cp_time_day + '天' }};期货:{{ futures_cp_time_day == -1 ? '无限制' : futures_cp_time_day + '天' }}
</p>
<p class="tt" style="font-size: 13px;font-weight: normal;margin-bottom: 0;color: #ff7e11;">
<template v-if="cp_time_day == -1">
现货类型的商品,有效日期最高可填写到2035/1/1(长期有效)
</template>
<template v-else>
现货类型的商品,有效日期最高可设置为{{ cp_time_day }}天,{{ cp_time_day }}天后会自动从【猎芯网】下架
</template>
</p>
<p class="tt" style="font-size: 13px;font-weight: normal;color: #ff7e11;">
<template v-if="futures_cp_time_day == -1">
期货类型的商品,有效日期最高可填写到2035/1/1(长期有效)
</template>
<template v-else>
期货类型的商品,有效日期最高可设置为{{ futures_cp_time_day }}天,{{ futures_cp_time_day }}天后会自动从【猎芯网】下架
</template>
</p>
<p class="tt" style="font-size: 12px;">
上传的型号经由猎芯审核通过后,会展示在【猎芯网】进行售卖,并参与【猎芯询报价】系统自动推送询价<br/>
您此次上传的型号是否要对已在【猎芯网】展示的型号进行覆盖或是新增?
</p>
<p class="alink">覆盖:已在【猎芯网】进行展示的型号全部下架,展示现在新上传的型号;</p>
<p class="alink">新增:已在【猎芯网】进行展示的型号保持不变,额外加上新上传的型号;</p>
<div class="row" style="margin-top: 10px;margin-bottom: 10px;">
<el-radio v-model="fileData.type" label="1">覆盖</el-radio>
<el-radio v-model="fileData.type" label="2">新增</el-radio>
</div>
<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-upload :data="fileData" :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleChange" :on-progress="handleProgress">
<el-button type="primary" :loading="uploading">确 定</el-button>
<el-progress v-if="uploading" :percentage="progress"/>
</el-upload>
</div>
</div>
</el-dialog>
</div>
<Menu></Menu>
</div>
......@@ -54,24 +106,36 @@
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
import Tool from '@/tool'
import {NODE_ENVS} from "@/ajax";
import {Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, Option, Pagination, Progress, Radio, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui'
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
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).use(Progress);
export default {
name: "consignmentImport",
data() {
return {
cp_time_day: localStorage.getItem('cp_time_day') || '',//现货最高天数
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',//期货最高天数
uploadUrl: NODE_ENVS + '/api/uploadSku/import',//上传接口
fileData: {
token: Tool.getCookie('token'),
type: "1"//1覆盖 2新增
},
uploading: false,//上传状态
progress: 0,//上传进度
dialogVisible: false,
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
date: [],
status: '',
date: ''
source: 12
}
};
},
......@@ -80,7 +144,7 @@ export default {
},
methods: {
getData() {
var params = Object.assign({}, this.formParam, {page: this.page, limit: this.limit});
var params = Object.assign({}, {page: this.page, limit: this.limit, source: 12, status: this.formParam.status, action_time: this.formParam.date[0], end_time: this.formParam.date[1]});
this.$http('GET', "/api/uploadSku/list", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
......@@ -94,6 +158,57 @@ export default {
})
},
/**
* 导入
*/
importChange() {
this.dialogVisible = true;
this.progress = 0;
this.uploading = false;
},
/**
* 上传文件之前的钩子
*/
handleBeforeUpload() {
this.uploading = true
},
/**
* 文件上传时的钩子
* @param response
* @param file
* @param fileList
*/
handleProgress(event, file, fileList) {
this.progress = event.percent
},
/**
* 文件上传成功时的钩子
* @param file
* @param fileList
* @returns {boolean}
*/
handleChange(file, fileList) {
var that = this;
if (file.code === 0) {
that.dialogVisible = false;
that.page = 1;
that.getData();
this.$message({
message: '导入成功',
type: 'success',
onClose() {
}
});
} else {
this.progress = 0;
this.uploading = false;
this.$message({
message: file.msg,
type: 'warning'
});
}
},
/**
* 搜索
*/
onSubmit() {
......@@ -138,5 +253,28 @@ export default {
};
</script>
<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;
}
.dialog-text .tt {
color: #333;
font-weight: bold;
margin-bottom: 16px;
}
.dialog-text .alink {
font-size: 12px;
}
</style>
\ No newline at end of file
......@@ -31,9 +31,9 @@
<el-table-column prop="sku_id" label="SKUID" min-width="250" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="goods_name" label="型号" min-width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="" label="库存数量" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="" label="在途库存" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="" label="安全库存" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="stock" label="库存数量" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="in_transit_stock" label="在途库存" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="consignment_safe_stock" label="安全库存" width="200" :show-overflow-tooltip="true" 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>
</div>
......
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